LeetCode Compilation

Going through online LeetCode compilations have helped me a lot, so here’s my own. If you have good problem recommendations, shoot me a note!

These are some problems I found which helped me the most.

(Linked List)

141. Linked List Cycle (cute)

(String/Arrays)

271. Encode and Decode Strings (creative)

418. Sentence Screen Fitting (welcome into the weeds)

(Sorting)

363. Max Sum of Rectangle No Larger Than K (dp with a twist)

(Stack)

294. Basic Calculator (also 227, and 772 since I like to suffer)

(Tree)

297. Serialize and Deserialize Binary Tree (ultimate dfs for trees)

742. Closest Leaf in a Binary Tree (def not a normal tree med)

1245. Tree Diameter (learn a bfs tree fact)

(DFS/BFS/Graph)

694. Number of Distinct Islands (instructive dfs)

293. Shortest Path in a Grid with Obstacles Elimination (dijkstra)

317. Shortest Distance from All Buildings (don’t overthink…)

(Two Pointers)

442. Trapping Rain Water (awesome)

27. Minimum Window Subsequence (instructive)

(Binary Search)

4. Median of Two Sorted Arrays (worth the suffering)

(Backtracking)

51. N-Queens (good to know 46 first)

267. Palindrome Permutations II (get 46 first)

465. Optimal Account Balancing (implementation practice)

(DP/Recursion/etc.)

84. Largest Rectangle in Histogram (practice your visualization)

85. Maximal Rectangle (do this after 84)

312. Burst Balloons (reverse thinking)

354. Russian Doll Envelopes (know your 300 first)

370. Range Addition (dumb but smart)

1416. Restore The Array (death to corner cases)

(Math/Logic)

1538. Guess the Majority in a Hidden Array (*head slamming*)

For coding interviews, I recommend doing curated LeetCode lists like Top 100 Liked and Algo 170 twice while refreshing your knowledge on topics along the way. For video solutions, I love Hua Hua‘s videos (explanations in Chinese, though).

%d bloggers like this: