题目链接:https://leetcode-cn.com/problems/plus-one/ 给定一个由整数组成的非空数组所表示的非负整数,在该数的基础上加一。 最高位数字存放在数组的首位, 数组中每个元素只存储单个数字。 你可以假设除了整数 0 之外,这个整数不会以零开头。 示例 1: 输入: ...
分类:
其他好文 时间:
2019-09-27 01:14:54
阅读次数:
95
66. Plus One Easy Easy Easy Given a non-empty array of digits representing a non-negative integer, plus one to the integer. The digits are stored such ...
分类:
其他好文 时间:
2019-09-24 17:35:15
阅读次数:
82
传送门 https://leetcode.com/problems/plus-one/ 解题思路: 先将数组转换成对应的10进制数字,+1后,再将每位分拆成数组 ...
分类:
其他好文 时间:
2019-08-31 19:31:57
阅读次数:
69
POJ 3784 Running Median "POJ传送门" Description For this problem, you will write a program that reads in a sequence of 32 bit signed integers. After each ...
分类:
其他好文 时间:
2019-08-30 20:54:03
阅读次数:
68
description: 给 vector 表示的数字 +1 Note: Example: answer: relative point get√: hint : 从最后开始检查,是 9 就 变成 0, 再检查前面的一位,直到不是 9 了,就直接加一然后返回,如果最前需要加位就加。 ...
分类:
其他好文 时间:
2019-08-23 22:16:50
阅读次数:
112
题目: https://leetcode-cn.com/problems/plus-one/ 如果digits数组最后一位小于9,则只需要将digits数组最后一个数+1,返回digits数组即可;如果最后一位等于9,则需要设置一个循环进行加法模拟,即对每一位进行判断,小于10退出循环,如果等于10 ...
分类:
编程语言 时间:
2019-08-09 13:41:45
阅读次数:
77
66. Plus One 1. 题目 Given a non empty array of digits representing a non negative integer, plus one to the integer. The digits are stored such that the ...
分类:
其他好文 时间:
2019-08-02 09:13:09
阅读次数:
86
Algorithm 这周的算法题是plus one(https://leetcode.com/problems/plus-one/)。 Reading 这周读的文章是《Check Your Code First before Looking to Blame Others》 (https://97- ...
分类:
其他好文 时间:
2019-06-09 22:13:18
阅读次数:
92
Given a non-empty array of digits representing a non-negative integer, plus one to the integer. The digits are stored such that the most significant d ...
分类:
编程语言 时间:
2019-04-26 22:27:14
阅读次数:
174