摘要:
My back tracking solution: class Solution { List<String> res = new ArrayList<>(); public List<String> generateParenthesis(int n) { backTracking(n, 0 , 阅读全文
摘要:
Stack solution: class Solution { public int scoreOfParentheses(String s) { Stack<Integer> st = new Stack<>(); int score = 0; for(int i = 0; i < s.leng 阅读全文
摘要:
My first solution, time complexityO(m*n), where m is the cell number of mat1, and n is the cell number of mat2: class Solution { public int[][] multip 阅读全文
摘要:
My first binary search solution: class Solution { public int findKthPositive(int[] arr, int k) { int l=0, r = arr.length-1; while(l+1<r){ int mid = (l 阅读全文