1.Two Sum
array null, length and bound checkuse hashmap to decrease time complexitytwo pointer to solve sorted array problemsconsider no result condition
4.Median of Two Sorted Arrays
abstract the problem to getKthMin problemconsider even and odd length of arrayconsider k VS length in getKthMin functioncompare k/2 - 1 position in both array to abort half of k elements in either arraylog(m+n) time complexity
11. Container With Most Water
two pointer to solve unsorted problemstwo pointer to find max problemmove pointer strategycontainer store min bound water
15. 3Sum
List<List<Integer>> resskip duplicate answers outside for loop and inside for loopreduce three sum to two sumArrays.asList(a,b,c) return List<Integer>O(n^2) time complexity
16. 3Sum Closest
use two pointer strategyupdate minDiff in each loop
18. 4Sum
use function to make code more readableskip duplicatecheck bound to skip or end loop
26. Remove Duplicates from Sorted Array
confirm the return typein place modification of arraymove pointer strategy
27. Remove Element
move pointer strategycheck bound
31. Next Permutation
find patter of permutationback traverse find peak, then find change location, swap change location and reverse the back partconsider special case