摘要:
There is an array filled with strings, each string is composed with '0' and '1'. Given m '0' and n '1', return maximum number of strings can we compos 阅读全文
摘要:
18. 4Sum I (32lines) Given a integer array and target, find all unique quadruplets sum is target. Solution(O(N^3)): Similar as 3sum problem, add one m 阅读全文
摘要:
1. Think carefully about the variables used for different range, they may represent same value in the meaning, but they are used in different range, s 阅读全文
摘要:
3Sum Given a integer array, find all the unique 3-number pairs which sum = 0. Solution O(N^2): 1. Sort the array, and makes this problem to a equal '2 阅读全文
摘要:
There is an array with integers, if there is sum of two numbers equals target, return true; if there is not, return false. Solution: Input array is so 阅读全文
摘要:
1. Integer.MAX_VALUE, Integer.MIN_VALUE 2. int[] res = {1,2} can only be used in the initialization, assignment can only use the res[0] = 1 阅读全文
摘要:
456. 132 Pattern Given an array of integers a1, a2, a3…an, judge if there exists the 132 pattern. 132 pattern is ai < ak < aj, in which i < j < k. Sol 阅读全文