Add digits in reverse way

Submit a working solution and we'll reach out to setup an interview. Correctness matters more than speed. We don't care how long you take.

Write a function to add digits left to right AND carry the right digit rather than carrying the left digit.

For example:

1 + 10 = 20 // Add digits left to right
51 + 51 = 12 // 5 + 5 = 10, so carry the right digit, 0, to get 0 + 1 + 1 = 2
99 + 99 = 126 // 9 + 9 = 18, carrying the 8, we get 8 + 9 + 9 = 26 for the rightmost digits

Comments (1)