Leetcode #78 Subse
This is a problem that finding all possible subsets (power set) from givien integer array. Input: nums = [1,2,3] Output: [[],[1],[2],[1,2],[3],[1,3],[2,3],[1,2,3]] Each element of the array can be add to subset or not which is 2 number of cases each. Therefore total number of cases that can be made with 3 elements of array is 8 (2^3). First level branches indicates that either adding 1 or not to..
Leetcode #153 Find Minimum in Rotated Sorted Array
This Problem we are trying to find mininum value from Rotated Sorted Array. For example, if there is an array [0, 1, 2, 3, 4, 5, 6, 7] that is already sorted it gets rotated by random number n. Case A If the array is [4, 5, 6, 7, 0, 1, 2, 3] it rotated 4 times. What we need are mid point, most left point, and most right point. 1. In this case mid point become 7 and we knows that the mid point is..