摘要: 1 public class Solution extends VersionControl { 2 public int firstBadVersion(int n) { 3 if(n == 1) return 1; 4 int lo = 1, hi = n; 5 while(lo < hi){ 6 i... 阅读全文
posted @ 2018-10-23 22:15 jasoncool1 阅读(78) 评论(0) 推荐(0) 编辑
摘要: https://leetcode.com/problems/valid-number/discuss/23738/Clear-Java-solution-with-ifs 阅读全文
posted @ 2018-10-23 11:31 jasoncool1 阅读(158) 评论(0) 推荐(0) 编辑
摘要: 1 //New presum 2 class Solution { 3 public boolean checkSubarraySum(int[] nums, int k) { 4 if(k == 0){ 5 for(int i = 1; i list = new ArrayList(); 31 for(int i = ... 阅读全文
posted @ 2018-10-23 05:27 jasoncool1 阅读(132) 评论(0) 推荐(0) 编辑
摘要: 1 public class BSTIterator { 2 Queue queue; 3 public void build(TreeNode root){ 4 if(root == null) return; 5 build(root.left); 6 queue.offer(root.val); 7 ... 阅读全文
posted @ 2018-10-23 01:28 jasoncool1 阅读(81) 评论(0) 推荐(0) 编辑
摘要: https://leetcode.com/problems/maximum-sum-of-3-non-overlapping-subarrays/discuss/108231/C++Java-DP-with-explanation-O(n) 阅读全文
posted @ 2018-10-23 01:08 jasoncool1 阅读(157) 评论(0) 推荐(0) 编辑