Add Two Numbers in Base K
The strings a and b are non-negative numbers written in base k (digits 0 to 9, each smaller than k). Return their sum, also written in base k with no leading zeros (zero is "0").
Example 1
a "27"
b "16"
k 8
returns "45"
23 + 14 = 37, which is 45 in base 8.
Constraints
1 <= len(a), len(b) <= 82 <= k <= 10
Write it in your browser, against the clock. The model solution, stepped through line by line, comes after.