Inscription Leetcode brush (15) - 1 plus

Topics requirements:

Given a non-negative integer nonempty array of integers represented, on the basis of the number plus one.

Most significant digit stored in the first array, each element of the array stores only a single digit.

You may assume that in addition to the integer 0, the integer does not begin with a zero.

answer:

The problem is relatively simple, only need to pay attention to carry on the line; there is an important point is that when the first 9:00 of the original array is required to add an element:

 

 

Guess you like

Origin www.cnblogs.com/wangjm63/p/11518921.html