The digits of a very large number are stored in the array digits. The most important (leftmost) digit comes first. The number has no leading zeros.
Add one to the number. Return the digits of the new number in the same format.
Examples
Example 1:
Input: digits = [2,9,9]
Output: [3,0,0]
Explanation: The number is 299. Adding 1 gives 300.
Example 2:
Input: digits = [7,0,4]
Output: [7,0,5]
Explanation: 704 + 1 = 705. No carry is needed.
Example 3:
Input: digits = [9,9]
Output: [1,0,0]
Explanation: 99 + 1 = 100. The answer has one more digit than the input.