Skip to content

Commit 949cb71

Browse files
committed
Added hints
1 parent f7eaae9 commit 949cb71

File tree

2 files changed

+28
-0
lines changed

2 files changed

+28
-0
lines changed

README.md

+8
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,14 @@ Solutions <a href = "https://github.com/aliasvishnu/leetcode/tree/master/Solutio
5353
| 69 | Binary Search | start = 0, end = x/2, binary search | O(log(n)) |
5454
| 70 | DP | DP[i] = DP[i-1] + DP[i-2] | O(n)|
5555
| 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) |
5664
| 108 | Inorder traversal | Where does the root element fall during an inorder (sorted) traversal? | |
5765
| 128 | DP | DP problem, find recurrence relation. | |
5866

Solutions/78-Subsets.cpp

+20
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,23 @@ class Solution {
2424
return ans;
2525
}
2626
};
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+
//

0 commit comments

Comments
 (0)