An extension of Find the closest palindromic number mixed with Numbers Interpreted in Smallest Valid Base.
A number is a palindrome if its sequence of digits is the same when reading them from left to right as when reading from right to left. Usually, people think of base 10, but some numbers are palindromes in different bases. For example, 15 isn't palindromic in base 10, but in base 2, it's 1111, which is!
But if we're using arbitrary bases and given a random string, how do we know what base it's in? Let us interpret an alphanumeric string as if it were a number in some base, and the interpreted base \$b\$ of such a string is the smallest base where the string is still valid - that is, its highest digit plus one (151 is base 6, 238 is base 9). If the number has letters in it, interpret a as a digit representing 10, b as 11, and so on up to z as 35 (so 3ba is interpreted base 12, y2k is base 35, zz8 is base 36). If that number is a palindrome in that interpreted base, we'll call it base \$b\$ palindromic.
Given an alphanumeric string \$N\$ with interpreted base \$b\$, return an integer \$X\$, where \$|X|\$ is as small as possible, such that \$N+X\$ is base \$b\$ palindromic (that is, if \$N+X\$ is represented in base \$b\$, it is palindromic, and its highest digit in that base is \$b-1\$). If both \$X\$ and \$-X\$ are valid, you can return either (or both if it makes your code shorter).
Standard I/O rules apply. You may take input with uppercase letters instead of lowercase if you so desire (in which case A is 10, B is 11, and so on up to Z as 35, just like the lowercase letters). It is not necessary to handle both cases, nor mixed cases (you can assume you'll never get an input like 1lI, for example).
NEW: Per suggestions, you can choose to take input as a list of digits instead of as a string. If you do, you only need to handle digits up to 35 (just as if you had taken string input).
Examples
Sample inputs are given in lowercase. Sample outputs are shown in base 10.
Input | Digits | In Base-10 (Base) | Output (Sum in Target Base)
777 | 7,7,7 | 511 (base 8) | 0 (777)
10 | 1,0 | 2 (base 2) | 1 (11) OR -1 (1) (either is valid)
a1b | 10,1,11 | 1463 (base 12) | -26 (9b9)
hello | 17,14,21,21,24 | 6873049 (base 25) | 1693 (heoeh)
Take note of the last two examples: while you can subtract 1 from a1b to make it a1a in base 12, which is a palindrome, the highest digit is a (10), not b (11), so that string would have interpreted base-11 and thus isn't base-12 palindromic! Similarly, you can subtract 182 from hello to get heleh in base 25, but its highest digit is l (21), not o (24).