Coding | Practice Questions Daily | C | C++ | Python | Java: post #110 — TG.ME

• Add One to Number

Given a non-negative number represented as an array of digits,

add 1 to the number ( increment the number represented by the digits ).

The digits are stored such that the most significant digit is at the head of the list.

Example:

If the vector has [1, 2, 3]

the returned vector should be [1, 2, 4]

as 123 + 1 = 124.

Topic : Arrays

Asked in Google, Microsoft

Join @coding_practice_questions
👍1
May 8, 2022 29K 46 36