-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathproblems
178 lines (132 loc) · 4.17 KB
/
problems
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
01.11
codewars
- isPrime update kata
general
- Find Two Numbers that Add up to "value"
- House robber DP: comment1, comment2, comment 3
- Teemo Attacking
regex
- validate an IP
- validate an email
strings
- Min insertion to form palindrome strings
-length of last word
subsequence
- find all subsequnces https://www.geeksforgeeks.org/print-subsequences-string/
- 392 Is Subsequence
- 673 number of longest increasing subsequence
- 300 longest increas subseq
- 674 Longest Continuous Increasing Subsequence
- 78 subsets https://leetcode.com/problems/subsets/
Arrays
- 2 sum, 3sum
- Write a function which merges two sorted arrays of integers and prints result;
- Shuffle an array
- 1524
linked list
- sort linked list
-Reverse Linked List
- reorder linked list
- Find a middle of linked list
- Flatten multilevel doubly linked list
queue
- Circular queue https://www.youtube.com/watch?v=ihEmEcO2Hx8
hash
- implement hashtable: educative
BT
1022
-sum of leaves
BST
- Remove a node in BST
- How will you find kth smallest element of a Binary Search Tree
- recover BST
Backtracking
- Combination sum ii
- 1589
DP
https://leetcode.com/discuss/general-discussion/849681/how-to-approach-dp-problems
- Buy and sell stock 121, II
Longest common substring
- coin change, coin change 2, max contiguous subarray
Coins: amount, represent combinations
Travel passes: all calendar days
10.08
- with premium leetcode account to check locked problems (for example
grab from August challenge)
29.06
Book Grocking Algorithms
page 41
...
Algo week 4
...
serialize and deserialize a binary tree
https://www.youtube.com/watch?v=suj1ro8TIVY
787 task
bfs
dfs
directed graph
level by level bfs search!
bfs and dfs and find a problems (check invert binary tree task)
TUSHAR ROY GRAPH PROBLEMS
https://leetcode.com/problems/cheapest-flights-within-k-stops/discuss/686774/SUGGESTION-FOR-BEGINNERS-SIMPLE-STEPS-BFS-or-DIJKSHTRA-or-DP-DIAGRAM
Dijkstra shortest path in graph
Heap
idea using BFS
https://leetcode.com/problems/cheapest-flights-within-k-stops/discuss/181943/Readable-Javascript-Solution
368
Largest divisible subset
https://leetcode.com/problems/largest-divisible-subset/discuss/83999/Easy-understood-Java-DP-solution-in-28ms-with-O(n2)-time
528
recursion approach
update readme
check anki card
237 provide pictures
write a linked list ds and provide usual way of deleting with delete a node
provide test
226 invert
second approach: iterative
breadth first search definition queue
depth first search - stack
1 two sum
one pass hash table
2 pass hash table
2-pass approach can only implement with map?
update a readme and Hash component
google youtube
solution with map
check solution it's an open
put solution to leetcode
2 sum input arr sorted: move to separate task, create a test
binary search
2 pointers
test on leetcode
follow up design two sum data structure
380
check desc again, more clear why it's O(1)
provide all tests
check swap https://leetcode.com/problems/insert-delete-getrandom-o1/discuss/683882/Heavily-commented-JavaScript-Solution-with-thought-process-explained
https://leetcode.com/problems/insert-delete-getrandom-o1/discuss/684251/JavaScript-Clean-Solution-Using-Map-and-Array
and left a comment = override simply works
use arr and hash https://leetcode.com/problems/insert-delete-getrandom-o1/discuss/436771/JavaScript-Array-of-values-and-Map-of-values-and-locations-in-array
check 2 hashes solution
move to anky
381 follow up
75
use counting sort to check
create a doc and share with vasyl
about positions: check book frontend interviews
medium
algorithmes and coding interviews: do i need subscribe
https://medium.com/algorithms-and-leetcode
check couple of articles
quick find
create anki: describe api, complexity
add to readme
//
quick union: check implementation
add a readme
an implementation of WeightedUnionFind: I think it's an error on medium with this.find
what is compression about?
check Here is a full js implementation, taken partly from Michael Toth’s JS visualisation of percolation through union find. I added compression, which Michael did not implement. I also changed the naming so it’s easier to read.
// ds definitions
https://github.com/liyin2015/Algorithms-and-Coding-Interviews/