digits, one digit per element, most significant first. There are no leading zeros (unless the number is 0 itself).
Add one to the number and return the result in the same form, as an array of digits.digits=[7, 0, 5] → [7, 0, 6]
705 + 1 = 706.
digits=[2, 9, 9] → [3, 0, 0]
299 + 1 = 300: the carry ripples through both nines.
digits=[9, 9] → [1, 0, 0]
99 + 1 = 100, so the answer has one more digit.
digits=[7, 0, 5]
[7, 0, 6]
Run checks the first 3 tests in your browser. Submit checks all 75 tests on the server, hidden ones included.