-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy path_notes.yaml
More file actions
230 lines (180 loc) · 5.87 KB
/
_notes.yaml
File metadata and controls
230 lines (180 loc) · 5.87 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
Review:
_leet:
medium1:
clone-graph.py
decode-ways.py
find-peak-element.py - eff *
longestIncreasingSubsequence.py *
maximum-product-subarray.py(eff) *
minimum-time-difference.py
perfect_square_sums.py TODO
permutations-of-string-list-backtrack.py
string_compression.py **
task-scheduler.py TODO
medium2:
jump-game.py
k-closest-points-to-origin.py TODO
least-number-of-unique-integers-after-k-removals.py *
matrix-block-sum.py TODO
minimum-path-sum-triangle.py
next-permutation.py
number-of-connected-components-in-an-undirected-graph.py
remove-duplicate-letters.py
shortest-bridge-dfs-bfs.py **
shortest-unsorted-continuous-subarray.py
spiral-matrix-ii.py
valid-sudoku.py
medium3:
angle-between-hands-of-a-clock.py
climbing-stairs.py
combinations-of-phone-num_backtrack.py
count-binary-substrings.py *
longest-substring-k-distinct-char.py **
min-num-frogs-croaking.py *
restore-ip-addresses_backtrack.py ** TODO
simplify-path.py
valid-parenthesis-string.py **
medium4-easy:
add-binary.py
add-strings.py
find-common-characters.py
pascals-triangle.py
medium5-easy:
happy-number.py
subdomain-visit-count.py
two-sum.py
verifying-an-alien-dictionary.py TODO
medium6:
3Sum.py
merge-sorted-array.py
minimum-cost-to-hire-work.py TODO
minimum-window-substring.py **
split-array-k-sub-array-max-sum.py **
word-square.py **
design:
binary-search-tree-iterator.py
design-file-system.py
hit-counter.py
log-storage-system.py
shortest-word-distance.py
twitter.py
words-data-structure.py
zigzag-iterator.py
2-dim:
https://www.geeksforgeeks.org/print-all-possible-paths-from-top-left-to-bottom-right-of-a-mxn-matrix/
find-islands-maxarea.py
flood-fill-algorithm.py
possible-paths-top-left-bottom-right-nxm-matrix.py
leet:
maximal_square.py
n-queens.py TODO
number-of-provinces.py
RemoveStones.py
snakes-and-ladders.py TODO
word-search-board.py
Array:
2-count-duplets-key-pair-difference.py
2-pythagorean-triplet-in-an-unsorted-array.py
4-max-sum-cont-subarray-kadane - greedy
4-max-sum-without-adjacents.py ** TODO
4-subarray-sums-divisible-by-k - eff *
4-subarray-with-given-sum
find-minimum-difference-pair.py
minimum-meeting_rooms
rearrange-array-into-zig-zag-fashion.py
reorganize-string-alternatively **
https://leetcode.com/problems/trapping-rain-water-ii/ TODO
String:
1-longest-substring-count-without-repeating-char.py *
2-longestpalindrome.py *
2-palindrome-partitioning.py **
2-palindrome-substring.py *
colNameForNumberExcel.py
implement-strstr.py **
permutations-of-a-given-string-backtracking.py
remove-minimum-number-characters-two-strings-become-anagram-2.py
word-break.py
Tree:
bst-validate.py
BT-diameter.py
BT-duplicate-subtrees.py
BT-Lowest_common_ancestor.py
BT-MinDepth.py **
BT-Path-root-to-leaf-Sum.py
BT-Path-root-to-leaf.py
connect-nodes-at-same-level.py TODO
invert-binary-tree.py
merge-two-bt-sum.py
tree-traversal-build-preorder.py TODO
LinkedList:
2-DoubleLinkedList.py
addTwoNumbers-linkedlist.py
partition-linked-list.py *
remove-linked-list-elements.py *
reorder-list-alternatively.py *
sort-linked-list.py **
DataStructures:
min-heap.py
max-stack.py
Concepts:
Balance string:
stack, index to remove, left+-, right+-, balance+-
Backtrack:
_leet:
medium1/balanced_paranthesis_generate_backtrack.py <for i in range(start, len(input))>
medium1/permutations-of-string-list-backtrack.py
medium3/combinations-of-phone-num_backtrack.py
medium3/restore-ip-addresses_backtrack.py *
_leet/medium6/coin_change.py
DFS:
_leet:
medium1/course-schedule.py *
medium2/shortest-bridge-dfs-bfs.py *
Dynamic:
_leet:
medium1/decode-ways.py
medium1/longestIncreasingSubsequence.py
medium3/climbing-stairs-min-cost.py
medium3/climbing-stairs.py
string:
map and filter _leet/array/valid-palindrome.py
FileSystem:
_leet/design/design-file-system.py
_leet/design/words-data-structure.py
2-Dim/leet/word-search-board.py
lambda sort:
_leet/medium1/top-k-frequent-elements.py
_leet/medium1/mergeIntervals.py
_leet/medium3/reorder-data-in-log-files.py
_leet/medium1/minimum-time-difference.py
Array/arrange-largest-number.py
minimum window:
_leet/medium6/minimum-window-substring.py
Tricks:
Array:
l=0,r=1
l=0,r=n-1
seen={} - to check if we already computed this value
enumerate - to keep track of index of array and its value
Counter() - gives dict of element as key, and how many times it repeated as value
for i in range(n-1,2,-1) - reverese order from n-1th element to 2nd element
helper function for sort - arrange-largest-number
String:
sliding window String/0.1-longest-substring-without-repeating-characters.py
dictionary:
set default value: 2-Dim/leet/word-search-board.py
trie = {}
sort:
bisect, bisect.insort,
i = bisect.bisect_left(<list>, 3) returns index wher 3 can be inserted
_leet/design/Leaderboard.py
heapq.heappush (useful when we have tuples to sort) - example _leet/design/twitter.py
for loops:
_leet/medium4-easy/find-common-characters.py
TODO:
python
Reviewd:
_leet
2_dim
Tree
linkedlist