摘要:
https://leetcode.com/problems/guess-number-higher-or-lower-ii/#/description
阅读全文
posted @ 2017-05-24 09:51
Sempron2800+
阅读(128)
推荐(0)
摘要:
https://leetcode.com/problems/maximum-xor-of-two-numbers-in-an-array/#/description
阅读全文
posted @ 2017-05-23 10:30
Sempron2800+
阅读(201)
推荐(0)
摘要:
https://leetcode.com/problems/kill-process/#/solutions tree中记录的是每个进程及其直接的子进程。然后在调用traverse方法,这个方法是递归的进行寻找,每个级别的进程及其子进程,将其全部加入到要删除的进程列表result中。
阅读全文
posted @ 2017-05-23 10:25
Sempron2800+
阅读(357)
推荐(0)
摘要:
https://leetcode.com/problems/fraction-addition-and-subtraction/#/description
阅读全文
posted @ 2017-05-23 09:44
Sempron2800+
阅读(205)
推荐(0)
摘要:
https://leetcode.com/problems/longest-harmonious-subsequence/#/description
阅读全文
posted @ 2017-05-22 17:32
Sempron2800+
阅读(149)
推荐(0)
摘要:
https://leetcode.com/problems/subarray-sum-equals-k/#/solutions 补充一个python的实现,和上面的思路一样: 下面进行解释,字典dic中存储的是某一个连续和的出现频率。例如nums=[1,1,1],k=2。 第一次循环时,sums等于
阅读全文
posted @ 2017-05-22 16:44
Sempron2800+
阅读(236)
推荐(0)
摘要:
public class Solution { public int FindUnsortedSubarray(int[] nums) { int n = nums.Length, beg = -1, end = -2, min = nums[n - 1], max = nums[0]; for (
阅读全文
posted @ 2017-05-22 16:06
Sempron2800+
阅读(156)
推荐(0)
摘要:
https://leetcode.com/problems/generate-parentheses/#/description 重新实现了一遍,也是使用回溯法。先使用python来做,本地测试正常,但是在leetcode上提交却WA,于是把python代码改写为C#,则AC了。 因此判断是OJ对p
阅读全文
posted @ 2017-05-14 09:42
Sempron2800+
阅读(187)
推荐(0)
摘要:
https://leetcode.com/problems/combination-sum-iii/#/description
阅读全文
posted @ 2017-05-14 09:36
Sempron2800+
阅读(92)
推荐(0)
摘要:
https://leetcode.com/problems/target-sum/#/description 补充一个python的实现: 这道题的主要思想是利用字典存储之前的已经计算过的值,但是做题的时候状态不太好,所以写了很久。 做算法题,头脑不清醒的时候,效率很低,应该休息,把状态调整好再做。
阅读全文
posted @ 2017-05-13 18:55
Sempron2800+
阅读(186)
推荐(0)