上一页 1 2 3 4 5 6 ··· 22 下一页
摘要: 1 class Solution { 2 public boolean isMonotonic(int[] A) { 3 if(A.length == 0) return false; 4 if(A.length == 1 || A.length == 2) return true; 5 int j = 0, flag = 0; ... 阅读全文
posted @ 2018-11-02 06:28 jasoncool1 阅读(138) 评论(0) 推荐(0) 编辑
摘要: 1 class Solution { 2 public int[] findDiagonalOrder(int[][] matrix) { 3 if(matrix.length == 0) return new int[0]; 4 int row = matrix.length; 5 int col = matrix[0].len... 阅读全文
posted @ 2018-11-01 06:34 jasoncool1 阅读(140) 评论(0) 推荐(0) 编辑
摘要: 1 class Solution { 2 public int minSubArrayLen(int s, int[] nums) { 3 if(nums.length == 0) return 0; 4 int count = 0; 5 int i = 0, j = 0; 6 int min = Integer... 阅读全文
posted @ 2018-11-01 05:38 jasoncool1 阅读(131) 评论(0) 推荐(0) 编辑
摘要: 1 class NumArray { 2 int[] preSum; 3 int[] arr; 4 public NumArray(int[] nums) { 5 arr = nums; 6 preSum = new int[nums.length+1]; 7 preSum[0] = 0; 8 ... 阅读全文
posted @ 2018-11-01 05:06 jasoncool1 阅读(124) 评论(0) 推荐(0) 编辑
摘要: 1 class Solution { 2 public String reorganizeString(String S) { 3 if(S.length() == 0) return ""; 4 int[] arr = new int[26]; 5 int max = 0; 6 for(int i = 0; i... 阅读全文
posted @ 2018-10-31 12:52 jasoncool1 阅读(181) 评论(0) 推荐(0) 编辑
摘要: https://leetcode.com/problems/flatten-nested-list-iterator/discuss/80147/Simple-Java-solution-using-a-stack-with-explanation 阅读全文
posted @ 2018-10-31 12:13 jasoncool1 阅读(137) 评论(0) 推荐(0) 编辑
摘要: https://leetcode.com/problems/longest-substring-with-at-least-k-repeating-characters/discuss/87739/Java-Strict-O(N)-Two-Pointer-Solution window分别为1-26 阅读全文
posted @ 2018-10-31 11:32 jasoncool1 阅读(125) 评论(0) 推荐(0) 编辑
摘要: 每个节点都要找有多少个 dfs对每个点找 阅读全文
posted @ 2018-10-31 09:59 jasoncool1 阅读(106) 评论(0) 推荐(0) 编辑
摘要: 1 //dfs 2 class Solution { 3 public boolean checkValidString(String s) { 4 if(s.length() == 0) return true; 5 return dfs(s, 0, 0); 6 7 } 8 9 public ... 阅读全文
posted @ 2018-10-31 04:15 jasoncool1 阅读(125) 评论(0) 推荐(0) 编辑
摘要: mergeSort 阅读全文
posted @ 2018-10-30 11:20 jasoncool1 阅读(109) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 ··· 22 下一页