-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathQuestions.txt
More file actions
239 lines (209 loc) · 12 KB
/
Copy pathQuestions.txt
File metadata and controls
239 lines (209 loc) · 12 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
230
231
232
233
234
235
Searching
Searching 1(08.03.2024)
https://leetcode.com/problems/search-in-rotated-sorted-array/description/
https://leetcode.com/problems/find-minimum-in-rotated-sorted-array/description/
https://atcoder.jp/contests/abc231/tasks/abc231_c
https://leetcode.com/problems/find-first-and-last-position-of-element-in-sorted-array/
https://leetcode.com/problems/search-in-rotated-sorted-array-ii/description/
https://www.geeksforgeeks.org/find-rotation-count-rotated-sorted-array/
Searching 2(09.03.2024)
https://leetcode.com/problems/single-element-in-a-sorted-array/description/
https://leetcode.com/problems/find-peak-element/description/
https://leetcode.com/problems/sqrtx/description/
https://www.geeksforgeeks.org/problems/find-nth-root-of-m5843/1
https://www.spoj.com/problems/AGGRCOW/ or https://www.geeksforgeeks.org/problems/aggressive-cows/1
https://leetcode.com/problems/get-equal-substrings-within-budget/description/
Searching 3(10.03.2024)
You have given an array A having N elements and an integer S. You have to find a maximum number X such that the sum of all its subarrays of size X is less than or equal to S.
Example Input:
A = [1, 3, 4, 2]
S = 7
Example Output:
2
Explanation:
All subarrays of size 2 have the sum less than 7.
Subarays are :
1. [1, 3]
2. [3, 4]
3. [4, 2]
https://leetcode.com/problems/minimum-number-of-days-to-make-m-bouquets/description/
https://www.codingninjas.com/studio/problems/painter-s-partition-problem_1089557
https://leetcode.com/problems/minimum-limit-of-balls-in-a-bag/description/
I will cover the below question in a separate class. Don’t worry, but you can try.
Deepthi loves cruises. She is going to visit the Caribbean on a Cruise. So, she thought of providing everyone who is traveling with her with lunch as well. Each food item is denoted by an integer ID. A lunch box contains exactly A food items. She has a list of food items with her denoted by an integer array B. She asked you to tell her the maximum number of lunchboxes she can prepare.
Note:
A lunch box can contain multiple same kinds of food items but the content of each lunch box should be the same.
Example Input
Input 1:
A = 3, B = [1, 2, 3, 2, 6, 1, 3]
Input 2:
A = 4, B = [1, 3, 1, 3, 10, 3, 6, 6, 13]
Example Output
Output 1:
2
Output 2:
1
Example Explanation
Explanation 1:
She can choose the content to be [1, 2, 3] and prepare 2 lunchboxes
Explanation 2:
She can choose the content to be [1, 3, 3, 3]
Searching 5(16.03.2024)
https://leetcode.com/problems/median-of-two-sorted-arrays/description/
https://www.interviewbit.com/problems/matrix-median/
https://www.geeksforgeeks.org/find-the-nth-term-divisible-by-a-or-b-or-c/
https://www.codingninjas.com/studio/problems/k-th-element-of-2-sorted-array_1164159
https://www.geeksforgeeks.org/problems/kth-element-in-matrix/1
https://atcoder.jp/contests/abc172/tasks/abc172_c
https://leetcode.com/problems/search-a-2d-matrix/description/
Trees
Trees 1 & 2(23.03.2024)
https://leetcode.com/problems/maximum-depth-of-binary-tree/description/
https://leetcode.com/problems/vertical-order-traversal-of-a-binary-tree/description/
https://leetcode.com/problems/binary-tree-level-order-traversal/description/
https://leetcode.com/problems/serialize-and-deserialize-binary-tree/description/
https://www.geeksforgeeks.org/problems/odd-even-level-difference/1
https://leetcode.com/problems/same-tree/description/
https://www.codingninjas.com/studio/problems/tree-height_4609628
https://www.geeksforgeeks.org/problems/top-view-of-binary-tree/1
https://leetcode.com/problems/find-bottom-left-tree-value/description/
https://www.geeksforgeeks.org/bottom-view-binary-tree/
Trees 3(24.03.2024)
https://www.codingninjas.com/studio/problems/left-view-of-binary-tree_625707
https://leetcode.com/problems/binary-tree-right-side-view/
https://leetcode.com/problems/binary-tree-paths/description/
https://www.interviewbit.com/problems/path-to-given-node/
https://leetcode.com/problems/step-by-step-directions-from-a-binary-tree-node-to-another/description/
https://www.geeksforgeeks.org/problems/min-distance-between-two-given-nodes-of-a-binary-tree/1
https://leetcode.com/problems/lowest-common-ancestor-of-a-binary-tree/description/
https://leetcode.com/problems/invert-binary-tree/
https://leetcode.com/problems/diameter-of-binary-tree/
https://leetcode.com/problems/path-sum/description/
https://leetcode.com/problems/path-sum-ii/
https://leetcode.com/problems/path-sum-iii/
Trees 4&5(31.03.2024)
https://leetcode.com/problems/validate-binary-search-tree/description/
https://www.geeksforgeeks.org/problems/implementing-ceil-in-bst/1
https://leetcode.com/problems/convert-sorted-array-to-binary-search-tree/description/
https://www.geeksforgeeks.org/problems/largest-bst/1
https://leetcode.com/problems/maximum-sum-bst-in-binary-tree/description/
https://www.geeksforgeeks.org/problems/print-common-nodes-in-bst/1
https://leetcode.com/problems/range-sum-of-bst/description/
https://www.geeksforgeeks.org/check-if-each-internal-node-of-a-bst-has-exactly-one-child/
https://www.naukri.com/code360/problems/boundary-traversal-of-binary-tree_790725
Trees 6(31.03.2024)
https://leetcode.com/problems/recover-binary-search-tree/description/ -
https://leetcode.com/problems/two-sum-iv-input-is-a-bst/description/
https://leetcode.com/problems/kth-smallest-element-in-a-bst/description/ -
https://www.geeksforgeeks.org/problems/binary-tree-to-cdll/1
https://leetcode.com/problems/lowest-common-ancestor-of-a-binary-search-tree/description/ -
https://leetcode.com/problems/convert-sorted-list-to-binary-search-tree/description/
https://leetcode.com/problems/construct-binary-search-tree-from-preorder-traversal/description/ -
https://www.geeksforgeeks.org/problems/merge-two-bst-s/1 -
Tries
Tries 1(06.04.2024)
https://leetcode.com/problems/implement-trie-prefix-tree/description/
https://leetcode.com/problems/sum-of-prefix-scores-of-strings/description/
https://leetcode.com/problems/count-pairs-with-xor-in-a-range/description/
https://leetcode.com/problems/maximum-xor-of-two-numbers-in-an-array/description/
https://leetcode.com/problems/replace-words/description/
https://leetcode.com/problems/longest-common-suffix-queries/description/
https://www.hackerearth.com/problem/algorithm/subarrays-xor/ (Tricky, give sufficient time)
https://www.geeksforgeeks.org/auto-complete-feature-using-trie/
Tries 2(12.04.2024)
https://leetcode.com/problems/count-triplets-that-can-form-two-arrays-of-equal-xor/description/
https://www.geeksforgeeks.org/problems/search-query-auto-complete/1
https://www.geeksforgeeks.org/problems/phone-directory4628/1
https://www.hackerearth.com/problem/algorithm/subarrays-xor/ (ignore if you have already done in previous assignment)
Graphs
Graphs 1(13.04.2024)
https://leetcode.com/problems/find-if-path-exists-in-graph/description/ <
https://www.interviewbit.com/problems/largest-distance-between-nodes-of-a-tree/
https://leetcode.com/problems/number-of-provinces/description/ <
https://www.geeksforgeeks.org/problems/detect-cycle-in-a-directed-graph/1 <
https://leetcode.com/problems/minimum-number-of-vertices-to-reach-all-nodes/description/ <
Graphs 2(14.04.2024)
https://leetcode.com/problems/surrounded-regions/description/ <
https://leetcode.com/problems/check-if-there-is-a-valid-path-in-a-grid/description/
https://leetcode.com/problems/rotting-oranges/ <
https://www.interviewbit.com/problems/valid-path/
https://leetcode.com/problems/number-of-islands/description/ <
https://www.interviewbit.com/problems/knight-on-chess-board/ <
https://www.geeksforgeeks.org/problems/distance-of-nearest-cell-having-1-1587115620/1 <
Graphs 3(18.04.2024)
https://www.geeksforgeeks.org/problems/minimum-edges/1 <
https://leetcode.com/problems/course-schedule/description/ <
https://leetcode.com/problems/course-schedule-ii/description/ <
https://leetcode.com/problems/all-ancestors-of-a-node-in-a-directed-acyclic-graph/description/ <
https://leetcode.com/problems/largest-color-value-in-a-directed-graph/description/
https://www.geeksforgeeks.org/problems/detect-cycle-in-a-directed-graph/1 <
Graphs 4(19.04.2024)
https://www.geeksforgeeks.org/problems/strongly-connected-components-kosarajus-algo/1 <
https://leetcode.com/problems/is-graph-bipartite/description/ <
https://leetcode.com/problems/clone-graph/ (just practice once) <
https://leetcode.com/problems/shortest-cycle-in-a-graph/description/ (try)
https://codeforces.com/problemset/problem/1093/D
Graphs 5(21.04.2024)
https://leetcode.com/problems/minimum-time-to-visit-disappearing-nodes/description/ <
https://leetcode.com/problems/path-with-maximum-probability/description/ <
https://leetcode.com/problems/network-delay-time/description/ <
https://leetcode.com/problems/path-with-minimum-effort/description/ <
https://leetcode.com/problems/find-the-city-with-the-smallest-number-of-neighbors-at-a-threshold-distance/description/ <
https://leetcode.com/problems/cheapest-flights-within-k-stops/description/ <
https://leetcode.com/problems/find-edges-in-shortest-paths/description/ (try)
Graphs 6(21.04.2024)
https://leetcode.com/problems/remove-max-number-of-edges-to-keep-graph-fully-traversable/description/
https://leetcode.com/problems/min-cost-to-connect-all-points/description/
https://leetcode.com/problems/redundant-connection-ii/description/
Graphs 7(28.04.2024)
https://leetcode.com/problems/redundant-connection/description/
https://leetcode.com/problems/couples-holding-hands/description/
https://leetcode.com/problems/process-restricted-friend-requests/
Dynamic Programming
Dynamic Programming 1(28.04.2024)
https://leetcode.com/problems/climbing-stairs/description/
https://leetcode.com/problems/jump-game-ii/description/
https://leetcode.com/problems/perfect-squares/description/
https://www.geeksforgeeks.org/problems/adjacents-are-not-allowed3528/1
https://leetcode.com/problems/house-robber/
https://leetcode.com/problems/house-robber-ii/
https://leetcode.com/problems/solving-questions-with-brainpower/
Dynamic Programming 2(28.04.2024)
https://www.geeksforgeeks.org/problems/friends-pairing-problem5425/1
https://leetcode.com/problems/number-of-dice-rolls-with-target-sum/description/
https://leetcode.com/problems/decode-ways/description/
https://leetcode.com/problems/decode-ways-ii/description/ (try)
https://www.geeksforgeeks.org/given-array-three-numbers-maximize-x-ai-y-aj-z-ak/
Dynamic Programming 3(04.05.2024)
https://leetcode.com/problems/coin-change/
https://leetcode.com/problems/coin-change-ii/description/
https://leetcode.com/problems/maximum-subarray/description/
https://leetcode.com/problems/maximum-product-subarray/description/
https://leetcode.com/problems/longest-increasing-subsequence/description/
https://cses.fi/problemset/task/1633
https://cses.fi/problemset/task/1634
https://cses.fi/problemset/task/1636
Dynamic Programming 4(04.05.2024)
https://leetcode.com/problems/length-of-the-longest-subsequence-that-sums-to-target/
https://leetcode.com/problems/number-of-longest-increasing-subsequence/description/
https://leetcode.com/problems/unique-paths/description/
https://leetcode.com/problems/unique-paths-ii/
https://leetcode.com/problems/minimum-path-cost-in-a-grid/
https://leetcode.com/problems/minimum-path-sum/
Dynamic Programming 5(05.05.2024)
https://leetcode.com/problems/dungeon-game/
https://leetcode.com/problems/longest-common-subsequence/
https://leetcode.com/problems/shortest-common-supersequence/description/
Miscellaneous
Miscellaneous 1(23.04.2024)
https://leetcode.com/problems/heaters/description/
https://leetcode.com/problems/shortest-subarray-with-sum-at-least-k/description/
https://leetcode.com/problems/maximum-points-you-can-obtain-from-cards/description/
Miscellaneous 2(28.04.2024)
https://leetcode.com/problems/fruit-into-baskets/description/
https://leetcode.com/problems/number-of-visible-people-in-a-queue/description/
https://leetcode.com/problems/evaluate-division/description/
https://leetcode.com/problems/longest-continuous-subarray-with-absolute-diff-less-than-or-equal-to-limit/description/
Miscellaneous 3(04.05.2024)
https://leetcode.com/problems/minimize-hamming-distance-after-swap-operations/description/
https://leetcode.com/problems/boats-to-save-people