首页
Python
Java
IOS
Andorid
NodeJS
JavaScript
HTML5
【
ArrayEasyFinish
】的更多相关文章
ArrayEasyFinish
(1)Plus One 解题思路:模拟现实中做加法的方式,在个位加一,并考虑进位的情况.代码如下: public class Solution { public int[] plusOne(int[] digits) { int carries = 1; for (int i = digits.length - 1; i >= 0 && carries > 0; i--) { int sum = digits[i] + carries; digits[i] = sum % 10…