Given a non-empty array of digits representing a non-negative integer, plus onetotheinteger.
The digits are stored such that the most significant digit is atthe head ofthe list, andeachelementinthe array contain a single digit.
You may assume theinteger does not contain any leading zero, except thenumber0 itself.
Example 1:
Input: [1,2,3]
Output: [1,2,4]
Explanation: The array represents theinteger123.
Example 2:
Input: [4,3,2,1]
Output: [4,3,2,2]
Explanation: The array represents theinteger4321.
提交反馈:
109 / 109 test cases passed.
Status: Accepted
Runtime:0 ms
Submitted:0 minutes ago