66 Plus One链接:https://leetcode.com/problems/plus-one/
问题描述:
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...
分类:
其他好文 时间:
2015-07-01 14:17:54
阅读次数:
135
解决这个问题的很长时间用在了理解题意的阶段,本题的题意就是用一个数组表示一个很大的数,比如对于98,9存储于array[0],8存储于array[1]。然后对这个数加1,返回表示新数的一个数组。class Solution {
public:
vector plusOne(vector& digits) {
int length = digits.size...
分类:
其他好文 时间:
2015-06-27 09:54:45
阅读次数:
136
1. Question给定一个非负数,用数组存储其各数位,对这个数加一,返回结果。数组中,最高位在数组头。Given a non-negative number represented as an array of digits, plus one to the number.The digits ...
分类:
其他好文 时间:
2015-06-24 22:21:56
阅读次数:
155
#58 Length of Last Word
Given a string s consists of upper/lower-case alphabets and empty space characters '
', return the length of last word in the string.
If the last word does not exist,...
分类:
其他好文 时间:
2015-06-24 16:22:21
阅读次数:
141
题目描述: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 ...
分类:
其他好文 时间:
2015-06-23 11:35:40
阅读次数:
105
题目意思:vector v存数 eg.123 则v[0]=1,v[1]=2,v[2]=3,加1后返回一个vector思路:先判断新的vector长度是否需要加1,然后从vector最后一位开始往前进位 1 class Solution { 2 public: 3 vector plusOn...
分类:
其他好文 时间:
2015-06-23 11:32:29
阅读次数:
173
题目链接 题目要求: Given a non-negative number represented as an array of digits, plus one to the number. The digits are stored such that the most signif...
分类:
编程语言 时间:
2015-06-20 11:45:49
阅读次数:
139
题目: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-06-17 23:23:03
阅读次数:
277
Description: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...
分类:
其他好文 时间:
2015-06-17 00:26:35
阅读次数:
166
Plus OneGiven a non-negative number represented as an array of digits, plus one to the number.The digits are stored such that the most significant dig...
分类:
编程语言 时间:
2015-06-14 06:58:52
阅读次数:
166