Back to problems

Add Two Strings with a Single-Digit Adder

Algorithm · Two Sigma · Medium

Requirements Assume you have a helper capable of adding one digit to another. Build string-based addition for a pair of numeric strings using that capability. Expected behavior: Each argument is a string encoding a non-negative whole number. Process the characters starting at the rightmost end and move leftward. Carry any overflow into the next digit position. Produce the resulting total as a string. State the algorithm's time and memory costs. Notes Although this is a basic…

Checking your access…