66. Plus One
摘要:description: 给 vector 表示的数字 +1 Note: Example: answer: relative point get√: hint : 从最后开始检查,是 9 就 变成 0, 再检查前面的一位,直到不是 9 了,就直接加一然后返回,如果最前需要加位就加。
阅读全文
65. Valid Number
摘要:description: 看给定的数字是否是合法数字 Note: Example: answer: class Solution { public: bool isNumber(string s) { int len = s.size(); int left = 0, right = len 1;
阅读全文
64. Minimum Path Sum 动态规划
摘要:description: Given a m x n grid filled with non negative numbers, find a path from top left to bottom right which minimizes the sum of all numbers alo
阅读全文
63. Unique Paths II 动态规划
摘要:description: https://leetcode.com/problems/unique paths/ 机器人从一堆方格的左上角走到右下角,只能往右或者往下走 ,问有几种走法,这个加了难度,在矩阵中加了障碍物 Note: Example: answer: class Solution {
阅读全文
62. Unique Paths
摘要:description: https://leetcode.com/problems/unique paths/ 机器人从一堆方格的左上角走到右下角,只能往右或者往下走 ,问有几种走法 Note: Example: answer: class Solution { public: int uniqu
阅读全文
61. Rotate List
摘要:description: Given a linked list, rotate the list to the right by k places, where k is non negative. Note: Example: answer: relative point get√: hint
阅读全文
60. Permutation Sequence
摘要:description: 找到全排列中的第k个序列 The set [1,2,3,...,n] contains a total of n! unique permutations. By listing and labeling all of the permutations in order,
阅读全文
59. Spiral Matrix II ***
摘要:description: 螺旋型填充矩阵 Note: Example: answer: relative point get√: hint :
阅读全文
58. Length of Last Word
摘要:description: 找到一句话中最后一个单词的长度 Note: Example: answer: relative point get√: hint : 先把句子开头和结尾的空格去了
阅读全文
57. Insert Interval
摘要:description: 插入新的区间,涉及到区间的合并. Note: Example: answer: class Solution { public: vector insert(vector & intervals, vector& newInterval) { int n = interva
阅读全文