LeetCode 75 Study Plan Checklist and Solutions
LeetCode 75 study plan selects 75 classic algorithm problems, covering strings, arrays, hashing, two pointers, linked lists, trees, graphs, and dynamic programming. It not only helps beginners quickly master commonly used algorithms and data structures, but also enables experienced programmers to review and fill in gaps systematically. Here we provide a full progress checklist and reference solutions for all 75 problems.
Plan Overview
The LeetCode 75 study plan official overview:
- 75 Essential & Trending Problems
- Must-do problem list for interview prep
- Best for 1~3 months of prep time
The difficulty distribution of the 75 problems in this study plan:
- \(\mathrm{\color{green}{Easy}}\): 22
- \(\mathrm{\color{orange}{Medium}}\): 53
- \(\mathrm{\color{red}{Hard}}\): 0
As can be seen, there are no "Hard" level problems, making it especially suitable for college students preparing for software engineering internship positions.
Progress Checklist
For this study plan, I created a progress checklist (sample below):
# | Problem No. | Title | Group | Tags | Tips | Difficulty | Done |
---|---|---|---|---|---|---|---|
1 | 1768 | Merge Strings Alternately | Array/String | Two Pointers, String | Use two pointers to iterate through both strings | \(\mathrm{\color{green}{Easy}}\) | ☐ |
2 | 1071 | Greatest Common Divisor of Strings | Array/String | String, Math | Use GCD concept with string concatenation | \(\mathrm{\color{green}{Easy}}\) | ☐ |
... | ... | ... | ... | ... | ... | ... | ... |
Study Tips
Based on the author's experience, if you already have solid programming skills and a good foundation in algorithms, then a total of about 80 hours of problem-solving and review should actually be sufficient. Refer to the progress checklist above, and I also offer the following suggestions:
- Track your progress using the checkbox column
- Set a daily or weekly goal for problem-solving
- Use the tips column as hints before looking at solutions
- Focus on understanding patterns within each group
- Review solutions and optimize for better time/space complexity
- Summarize after completing each section
- Revisit problems after a few days to reinforce learning
Reference Solutions
The following table lists all 75 reference solutions that the author has collected, assembled, and verified. Most are written in Python, with a small portion implemented in C. All programs include comments that explain the key algorithmic steps, as well as their time and space complexities. The majority of the code also contains basic test cases. Readers are welcome to leave comments for discussion, feedback, and corrections.
# | Problem No. | Title | Group | Tags | Tips | Difficulty | Solutions |
---|---|---|---|---|---|---|---|
1 | 1768 | Merge Strings Alternately | Array/String | Two Pointers, String | Use two pointers to iterate through both strings | \(\mathrm{\color{green}{Easy}}\) | Python |
2 | 1071 | Greatest Common Divisor of Strings | Array/String | String, Math | Use GCD concept with string concatenation | \(\mathrm{\color{green}{Easy}}\) | Python |
3 | 1431 | Kids With the Greatest Number of Candies | Array/String | Array, Greedy | Find max candies first, then check each kid | \(\mathrm{\color{green}{Easy}}\) | Python |
4 | 605 | Can Place Flowers | Array/String | Array, Greedy | Check adjacent positions before placing | \(\mathrm{\color{green}{Easy}}\) | Python |
5 | 345 | Reverse Vowels of a String | Array/String | Two Pointers, String | Use two pointers from start and end | \(\mathrm{\color{green}{Easy}}\) | Python |
6 | 151 | Reverse Words in a String | Array/String | Two Pointers, String | Split by spaces and reverse order | \(\mathrm{\color{orange}{Medium}}\) | Python |
7 | 238 | Product of Array Except Self | Array/String | Array, Prefix Sum | Use left and right product arrays | \(\mathrm{\color{orange}{Medium}}\) | Python |
8 | 334 | Increasing Triplet Subsequence | Array/String | Array, Greedy | Track smallest and second smallest values | \(\mathrm{\color{orange}{Medium}}\) | Python |
9 | 443 | String Compression | Array/String | Two Pointers, String | Count consecutive characters | \(\mathrm{\color{orange}{Medium}}\) | Python |
10 | 283 | Move Zeroes | Two Pointers | Array, Two Pointers | Use write pointer to place non-zero elements | \(\mathrm{\color{green}{Easy}}\) | Python |
11 | 392 | Is Subsequence | Two Pointers | Two Pointers, String, DP | Use two pointers to match characters | \(\mathrm{\color{green}{Easy}}\) | Python |
12 | 11 | Container With Most Water | Two Pointers | Array, Two Pointers, Greedy | Start from both ends, move shorter line | \(\mathrm{\color{orange}{Medium}}\) | Python |
13 | 1679 | Max Number of K-Sum Pairs | Two Pointers | Array, Hash Table, Two Pointers | Sort array or use hash map | \(\mathrm{\color{orange}{Medium}}\) | Python |
14 | 643 | Maximum Average Subarray I | Sliding Window | Array, Sliding Window | Use sliding window of size k | \(\mathrm{\color{green}{Easy}}\) | Python |
15 | 1456 | Maximum Number of Vowels in a Substring of Given Length | Sliding Window | String, Sliding Window | Slide window and count vowels | \(\mathrm{\color{orange}{Medium}}\) | Python |
16 | 1004 | Max Consecutive Ones III | Sliding Window | Array, Binary Search, Sliding Window, Prefix Sum | Use sliding window with at most k zeros | \(\mathrm{\color{orange}{Medium}}\) | Python |
17 | 1493 | Longest Subarray of 1's After Deleting One Element | Sliding Window | Array, Binary Search, Sliding Window | Allow at most one zero in window | \(\mathrm{\color{orange}{Medium}}\) | Python |
18 | 1732 | Find the Highest Altitude | Prefix Sum | Array, Prefix Sum | Keep running sum of gains | \(\mathrm{\color{green}{Easy}}\) | Python |
19 | 724 | Find Pivot Index | Prefix Sum | Array, Prefix Sum | Check if left sum equals right sum | \(\mathrm{\color{green}{Easy}}\) | Python |
20 | 2215 | Find the Difference of Two Arrays | Hash Map/Set | Array, Hash Table | Use sets to find unique elements | \(\mathrm{\color{green}{Easy}}\) | Python |
21 | 1207 | Unique Number of Occurrences | Hash Map/Set | Array, Hash Table | Count frequencies, check uniqueness | \(\mathrm{\color{green}{Easy}}\) | Python |
22 | 1657 | Determine if Two Strings Are Close | Hash Map/Set | Hash Table, String, Sorting | Check character sets and frequency patterns | \(\mathrm{\color{orange}{Medium}}\) | Python |
23 | 2352 | Equal Row and Column Pairs | Hash Map/Set | Array, Hash Table, Matrix, Simulation | Convert rows/columns to comparable format | \(\mathrm{\color{orange}{Medium}}\) | Python |
24 | 2390 | Removing Stars From a String | Stack | String, Stack, Simulation | Use stack to handle star removals | \(\mathrm{\color{orange}{Medium}}\) | Python |
25 | 735 | Asteroid Collision | Stack | Array, Stack, Simulation | Simulate collisions with stack | \(\mathrm{\color{orange}{Medium}}\) | Python |
26 | 394 | Decode String | Stack | String, Stack, Recursion | Use stack to handle nested brackets | \(\mathrm{\color{orange}{Medium}}\) | Python |
27 | 933 | Number of Recent Calls | Queue | Design, Queue, Data Stream | Use queue to maintain time window | \(\mathrm{\color{green}{Easy}}\) | Python |
28 | 649 | Dota2 Senate | Queue | String, Greedy, Queue | Use two queues for each party | \(\mathrm{\color{orange}{Medium}}\) | Python |
29 | 2095 | Delete the Middle Node of a Linked List | Linked List | Linked List, Two Pointers | Use slow/fast pointers to find middle | \(\mathrm{\color{orange}{Medium}}\) | C |
30 | 328 | Odd Even Linked List | Linked List | Linked List | Separate odd/even positioned nodes | \(\mathrm{\color{orange}{Medium}}\) | C |
31 | 206 | Reverse Linked List | Linked List | Linked List, Recursion | Use iterative or recursive approach | \(\mathrm{\color{green}{Easy}}\) | C |
32 | 2130 | Maximum Twin Sum of a Linked List | Linked List | Linked List, Two Pointers, Stack | Find middle, reverse second half | \(\mathrm{\color{orange}{Medium}}\) | C |
33 | 104 | Maximum Depth of Binary Tree | Binary Tree - DFS | Tree, DFS, BFS, Binary Tree | Use recursion or level-order traversal | \(\mathrm{\color{green}{Easy}}\) | C |
34 | 872 | Leaf-Similar Trees | Binary Tree - DFS | Tree, DFS, Binary Tree | Compare leaf sequences | \(\mathrm{\color{green}{Easy}}\) | Python |
35 | 1448 | Count Good Nodes in Binary Tree | Binary Tree - DFS | Tree, DFS, Binary Tree | Track maximum value in path | \(\mathrm{\color{orange}{Medium}}\) | C |
36 | 437 | Path Sum III | Binary Tree - DFS | Tree, DFS, Binary Tree | Use prefix sum with DFS | \(\mathrm{\color{orange}{Medium}}\) | C |
37 | 1372 | Longest ZigZag Path in a Binary Tree | Binary Tree - DFS | DP, Tree, DFS, Binary Tree | Track direction and length | \(\mathrm{\color{orange}{Medium}}\) | C |
38 | 236 | Lowest Common Ancestor of a Binary Tree | Binary Tree - DFS | Tree, DFS, Binary Tree | Use recursive search | \(\mathrm{\color{orange}{Medium}}\) | C |
39 | 199 | Binary Tree Right Side View | Binary Tree - BFS | Tree, DFS, BFS, Binary Tree | Use level-order traversal | \(\mathrm{\color{orange}{Medium}}\) | Python |
40 | 1161 | Maximum Level Sum of a Binary Tree | Binary Tree - BFS | Tree, BFS, Binary Tree | Level-order traversal with sum tracking | \(\mathrm{\color{orange}{Medium}}\) | Python |
41 | 700 | Search in a Binary Search Tree | Binary Search Tree | Tree, Binary Search Tree, Binary Tree | Use BST property for efficient search | \(\mathrm{\color{green}{Easy}}\) | C |
42 | 450 | Delete Node in a BST | Binary Search Tree | Tree, Binary Search Tree, Binary Tree | Handle three cases: leaf, one child, two children | \(\mathrm{\color{orange}{Medium}}\) | C |
43 | 841 | Keys and Rooms | Graphs - DFS | DFS, BFS, Graph | Use DFS/BFS to visit all reachable rooms | \(\mathrm{\color{orange}{Medium}}\) | Python |
44 | 547 | Number of Provinces | Graphs - DFS | DFS, BFS, Union Find, Graph | Count connected components | \(\mathrm{\color{orange}{Medium}}\) | Python |
45 | 1466 | Reorder Routes to Make All Paths Lead to the City Zero | Graphs - DFS | DFS, BFS, Graph | Count edges that need to be reversed | \(\mathrm{\color{orange}{Medium}}\) | Python |
46 | 399 | Evaluate Division | Graphs - DFS | Array, DFS, BFS, Union Find, Graph, Shortest Path | Build weighted graph, use DFS for queries | \(\mathrm{\color{orange}{Medium}}\) | Python |
47 | 1926 | Nearest Exit from Entrance in Maze | Graphs - BFS | Array, BFS, Matrix | Use BFS to find shortest path to boundary | \(\mathrm{\color{orange}{Medium}}\) | Python |
48 | 994 | Rotting Oranges | Graphs - BFS | Array, BFS, Matrix | Multi-source BFS simulation | \(\mathrm{\color{orange}{Medium}}\) | Python |
49 | 215 | Kth Largest Element in an Array | Heap/Priority Queue | Array, Divide and Conquer, Sorting, Heap, Quickselect | Use min heap of size k or quickselect | \(\mathrm{\color{orange}{Medium}}\) | Python |
50 | 2336 | Smallest Number in Infinite Set | Heap/Priority Queue | Hash Table, Design, Heap | Use min heap and set for added back numbers | \(\mathrm{\color{orange}{Medium}}\) | Python |
51 | 2542 | Maximum Subsequence Score | Heap/Priority Queue | Array, Greedy, Sorting, Heap | Sort by one criterion, use heap for other | \(\mathrm{\color{orange}{Medium}}\) | Python |
52 | 2462 | Total Cost to Hire K Workers | Heap/Priority Queue | Array, Two Pointers, Simulation, Heap | Use two heaps for candidates from both ends | \(\mathrm{\color{orange}{Medium}}\) | Python |
53 | 374 | Guess Number Higher or Lower | Binary Search | Binary Search, Interactive, Game | Standard binary search template | \(\mathrm{\color{green}{Easy}}\) | Python |
54 | 2300 | Successful Pairs of Spells and Potions | Binary Search | Array, Two Pointers, Binary Search, Sorting | Sort potions, binary search for each spell | \(\mathrm{\color{orange}{Medium}}\) | Python |
55 | 162 | Find Peak Element | Binary Search | Array, Binary Search | Compare with neighbors in binary search | \(\mathrm{\color{orange}{Medium}}\) | Python |
56 | 875 | Koko Eating Bananas | Binary Search | Array, Binary Search | Binary search on eating speed | \(\mathrm{\color{orange}{Medium}}\) | Python |
57 | 17 | Letter Combinations of a Phone Number | Backtracking | Hash Table, String, Backtracking | Use DFS with mapping of digits to letters | \(\mathrm{\color{orange}{Medium}}\) | Python |
58 | 216 | Combination Sum III | Backtracking | Array, Backtracking | Backtrack with sum and count constraints | \(\mathrm{\color{orange}{Medium}}\) | Python |
59 | 1137 | N-th Tribonacci Number | DP - 1D | Math, DP, Memoization | Use iterative DP or memoization | \(\mathrm{\color{green}{Easy}}\) | Python |
60 | 746 | Min Cost Climbing Stairs | DP - 1D | Array, DP | Choose minimum cost path | \(\mathrm{\color{green}{Easy}}\) | Python |
61 | 198 | House Robber | DP - 1D | Array, DP | Track max money without adjacent houses | \(\mathrm{\color{orange}{Medium}}\) | Python |
62 | 790 | Domino and Tromino Tiling | DP - 1D | DP | Consider different tile placements | \(\mathrm{\color{orange}{Medium}}\) | Python |
63 | 62 | Unique Paths | DP - Multidimensional | Math, DP, Combinatorics | Use DP table or combinatorics | \(\mathrm{\color{orange}{Medium}}\) | Python |
64 | 1143 | Longest Common Subsequence | DP - Multidimensional | String, DP | Build 2D DP table | \(\mathrm{\color{orange}{Medium}}\) | Python |
65 | 714 | Best Time to Buy and Sell Stock with Transaction Fee | DP - Multidimensional | Array, DP, Greedy | Track held and sold states | \(\mathrm{\color{orange}{Medium}}\) | Python |
66 | 72 | Edit Distance | DP - Multidimensional | String, DP | Classic edit distance DP | \(\mathrm{\color{orange}{Medium}}\) | Python |
67 | 338 | Counting Bits | Bit Manipulation | DP, Bit Manipulation | Use bit manipulation properties | \(\mathrm{\color{green}{Easy}}\) | Python |
68 | 136 | Single Number | Bit Manipulation | Array, Bit Manipulation | Use XOR properties | \(\mathrm{\color{green}{Easy}}\) | Python |
69 | 1318 | Minimum Flips to Make a OR b Equal to c | Bit Manipulation | Bit Manipulation | Check each bit position | \(\mathrm{\color{orange}{Medium}}\) | C |
70 | 208 | Implement Trie (Prefix Tree) | Trie | Hash Table, String, Design, Trie | Use nested hash maps or array of children | \(\mathrm{\color{orange}{Medium}}\) | Python |
71 | 1268 | Search Suggestions System | Trie | Array, String, Trie | Build trie, then traverse for each prefix | \(\mathrm{\color{orange}{Medium}}\) | Python |
72 | 435 | Non-overlapping Intervals | Intervals | Array, DP, Greedy, Sorting | Sort by end time, greedy selection | \(\mathrm{\color{orange}{Medium}}\) | Python |
73 | 452 | Minimum Number of Arrows to Burst Balloons | Intervals | Array, Greedy, Sorting | Sort intervals, count non-overlapping | \(\mathrm{\color{orange}{Medium}}\) | Python |
74 | 739 | Daily Temperatures | Monotonic Stack | Array, Stack, Monotonic Stack | Use decreasing monotonic stack | \(\mathrm{\color{orange}{Medium}}\) | Python |
75 | 901 | Online Stock Span | Monotonic Stack | Stack, Design, Monotonic Stack, Data Stream | Stack stores (price, span) pairs | \(\mathrm{\color{orange}{Medium}}\) | Python |