以上是个人方法,也是大部队用的,从后向前扫,有9就置0,没9就加1后返回。如果for循环结束,说明全是9,这时候就要把第一位置1,并且在末尾补充0. 下面是大佬写法: 原理和大众的一样,但是for循环用得相当6。 ...
分类:
其他好文 时间:
2018-04-16 18:36:17
阅读次数:
94
原题链接: "https://leetcode.com/problems/plus one/description/" 这道题目自己花了二十分钟解出来了,看了下讨论区别人家的答案之后,感觉自己脑子上装的就是一坨屎: Java import java.util.Arrays; / Created by ...
分类:
其他好文 时间:
2018-03-15 21:08:19
阅读次数:
173
Given a non negative integer represented as a non empty array of digits, plus one to the integer. You may assume the integer do not contain any leadin ...
分类:
其他好文 时间:
2018-03-03 20:28:18
阅读次数:
158
1.题目描述 Given a non-negative integer represented as a non-empty array of digits, plus one to the integer. You may assume the integer do not contain any ...
分类:
其他好文 时间:
2018-02-07 00:49:00
阅读次数:
129
Plus One 题解 题目来源:https://leetcode.com/problems/plus one/description/ Description Given a non negative integer represented as a non empty array of digi ...
分类:
其他好文 时间:
2018-02-03 16:19:07
阅读次数:
134
Given a non-negative integer represented as a non-empty array of digits, plus one to the integer. You may assume the integer do not contain any leadin ...
分类:
其他好文 时间:
2018-01-20 18:51:20
阅读次数:
164
Given a non-negative integer represented as non-empty a singly linked list of digits, plus one to the integer. You may assume the integer do not conta ...
分类:
其他好文 时间:
2017-12-04 15:00:47
阅读次数:
161
Given a non-negative integer represented as a non-empty array of digits, plus one to the integer. You may assume the integer do not contain any leadin ...
分类:
其他好文 时间:
2017-12-03 13:50:10
阅读次数:
108
Description: Given a non-negative integer represented as a non-empty array of digits, plus one to the integer. You may assume the integer do not conta ...
分类:
其他好文 时间:
2017-11-26 21:03:32
阅读次数:
131
Given a non-negative integer represented as a non-empty array of digits, plus one to the integer. You may assume the integer do not contain any leadin ...
分类:
其他好文 时间:
2017-10-20 21:32:21
阅读次数:
246