11 2018 档案
摘要:1 class Solution { 2 List res = new ArrayList(); 3 public List addOperators(String num, int target) { 4 if(num.length() == 0) return res; 5 backtrack(num, target, "", 0, ...
阅读全文
posted @ 2018-11-27 02:21
jasoncool1
摘要:每次remove一个( 或者 ) 看看整体valid吗 valid的话这个就是最小的remove数量
阅读全文
posted @ 2018-11-07 00:42
jasoncool1
摘要:map记录位置remove时候把最后一位跟要remove的交换 然后去掉最后一位 这样可以达到O(1)
阅读全文
posted @ 2018-11-03 09:26
jasoncool1
摘要: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
摘要: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
摘要: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
摘要: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

浙公网安备 33010602011771号