摘要:
https://leetcode.com/problems/arithmetic-slices/#/description 补充一个java的实现: 解释: dp[i] 表示以 A[i] 为结尾的等差递增子区间的个数。 因为递增子区间不一定以最后一个元素为结尾,可以是任意一个元素结尾,因此需要返回
阅读全文
posted @ 2017-04-29 23:57
Sempron2800+
阅读(112)
推荐(0)
摘要:
https://leetcode.com/problems/find-bottom-left-tree-value/#/description
阅读全文
posted @ 2017-04-29 23:42
Sempron2800+
阅读(105)
推荐(0)
摘要:
https://leetcode.com/problems/counting-bits/#/description 另一个版本,246ms: 补充一个使用动态规划思想的代码,使用python实现:
阅读全文
posted @ 2017-04-29 22:58
Sempron2800+
阅读(138)
推荐(0)
摘要:
https://leetcode.com/problems/battleships-in-a-board/#/description
阅读全文
posted @ 2017-04-28 23:14
Sempron2800+
阅读(87)
推荐(0)
摘要:
https://leetcode.com/problems/complex-number-multiplication/#/description
阅读全文
posted @ 2017-04-28 14:48
Sempron2800+
阅读(105)
推荐(0)
摘要:
https://leetcode.com/problems/encode-and-decode-tinyurl/#/description
阅读全文
posted @ 2017-04-28 14:24
Sempron2800+
阅读(135)
推荐(0)
摘要:
public class Solution { public void reverse(int[] nums, int start, int end) { while (start < end) { int temp = nums[start]; nums[start] = nums[end]; n
阅读全文
posted @ 2017-04-26 21:45
Sempron2800+
阅读(136)
推荐(0)
摘要:
/* The isBadVersion API is defined in the parent class VersionControl. bool IsBadVersion(int version); */ public class Solution : VersionControl { pub
阅读全文
posted @ 2017-04-26 20:39
Sempron2800+
阅读(91)
推荐(0)
摘要:
public class Solution { private string Convert(int k) { var s = ""; switch (k) { case 1: s = "A"; break; case 2: s = "B"; break; case 3: s = "C"; brea
阅读全文
posted @ 2017-04-26 19:51
Sempron2800+
阅读(111)
推荐(0)
摘要:
public class Solution { Stack<char> S = new Stack<char>(); Queue<char> Q = new Queue<char>(); public bool IsPalindrome(string s) { if (s.Length == 0)
阅读全文
posted @ 2017-04-26 19:16
Sempron2800+
阅读(134)
推荐(0)