7. Plus One
A non-negative integer is represented by the array digits. Add one to the integer and return the resulting digits.
範例 1:
輸入: digits = [1,2,3] 輸出: [1,2,4]
範例 2:
輸入: digits = [9] 輸出: [1,0]
限制條件:
1 <= digits.length <= 100
A non-negative integer is represented by the array digits. Add one to the integer and return the resulting digits.
輸入: digits = [1,2,3] 輸出: [1,2,4]
輸入: digits = [9] 輸出: [1,0]
1 <= digits.length <= 100