Daily iOS
CS fundamentals and algorithms

Base-36 string addition

You need to add two base-36 strings made of digits and letters without converting them to integers (so no overflow) and return the result as a string. How do you implement the per-digit conversion, carry handling, and leading zero removal?

How would an interviewer hear this answer? You'll see whether they'd move on, dig in, or say no, and which sentences would trip you up. Your score doesn't change.
See the short answer

Walk both strings from the end, converting each character to a 0 to 35 value and adding it with the carry; sum % 36 gives the result character and sum / 36 the next carry. Build the result reversed, append the final carry, and strip leading zeros.

Share a question