Given a non-negative number represented as an array of digits, plus one to the number.The digits are stored such that the most significant digit is at...
分类:
其他好文 时间:
2015-02-09 15:25:20
阅读次数:
107
Plus One
Total Accepted: 34829 Total
Submissions: 111864My Submissions
Question
Solution
Given a non-negative number represented as an array of digits, plus one to the number.
Th...
分类:
其他好文 时间:
2015-02-05 11:26:14
阅读次数:
186
For example,
a = "11"
b = "1"
Return "100".
这题的做法和前面一题plus one 一样,区别在于需要将两个string先相加,再判断是否要进位。
直接上代码吧。
class Solution:
# @param a, a string
# @param b, a string
# @return a string
...
分类:
编程语言 时间:
2015-02-05 09:36:04
阅读次数:
153
Given a non-negative number represented as an array of digits, plus one to the number.The digits are stored such that the most significant digit is at...
分类:
其他好文 时间:
2015-02-04 21:39:11
阅读次数:
115
Given a non-negative number represented as an array of digits, plus one to the number.
The digits are stored such that the most significant digit is at the head of the list.
// https://oj.leetco...
分类:
其他好文 时间:
2015-01-30 00:10:30
阅读次数:
202
标题:Valid Parentheses通过率:27.7%难度:简单Given a string containing just the characters'(',')','{','}','['and']', determine if the input string is valid.The b...
分类:
其他好文 时间:
2015-01-18 12:57:08
阅读次数:
130
题目:Given a non-negative number represented as an array of digits, plus one to the number.The digits are stored such that the most significant digit is...
分类:
编程语言 时间:
2015-01-16 23:37:11
阅读次数:
215
标题:Plus One通过率:31.1%难度:简单Given a non-negative number represented as an array of digits, plus one to the number.The digits are stored such that the mos...
分类:
其他好文 时间:
2015-01-16 16:22:45
阅读次数:
156
Given a non-negative number represented as an array of digits, plus one to the number. The digits are stored such that the most significant digit is a...
分类:
移动开发 时间:
2015-01-13 10:20:37
阅读次数:
218
LeetCode Plus One Java版解题报告
题意:一个整数按位存储于一个int数组中,排列顺序为:最高位在array[0] ,最低位在[n-1],例如:98,存储为:array[0]=9; array[1]=8;
解题思路,从数组的最后一位开始加1,需要考虑进位,如果到[0]位之后仍然有进位存在,需要新开一个长度为(n.length + 1)的数组,拷贝原来的数组。...
分类:
编程语言 时间:
2015-01-10 23:45:27
阅读次数:
363