Solving problems from Leetcode, mainly in Python. The problem descriptions and my solutions are linked in the following table:
β - Questions that I found harder to solve
π - Questions that are from Leetcode premium
Sr. No. | Problem No. | Title | Solution | Difficulty | Companies |
---|---|---|---|---|---|
1 | 344 | Reverse String | Python | Easy | - |
2 | 412 | Fizz Buzz | Python | Easy | - |
3 | 136 | Single Number | Python | Easy | Amazon, Google, Microsoft, Facebook, Bloomberg, Adobe, Apple, Uber, Airbnb, Palantir |
4 | 104 | Maximum Depth of Binary Tree | Python | Easy | LinkedIn, Uber, Apple, Yahoo |
5 | 283 | Move Zeroes | Python | Easy | Facebook, Bloomberg |
6 | 371 | Sum of Two Integers | Python | Medium | - |
7 | 171 | Excel Sheet Column Number | Python | Easy | Uber, Microsoft |
8 | 122 | Best Time to Buy and Sell Stock II | Python | Easy | Bloomberg |
9 | 169 | Majority Element | Python | Easy | Adobe, Zenefit |
10 | 013 | Roman to Integer | Python | Easy | Microsoft, Yahoo, Bloomberg, Uber, Facebook |
11 | 387 | First Unique Character in a String | Python | Easy | - |
12 | 237 | Delete Node in a Linked List | Python | Easy | Microsoft, Apple, Adobe |
13 | 242 | Valid Anagram | Python | Easy | Uber, Amazon, Yelp |
14 | 217 | Contains Duplicate | Python | Easy | Apple, Microsoft, Adobe, Amazon, Google, Bloomberg, Facebook, Palantir, Airbnb, Yahoo |
15 | 206 | Reverse Linked List | Python | Easy | Uber, Facebook, Twitter, Zenefit, Amazon, Microsoft, Snapchat, Apple, Yahoo, Bloomberg, Yelp, Adobe |
16 | 350 | Intersection of Two Arrays II | Python | Easy | - |
17 | 268 | Missing Number | Python | Easy | Microsoft, Bloomberg |
18 | 108 | Convert Sorted Array to Binary Search Tree | Python | Easy | Airbnb |
19 | 121 | Best Time to Buy and Sell Stock | Python | Easy | Uber, Facebook, Amazon, Microsoft, Bloomberg |
20 | 202 | Happy Number | Python | Easy | Uber, Airbnb, Twitter |
21 | 070 | Climbing Stairs | Python | Easy | Apple, Adobe |
22 | 326 | Power of Three | Python | Easy | |
23 | 021 | Merge Two Sorted Lists | Python | Easy | LinkedIn, Amazon, Microsoft, Apple |
24 | 191 | Number of 1 Bits | Python | Easy | Microsoft, Apple |
25 | 053 | Maximum Subarray | Python | Easy | LinkedIn, Microsoft, Bloomberg |
26 | 101 | Symmetric Tree | Python | Easy | LinkedIn, Microsoft, Bloomberg |
27 | 198 | House Robber | Python | Easy | LinkedIn, Airbnb |
28 | 118 | Pascal's Triangle | Python | Easy | Twitter, Apple |
29 | 066 | Plus One | Python | Easy | |
30 | 001 | Two Sum | Python | Easy | LinkedIn, Uber, Airbnb, Facebook, Microsoft, Apple, Yahoo, Dropbox, Bloomberg, Yelp, Adobe |
31 | 172 | Factorial Trailing Zeroes | Python | Easy | Bloomberg |
32 | 038 | Count and Say | Python | Medium | |
33 | 026 | Remove Duplicates from Sorted Array | Python | Easy | Facebook, Microsoft, Bloomberg |
34 | 141 | Linked List Cycle | Python | Easy | Amazon, Microsoft, Yahoo, Bloomberg |
35 | 020 | Valid Parentheses | Python | Easy | Google, Airbnb, Facebook, Twitter, Zenefit, Amazon, Microsoft, Bloomberg |
36 | 234 | Palindrome Linked List | Python | Easy | Facebook, Amazon |
37 | 088 | Merge Sorted Array | Python | Easy | Facebook, Microsoft, Bloomberg |
38 | 014 | Longest Common Prefix | Python | Easy | Amazon, Facebook, Apple, Bloomberg, Microsoft, Uber, Google, Quora, Yelp |
39 | 160 | Intersection of Two Linked Lists | Python | Easy | Airbnb, Amazon, Microsoft, Bloomberg |
40 | 155 | Min Stack | Python | Easy | Google, Uber, Zenefit, Amazon, Snapchat, Bloomberg |
41 | 190 | Reverse Bits | Python | Easy | Airbnb, Apple |
42 | 028 | Implement strStr() | Python | Easy | Amazon, Apple, Bloomberg, Facebook, Microsoft, Adobe, Goldman Sachs, Google |
43 | 069 | Sqrt(x) | Python | Easy | Facebook, Apple, Bloomberg |
44 | 125 | Valid Palindrome | Python | Easy | Uber, Facebook, Zenefit, Microsoft |
45 | 204 | Count Primes | Python | Easy | Amazon, Microsoft |
46 | 189 | Rotate Array | Python | Easy | Microsoft, Bloomberg |
47 | 007 | Reverse Integer | Python | Easy | Apple, Bloomberg |
β 48 | 238 | Product of Array Except Self | Python | Medium | LinkedIn, Facebook, Amazon, Microsoft, Apple |
49 | 347 | Top k Frequent Elements | Python | Medium | Facebook, Amazon, Apple, Google, Microsoft, Bloomberg, Uber, Pocket Gems, Goldman Sachs |
50 | 094 | Binary Tree Inorder Traversal | Python | Medium | Microsoft |
51 | 454 | 4 Sum II | Python | Medium | - |
52 | 384 | Shuffle an Array | Python | Medium | - |
53 | 022 | Generate Parantheses | Python | Medium | Google, Uber, Zenefit |
54 | 046 | Permutations | Python | Medium | LinkedIn, Microsoft, |
55 | 378 | kth Smallest Element in a Sorted Matrix | Python | Medium | - |
56 | 230 | kth Smallest Element in a BST | Python | Medium | Google, Uber, Bloomberg |
57 | 328 | Odd Even Linked List | Python | Medium | - |
β β 58 | 287 | Find the Duplicate Number | Python | Medium | Bloomberg |
59 | 078 | Subsets | Python | Medium | Uber, Facebook, Amazon |
60 | 341 | Flatten Nested List Iterator | Python | Medium | |
61 | 062 | Unique Paths | Python | Medium | Bloomberg |
62 | 102 | Binary Tree Level Order Traversal | Python | Medium | Facebook, Microsoft, Amazon, Bloomberg, LinkedIn, Apple |
63 | 048 | Rotate Image | Python | Medium | Facebook, Microsoft, Amazon, Bloomberg, Pocket Gems, Apple, Uber, Google, Palantir |
64 | 215 | kth Largest Element in an Array | Python | Medium | Facebook, Amazon, Microsoft, Goldman Sachs, Google, Apple, Bloomberg, LinkedIn, Uber, Adobe |
65 | 334 | Increasing Triplet Subsequence | Python | Medium | |
66 | 380 | Insert Delete GetRandom O(1) | Python | Medium | Amazon, Facebook, Microsoft, Bloomberg, Twitter, LinkedIn, Apple, Google, Adobe, Uber, Goldman Sachs |
67 | 240 | Search a 2D matrix II | Python | Medium | Google, Amazon, Apple |
68 | 300 | Longest Increasing Subsequence | Python | Medium | Apple, Amazon, Google, Facebook, Twitter, Bloomberg, Microsoft |
69 | 075 | Sort Colors | Python | Medium | Microsoft, Amazon, Facebook, Apple, Bloomberg, Google, Goldman Sachs, LinkedIn, Uber |
70 | 162 | Find Peak Element | Python | Medium | Google, Microsoft |
71 | 049 | Group Anagrams | Python | Medium | Facebook, Amazon, Bloomberg, Uber, Yelp |
72 | 279 | Perfect Squares | Python | Medium | |
73 | 036 | Valid Sudoku | Python | Medium | Uber, Apple, Snapchat |
74 | 289 | Game of Life | Python | Medium | Google, Snapchat |
75 | 011 | Container with Most Water | Python | Medium | Bloomberg |
76 | 116 | Populating Next Right Pointers in Each Node | Python | Medium | Microsoft |
77 | 103 | Binary Tree Zig Zag Level Order Traversal | Python | Medium | Microsoft, Bloomberg, LinkedIn |
78 | 654 | Maximum Binary Tree | Python | Medium | Microsoft |
79 | 617 | Merge two Binary Trees | Python | Easy | Amazon |
80 | 513 | Find Bottom Left Tree Value | Python | Medium | Microsoft |
81 | 500 | Keyboard Row | Python | Easy | - |
82 | 496 | Next Greater Element I | Python | Easy | - |
83 | 485 | Max Consecutive Ones | Python | Easy | |
84 | 669 | Trim a Binary Search Tree | Python | Easy | Bloomberg |
85 | 461 | Hamming Distance | Python | Easy | |
86 | 292 | Nim Game | Python | Easy | Adobe |
87 | 476 | Number Complement | Python | Easy | - |
88 | 463 | Island Perimeter | Python | Easy | |
89 | 079 | Word Search | Python | Medium | Apple, Oracle, Twitter, Intuit, Snap, Pinterest, Google, Facebook, Microsoft, Bloomberg, Amazon |
90 | 152 | Maximum Product Subrray | Python | Medium | |
91 | 338 | Counting Bits | Python | Medium | - |
92 | 231 | Power of Two | Python | Easy | |
93 | 257 | Binary Tree Paths | Python | Easy | Google, Facebook, Apple |
94 | 205 | Isomorphic Strings | Python | Easy | |
95 | 047 | Permutations II | Python | Medium | LinkedIn, Microsoft |
96 | 050 | Pow(x, n) | Python | Medium | LinkedIn, Google, Facebook, Bloomberg |
97 | 284 | Peeking Iterator | Python | Medium | Google, Apple, Yahoo |
98 | 173 | Binary Search Tree Iterator | Python | Medium | Google, LinkedIn, Facebook, Microsoft |
99 | 054 | Spiral Matrix | Python | Medium | Apple, Adobe, Amazon, Google, Uber, Microsoft |
100 | 133 | Clone Graph | Python | Medium | Facebook, Microsoft, Amazon, Bloomberg, Apple, Google, Uber, Twitter, Adobe, Pocket Gems |
101 | 067 | Add Binary | Python | Easy | |
102 | 127 | Word Ladder | Python | Hard | Amazon, Facebook, Uber, Apple, Microsoft, Google, LinkedIn, Bloomberg |
103 | 042 | Trapping Rain Water | Python | Hard | Goldman Sachs, Facebook, Amazon, Bloomberg, Microsoft, Google, Twitter, Zenefit, Apple, Adobe, Uber |
104 | 303 | Range Sum Query - Immutable | Python | Easy | Palantir |
105 | 219 | Contains Duplicate II | Python | Easy | Facebook, Adobe, Amazon, Google, Bloomberg, Microsoft, Apple, Airbnb, Palantir |
106 | 218 | The Skyline Problem | Python | Hard | Google, Facebook, Twitter, Microsoft, Yelp |
107 | 033 | Search in Rotated Sorted Array | Python | Medium | LinkedIn, Uber, Facebook, Microsoft, Bloomberg |
108 | 081 | Search in Rotated Sorted Array II | Python | Medium | - |
109 | 274 | H - Index | Python | Medium | Google, Facebook, Bloomberg |
110 | 235 | Lowest Common Ancestor of a Binary Search Tree | Python | Easy | Amazon, Google, Facebook, Microsoft, LinkedIn |
111 | 012 | Integer to Roman | Python | Medium | Amazon, Microsoft, Google, LinkedIn, Bloomberg, Apple, Facebook |
112 | 060 | Permutation Sequence | Python | Medium | |
113 | 208 | Implement Trie | Python | Medium | Google, Uber, Facebook, Twitter, Microsoft, Bloomberg |
114 | 043 | Multiply Strings | Python | Medium | Facebook, Twitter |
115 | 023 | Merge K Sorted Lists | Python | Hard | Amazon, Facebook, Microsoft, Bloomberg, Apple, Google, Adobe, Goldman Sachs, LinkedIn, Uber, Palantir |
116 | 010 | Regular Expression Matching | Python | Hard | Facebook, Microsoft, Amazon, Goldman Sachs, Google, Apple, Bloomberg, Uber, Twitter, Pocket Gems |
117 | 139 | Word Break | Python | Medium | Google, Uber, Facebook, Amazon, Yahoo, Bloomberg |
118 | 140 | Word Break II | Python | Hard | Facebook, Amazon, Google, Bloomberg, Microsoft, Apple, Uber |
119 | 146 | LRU Cache | Python | Medium | Google, Uber, Facebook, Twitter, Zenefit, Amazon, Microsoft, Snapchat, Yahoo, Bloomberg, Palantir |
120 | 149 | Max Points on a Line | Python | Hard | LinkedIn, Twitter, Apple |
π 121 | 266 | Palindrome Permutation | Python | Easy | Google, Uber |
π 122 | 280 | Wiggle Sort | Python | Medium | |
123 | 017 | Letter Combinations of a Phone Number | Python | Medium | Google, Uber, Facebook, Amazon, Dropbox |
124 | 031 | Next Permutation | Python | Medium | |
125 | 406 | Queue Reconstruction by Height | Python | Medium | - |
126 | 039 | Combination Sum | Python | Medium | Uber, Snapchat |
127 | 096 | Unique Binary Search Trees | Python | Medium | Snapchat |
128 | 151 | Reverse Words in a String | Python | Medium | Microsoft, Facebook, Apple, Amazon, LinkedIn, Google, Bloomberg, Yelp |
129 | 1108 | Defanging an IP Address | Python | Easy | - |
130 | 771 | Jewels and Stones | Python | Easy | - |
131 | 1266 | Minimum Time Visiting All Points | Python | Easy | - |
132 | 258 | Add Digits | Python | Easy | Adobe, Microsoft |
133 | 807 | Max Increase to Keep City Skyline | Python | Medium | - |
134 | 015 | 3 Sum | Python | Medium | Facebook, Amazon, Microsoft, Bloomberg, Adobe |
135 | 002 | Add Two Numbers | Python | Medium | Airbnb, Amazon, Microsoft, Bloomberg, Adobe |
136 | 105 | Construct Binary Tree from Preorder and Inorder Traversal | Python | Medium | Bloomberg |
137 | 128 | Longest Consecutive Sequence | Python | Medium | Google, Microsoft, Amazon, Facebook, Bloomberg, Uber, Apple |
138 | 073 | Set Matrix Zeroes | Python | Medium | Microsoft |
139 | 084 | Largest Rectangle in Histogram | Python | Hard | - |
140 | 055 | Jump Game | Python | Medium | Apple, Amazon, Microsoft |
141 | 041 | First Missing Positive | Python | Hard | - |
β β 142 | 004 | Median of Two Sorted Arrays | Python | Hard | Google, Zenefit, Microsoft, Apple, Yahoo, Dropbox, Adobe |
143 | 200 | Number of Islands | Python | Medium | Google, Zenefit, Microsoft, Facebook, Amazon |
144 | 329 | Longest Increasing Path in a Matrix | Python | Hard | Google, Facebook, Amazon, Bloomberg, Apple, Microsoft, Uber, LinkedIn |
145 | 207 | Course Schedule | Python | Medium | Amazon, Facebook, Microsoft, Google, Uber, Bloomberg, Apple, LinkedIn |
146 | 315 | Count of Smaller Numbers after Self | Python | Hard | |
147 | 210 | Course Schedule II | Python | Medium | Zenefit, Facebook |
148 | 124 | Binary Tree Maximum Path Sum | Python | Hard | Facebook, Amazon, Google, Microsoft, Adobe, Apple, Bloomberg, Uber |
149 | 098 | Validate Binary Search Tree | Python | Medium | Microsoft, Facebook, Amazon, Bloomberg |
150 | 130 | Surrounded Regions | Python | Medium | - |
151 | 029 | Divide Two Integers | Python | Medium | - |
β β 152 | 131 | Palindrome Partitioning | Python | Medium | Bloomberg |
153 | 236 | Lowest Common Ancestor of a Binary Tree | Python | Medium | Amazon, Facebook, LinkedIn, Oracle, Microsoft |
154 | 148 | Sort List | Python | Medium | Facebook, Adobe, Microsoft |
155 | 395 | Longest Substring with At Least K Repeating Characters | Python | Medium | - |
156 | 138 | Copy List with Random Pointers | Python | Medium | Uber, Amazon, Microsoft, Bloomberg |
157 | 134 | Gas Station | Python | Medium | - |
158 | 056 | Merge Intervals | Python | Medium | Amazon, Adobe, Uber, Palantir, LinkedIn, Google, Facebook, Twitter, Microsoft, Bloomberg, Yelp |
159 | 003 | Longest Substring without Repeating Characters | Python | Medium | Adobe, Amazon, Bloomberg, Yelp |
160 | 034 | Search for a Range | Python | Medium | |
161 | 227 | Basic Calculator II | Python | Medium | - |
162 | 150 | Evaluate Reverse Polish Notation | Python | Medium | |
163 | 322 | Coin Change | Python | Medium | Bloomberg, Amazon, Microsoft, Goldman Sachs, BlackRock, Microsoft, Apple, Uber, Oracle, Facebook, Airbnb |
164 | 443 | String Compression | Python | Medium | Expedia |
165 | 611 | Valid Triangle Number | Python | Medium | Expedia |
166 | 019 | Remove Nth Node from End of List | Python | Medium | Facebook, Amazon, Apple, Bloomberg |
167 | 179 | Largest Number | Python | Medium | - |
168 | 324 | Wiggle Sort II | Python | Medium | |
169 | 005 | Longest Palindromic Substring | Python | Medium | Amazon, Microsoft, Facebook, Adobe, Google, Goldman Sachs, Oracle, Apple |
170 | 091 | Decode Ways | Python | Medium | JPMorgan, Lyft, Microsoft, Facebook, Google, Goldman Sachs, Apple, Uber |
171 | 166 | Fraction to Recurring Decimal | Python | Medium | |
172 | 008 | String to Integer (atoi) | Python | Medium | Uber, Amazon, Microsoft, Bloomberg |
173 | 297 | Serialize and Deserialize Binary Tree | Python | Hard | LinkedIn, Google, Uber, Amazon, Facebook, Microsoft, Yahoo, Quora, Bloomberg, Oracle |
174 | 393 | UTF-8 Validation | Python | Medium | Facebook, Palantir, Apple, Amazon, Microsoft, Google |
175 | 539 | Minimum Time Difference | Python | Medium | Palantir, Amazon |
176 | 273 | Minimum Time Difference | Python | Hard | Palantir, Amazon, Facebook, Microsoft, LinkedIn, Apple, Oracle, Adobe, Google |
177 | 733 | Flood Fill | Python | Easy | Palantir, Amazon, Facebook, Microsoft, Apple, Adobe, Google, Uber, Bloomberg |
π 178 | 277 | Find the Celebrity | Python | Medium | Microsoft, Amazon, Apple, Facebook, LinkedIn, Google, Palantir, Uber |
179 | 220 | Contains Duplicate III | Python | Medium | Facebook, Adobe, Google, Apple, Airbnb, Palantir |
π 180 | 694 | Number of Distinct Islands | Python | Medium | Amazon, Facebook, Microsoft, Bloomberg, Apple, Palantir, Uber |
π 181 | 723 | Candy Crush | Python | Medium | Bloomberg, Palantir, Google, Uber, Facebook |
182 | 695 | Max Area of Island | Python | Medium | Google, Amazon, Facebook, Microsoft, Bloomberg, Oracle, Palantir, LinkedIn, Apple |
π 183 | 681 | Next Closest Time | Python | Medium | Amazon, Google, Microsoft, Facebook, Uber, Palantir |
184 | 072 | Edit Distance | Python | Hard | Microsoft, Amazon, Google, Facebook, Palantir, Apple, LinkedIn, Bloomberg, Uber |
185 | 1232 | Edit Distance | Python | Easy | Palantir |
π 186 | 325 | Maximum Size Subarray Sum Equals k | Python | Medium | Goldman Sachs, Facebook, Microsoft, Google, Amazon, Palantir |
187 | 740 | Delete and Earn | Python | Medium | Goldman Sachs, Apple, Pocket Gems, Uber, Amazon |
π 188 | 366 | Find Leaves of Binary Tree | Python | Medium | LinkedIn, Amazon, Pocket Gems, Google |
189 | 547 | Number of Provinces | Python | Medium | Amazon, Facebook, Google, Goldman Sachs, Adobe, Apple, Pocket Gems, Microsoft, Uber, Bloomberg |
π 190 | 285 | Inorder Successor in BST | Python | Medium | Amazon, Microsoft, Facebook, Adobe, Google, Bloomberg |
191 | 1010 | Pairs of Songs With Total Durations Divisible by 60 | Python | Medium | Amazon, Pocket Gems, Dropbox, Visa, Adobe, Google |
192 | 442 | Find All Duplicates in an Array | Python | Medium | Facebook, Microsoft, Amazon, Bloomberg, Apple, Google. Pocket Gems |
193 | 692 | Top k Frequent Words | Python | Medium | Amazon, Google, Bloomberg, Apple, Microsoft, Facebook, Uber, Paypal, Adobe |
π 194 | 1428 | Leftmost Column with at Least a One | Python | Medium | Facebook, Pocket Gems |
195 | 159 | Longest Substring with At Most 2 Distinct Characters | Python | Medium | Facebook, Microsoft, Uber, Amazon, Google, LinkedIn |
196 | 340 | Longest Substring with At Most k Distinct Characters | Python | Medium | Facebook, Microsoft, Uber, Amazon, Google, LinkedIn |
197 | 424 | Longest Repeating Character Replacement | Python | Medium | Amazon, Microsoft, Google, Facebook, Bloomberg |
π 198 | 772 | Basic Calculator III | Python | Medium | Amazon, Facebook, Uber, Apple, Google, Microsoft |
199 | 221 | Maximal Square | Python | Medium | Amazon, Twitter, Google, Goldman Sachs, Pocket Gems, Apple, Facebook, Microsoft, Uber, Bloomberg |
200 | 1761 | Minimum Degree of a Connected Trio in a Graph | Python | Hard | Amazon, Pocket Gems |
201 | 600 | Non-negative Integers without Consecutive Ones | Python | Hard | Pocket Gems |
π 202 | 269 | Alien Dictionary | Python | Hard | Facebook, Amazon, Airbnb, Bloomberg, Google, Microsoft, Apple, Uber, Twitter |
203 | 214 | Shortest Palindrome | Python | Hard | Microsoft, Google, Facebook, Amazon, Bloomberg, Adobe |
204 | 1448 | Count Good Nodes in Binary Tree | Python | Medium | Facebook, Amazon, Bloomberg |
205 | 543 | Diameter of Binary Tree | Python | Easy | Facebook, Amazon, Microsoft, Bloomberg, Google, Adobe, Apple |
206 | 199 | Binary Tree Right Side View | Python | Medium | Facebook, Amazon, Microsoft, Bloomberg, Apple, Goldman Sachs, Adobe, Uber |
207 | 112 | Path Sum | Python | Easy | Facebook, Amazon, Microsoft, Apple, Bloomberg, Adobe, Google |
208 | 113 | Path Sum 2 | Python | Medium | Facebook, Amazon, Microsoft, Apple, Google, Adobe |
209 | 437 | Path Sum 3 | Python | Medium | Amazon, Microsoft, Apple, Facebook, Adobe, Bloomberg |
210 | 666 | Path Sum 4 | Python | Medium | |
211 | 987 | Vertical Order Traversal of a Binary Tree | Python | Hard | Facebook, Amazon, Bloomberg, Microsoft, Apple, Uber, Google, Adobe, LinkedIn |
212 | 646 | Maximum Length of Pair Chain | Python | Medium | Amazon, Uber, Apple, Bloomberg |
213 | 1611 | Minimum One Bit Operations to Make Integers Zero | Python | Hard | |
214 | 1333 | Filter Restaurants by Vegan-Friendly, Price and Distance | Python | Medium | Yelp, Amazon |
215 | 599 | Minimum Index Sum of Two Lists | Python | Easy | Oracle, Yelp |
216 | 355 | Design Twitter | Python | Medium | Amazon, Microsoft, Yelp, Apple, Oracle |
217 | 332 | Reconstruct Itinerary | Python | Medium | Microsoft, Google, Uber, Bloomberg, Facebook, Twitter, Apple, Goldman Sachs, Yelp |
218 | 528 | Random Pick with Weight | Python | Medium | Facebook, LinkedIn, Google, Amazon, Apple, Yelp, Microsoft, Bloomberg, Uber, Twitter |
219 | 1436 | Destination City | Python | Easy | Yelp, Paypal |
220 | 784 | Letter Case Permutation | Python | Medium | Spotify, Microsoft, Amazon, Apple, Bloomberg, Yelp, Facebook |
221 | 394 | Decode String | Python | Medium | Bloomberg, Google, Amazon, Microsoft, Uber, Facebook, Apple |
222 | 1455 | Check If a Word Occurs As a Prefix of Any Word in a Sentence | Python | Easy | Yelp |
223 | 1396 | Design Underground System | Python | Medium | Bloomberg |
224 | 1209 | Remove All Adjacent Duplicates in String II | Python | Medium | Bloomberg, Facebook, Amazon, Microsoft, Google |
π 225 | 348 | Design Tic-Tac-Toe | Python | Medium | Amazon, Facebook, Microsoft, Apple, Google, Uber, Bloomberg |
226 | 1169 | Invalid Transactions | Python | Medium | Bloomberg, Amazon |
227 | 1167 | Minimum Cost to Connect Sticks | Python | Medium | Amazon, Google |
228 | 1480 | Running Sum of 1D Array | Python | Easy | Amazon, Apple, Adobe, Bloomberg, Google, Microsoft, Uber |
229 | 1029 | Two City Scheduling | Python | Medium | Bloomberg, Amazon, Google |
230 | 381 | nsert Delete GetRandom O(1) - Duplicates allowed | Python | Hard | Amazon, Facebook, LinkedIn, Apple, Microsoft, Uber, Google, Bloomberg |
231 | 252 | Meeting Rooms | Python | Easy | Amazon, Microsoft, Facebook, Bloomberg, Google |
232 | 253 | Meeting Rooms II | Python | Medium | Amazon, Bloomberg, Microsoft, Google, Facebook, Uber, Apple, Goldman Sachs |
233 | 662 | Maximum Width of Binary Tree | Python | Medium | Microsoft, Bloomberg, Apple, Amazon, Google, Facebook |
234 | 1041 | Robot Bounded In Circle | Python | Medium | Amazon, Goldman Sachs, Google, LinkedIn, Microsoft |
235 | 430 | Flatten a Multilevel Doubly Linked List | Python | Medium | Bloomberg, Microsoft, Amazon, Google, Facebook, Uber |
236 | 797 | All Paths From Source to Target | Python | Medium | Bloomberg, Amazon, Microsoft, Apple |
237 | 1583 | Count Unhappy Friends | Python | Medium | Bloomberg |
238 | 1472 | Design Browser History | Python | Medium | Bloomberg, Amazon |
239 | 266 | Invert Binary Tree | Python | Easy | Google, Amazon, Microsoft, Facebook, Bloomberg, Goldman Sachs, Apple |
π 240 | 1086 | High Five | Python | Easy | Goldman Sachs, Amazon |
241 | 592 | Fraction Addition and Subtraction | Python | Medium | Goldman Sachs |
242 | 1395 | Count Number of Teams | Python | Medium | Goldman Sachs, Amazon, Apple, Google |
243 | 724 | Find Pivot Index | Python | Easy | Goldman Sachs, Facebook, Twitter, Apple, Microsoft, Bloomberg, Google, Amazon |
244 | 209 | Minimum Size Subarray Sum | Python | Medium | Goldman Sachs, Amazon, Bloomberg, Facebook, Google, Microsoft, Uber, Apple |
245 | 068 | Text Justification | Python | Hard | Uber, Google, LinkedIn, Amazon, Microsoft, Facebook, Apple, Bloomberg, Paypal, Twitter, Airbnb |
π 246 | 426 | Convert Binary Search Tree to Sorted Doubly Linked List | Python | Medium | Facebook, Microsoft, Amazon, Google, Bloomberg, Uber |
247 | 938 | Range Sum of BST | Python | Easy | Facebook, Google, Amazon, Apple, Microsoft |
β 248 | 1008 | Construct Binary Search Tree from Preorder Traversal | Python | Medium | Amazon, Microsoft, Facebook |
249 | 449 | Serialize and Deserialize BST | Python | Medium | Facebook, Amazon, Microsoft, LinkedIn, Apple, Uber, Google |
250 | 1509 | Minimum Difference Between Largest and Smallest Value in Three Moves | Python | Medium | |
251 | 690 | Employee Importance | Python | Easy | Google, Amazon, Microsoft |
252 | 1423 | Maximum Points You Can Obtain from Cards | Python | Medium | Google, Apple, Uber, Amazon |
π 253 | 359 | Logger Rate Limiter | Python | Easy | Google, Apple, Microsoft, Facebook, Amazon, Bloomberg, Uber |
254 | 1610 | Maximum Number of Visible Points | Python | Hard | Google, Amazon |
255 | 894 | All Possible Full Binary Trees | Python | Medium | Google, Amazon |
256 | 1525 | Number of Good Ways to Split a String | Python | Medium | Google, Apple |
257 | 1499 | Max Value of Equation | Python | Hard | |
β 258 | 239 | Sliding Window Maximum | Python | Hard | Amazon, Google, Facebook, Microsoft, Bloomberg, Uber, Apple |
259 | 875 | Koko Eating Bananas | Python | Medium | Google, Facebook, Airbnb, Amazon, Apple |
260 | 837 | New 21 Game | Python | Medium | Google, Uber, Apple |
261 | 853 | Car Fleet | Python | Medium | Google, Amazon |
262 | 1048 | Longest String Chain | Python | Medium | Google, Bloomberg, Amazon |
263 | 729 | My Calendar I | Python | Medium | Google, Amazon, Facebook, Apple, Bloomberg, Microsoft |
264 | 504 | Base 7 | Python | Easy | |
265 | 1277 | Count Square Submatrices with All Ones | Python | Medium | Google, Amazon, Bloomberg, Microsoft, Apple, Facebook |
266 | 1110 | Delete Nodes And Return Forest | Python | Medium | Google, Amazon, Facebook |
267 | 833 | Find And Replace in String | Python | Medium | companies |
268 | 929 | Unique Email Addresses | Python | Easy | Google, Amazon, Microsoft |
269 | 975 | Odd Even Jump | Python | Hard | |
270 | 981 | Time Based Key-Value Store | Python | Medium | Google, Amazon, Microsoft, Facebook, Apple, Uber, LinkedIn, Bloomberg |
271 | 721 | Accounts Merge | Python | Medium | Facebook, Google, Microsoft, Amazon, Apple, LinkedIn, Uber, Bloomberg |
π 272 | 489 | Robot Room Cleaner | Python | Hard | Google, Microsoft, Facebook, Amazon |
273 | 735 | Asteroid Collision | Python | Medium | Google, Amazon, Microsoft |
274 | 951 | Flip Equivalent Binary Trees | Python | Medium | Google, Microsoft, Amazon, Apple |
275 | 1776 | Car Fleet II | Python | Hard | |
276 | 652 | Find Duplicate Subtrees | Python | Medium | Google, Amazon, Microsoft, Bloomberg |
277 | 1706 | Where Will the Ball Fall | Python | Medium | |
278 | 1526 | Minimum Number of Increments on Subarrays to Form a Target Array | Python | Hard | |
279 | 1642 | Furthest Building You Can Reach | Python | Medium | Google, Bloomberg |
280 | 1834 | Single-Threaded CPU | Python | Medium | |
281 | 126 | Word Ladder II | Python | Hard | Amazon, Facebook, Uber, Google, Bloomberg, Microsoft, LinkedIn, Apple |
282 | 564 | Find the Closest Palindrome | Python | Hard | Microsoft, Amazon, Apple |
283 | 731 | My Calendar II | Python | Medium | Google, Microsoft, Bloomberg, Amazon |
284 | 732 | My Calendar III | Python | Hard | Google, Facebook, Amazon |
285 | 1143 | Longest Common Subsequence | Python | Medium | Amazon, Google, Facebook, Microsoft, Uber |
286 | 551 | Student Attendance Record I | Python | Easy | |
287 | 203 | Remove Linked List Elements | Python | Easy | Facebook, Amazon, Google, Bloomberg, Apple, Microsoft |
288 | 110 | Balanced Binary Tree | Python | Easy | Amazon, Facebook, Google, Microsoft, Bloomberg, Adobe |
289 | 937 | Reorder Data in Log Files | Python | Easy | Amazon, Google |
290 | 973 | K Closest Points to Origin | Python | Medium | Facebook, Amazon, Google, Microsoft, LinkedIn, Uber, Apple, Goldman Sachs |
π 291 | 418 | Sentence Screen Fitting | Python | Medium | |
π 292 | 1152 | Analyze User Website Visit Pattern | Python | Medium | Amazon, Apple |
π 293 | 1087 | Brace Expansion | Python | Medium | Google, Amazon |
π 294 | 1244 | Design a Leaderboard | Python | Medium | Bloomberg, Amazon, Google |
π 295 | 323 | Number of Connected Components in an Undirected Graph | Python | Medium | Amazon, LinkedIn, Microsoft, Facebook, Google, Apple |
296 | 792 | Number of Matching Subsequences | Python | Medium | Google, Amazon, Apple |
297 | 349 | Intersection of Two Arrays | Python | Easy | Amazon, Google, Facebook, LinkedIn, Bloomberg, Apple, Microsoft |
298 | 399 | Evaluate Division | Python | Medium | Bloomberg, Uber, Google, Amazon, Microsoft, Facebook, Apple |
299 | 025 | Reverse Nodes in k-Group | Python | Hard | Amazon, Microsoft, Facebook, Apple, Google, Bloomberg |
300 | 222 | Count Complete Tree Nodes | Python | Medium | Microsoft, Amazon, Google, Bloomberg, Facebook |
301 | 1293 | Shortest Path in a Grid with Obstacles Elimination | Python | Hard | Google, Amazon, Microsoft |
302 | 024 | Swap Nodes In Pairs | Python | Medium | Microsoft, Amazon, Google, Facebook, Bloomberg, Apple, Goldman Sachs |