"https://leetcode.com/problems/move zeroes/" 给定一个数组,将其所有为0的元素移到数组后面去,同时保持非零元素的相对位置不变 要求:不能新建一个数组空间;使得操作尽可能少 分析: 方法一:快慢指针 快指针在前面判断该数是否是0,慢指针在后面定位快指针找到的 ...
分类:
其他好文 时间:
2020-04-05 23:59:57
阅读次数:
109
链接:https://leetcode cn.com/problems/binary tree level order traversal/ ...
分类:
其他好文 时间:
2020-04-05 22:26:38
阅读次数:
69
链接:https://leetcode cn.com/problems/symmetric tree/ ...
分类:
其他好文 时间:
2020-04-05 22:06:03
阅读次数:
47
给定一个整数 n ,你需要找到与它最近的回文数(不包括自身)。 “最近的”定义为两个整数差的绝对值最小。 示例 1: 输入: "123" 输出: "121" 注意: n 是由字符串表示的正整数,其长度不超过18。 如果有多个结果,返回最小的那个。 来源:力扣(LeetCode) 链接:https:/ ...
分类:
其他好文 时间:
2020-04-05 17:02:55
阅读次数:
113
此博客链接:https://www.cnblogs.com/ping2yingshi/p/12637178.html 买卖股票的最佳时机(13min) 题目链接:https://leetcode-cn.com/problems/best-time-to-buy-and-sell-stock/ 给定一 ...
分类:
其他好文 时间:
2020-04-05 15:44:51
阅读次数:
72
package LeetCode_1137 /** * 1137. N-th Tribonacci Number * https://leetcode.com/problems/n-th-tribonacci-number/description/ * * The Tribonacci sequen ...
分类:
其他好文 时间:
2020-04-05 09:52:07
阅读次数:
53
package LeetCode_746 /** * 746. Min Cost Climbing Stairs * https://leetcode.com/problems/min-cost-climbing-stairs/description/ * On a staircase, the i ...
分类:
其他好文 时间:
2020-04-05 09:48:47
阅读次数:
78
1 class Solution: 2 def checkOverlap(self, radius: int, x_center: int, y_center: int, x1: int, y1: int, x2: int, y2: int) -> bool: 3 4 # Getting the c ...
分类:
其他好文 时间:
2020-04-05 09:35:21
阅读次数:
57
package LeetCode_70 /** * 70. Climbing Stairs * https://leetcode.com/problems/climbing-stairs/description/ * */ class Solution { fun climbStairs(n: In ...
分类:
其他好文 时间:
2020-04-05 09:15:50
阅读次数:
67
题目:https://leetcode cn.com/problems/trapping rain water/ ...
分类:
其他好文 时间:
2020-04-04 21:11:27
阅读次数:
90