File tree 2 files changed +28
-0
lines changed
2 files changed +28
-0
lines changed Original file line number Diff line number Diff line change @@ -53,6 +53,14 @@ Solutions <a href = "https://github.com/aliasvishnu/leetcode/tree/master/Solutio
53
53
| 69 | Binary Search | start = 0, end = x/2, binary search | O(log(n)) |
54
54
| 70 | DP | DP[ i] = DP[ i-1] + DP[ i-2] | O(n)|
55
55
| 71 | BF | Split by '/', use stack to handle '..' | O(n) |
56
+ | 75 | 2 pointer | Start & end indices. See if you can swap em into place. | O(n) |
57
+ | 76 | Array | Extend and contract window. | O(n) |
58
+ | 77 | Backtrack | Backtracking | O(nCk) |
59
+ | 78 | Backtrack | Backtracking Or generate all numbers between 0 & 2^n and use bit properties. | O(2^n) |
60
+ | 79 | DFS | DFS if letter match | O(nm * len(str)) |
61
+ | 80 | BF | Implementation based, maintain count. | O(n) |
62
+ | 81 | Binary Search, similar to Problem 33. | O(log(n)) |
63
+ | 88 | Array | Merging logic from merge sort | O(n+m) |
56
64
| 108 | Inorder traversal | Where does the root element fall during an inorder (sorted) traversal? | |
57
65
| 128 | DP | DP problem, find recurrence relation. | |
58
66
Original file line number Diff line number Diff line change @@ -24,3 +24,23 @@ class Solution {
24
24
return ans;
25
25
}
26
26
};
27
+
28
+ // PYTHON SOLUTION
29
+ // class Solution(object):
30
+ // def subsets(self, nums):
31
+ // """
32
+ // :type nums: List[int]
33
+ // :rtype: List[List[int]]
34
+ // """
35
+ // if (len(nums) == 0):
36
+ // return [[]]
37
+ // else:
38
+ // ans = self.subsets(nums[1:])
39
+ // temp = []
40
+ // for item in ans:
41
+ // temp.append(item + [nums[0]])
42
+ //
43
+ // for item in temp:
44
+ // ans.append(item)
45
+ // return ans
46
+ //
You can’t perform that action at this time.
0 commit comments