Top 50 Easy LeetCode Problems: Ranked, Ordered, and Explained

- Easy LeetCode problems have one purpose: build mechanical vocabulary before mediums, not to train pattern recognition
- Two Sum (#1) introduces the hash map complement lookup that recurs across dozens of harder problems
- Diameter of Binary Tree (#543) teaches the global-max/local-return pattern that drives most hard tree problems
- Word Pattern (#290) is the most underrated: the bidirectional mapping bug trips people on medium and hard problems for years
- Kadane's algorithm (#53) and Boyer-Moore voting (#169) both appear at easy level but transfer directly to medium-level patterns
- Finish a category's easy set, then move to mediums in that same category before exhausting all 50 easies
- Search Insert Position (#35) is the canonical binary search template for writing loop invariants correctly
"Easy" on LeetCode is a relative term. Relative to getting a PhD in algorithms, sure. Relative to an interview where you're nervous and thinking out loud for the first time in your life? Not always.
Easy problems have one job. Build mechanical vocabulary before the real problems start. They're not where you learn pattern recognition, because easy problems announce their pattern in the first sentence of the prompt. What they give you is fluency: the ability to write a hash map lookup, reverse a linked list, or run a clean DFS without stopping to think about what curr.next means.
If you're fumbling with basic pointer manipulation inside a medium problem, you're not solving the medium problem. You're still solving the easy one. These 50 problems fix that.
Who This Is For
Engineers starting prep who want a structured foundation. New grads who learned algorithms in lecture but haven't written much interview code. Career switchers who need fluency fast before moving to mediums.
If you've already solved 100+ problems and mediums feel comfortable, this list isn't for you. You're past this. Go do something else.
Don't Watch Someone Else Solve These
The worst way to use this list is to open a problem, stare at it for three minutes, then pull up a YouTube solution and watch someone explain it. You'll feel like you understood. You didn't. You watched understanding.
Set a 15-minute timer per problem. No tags visible. Write the solution, then look at the optimal version and explicitly name what you missed. For problems you've seen before, close your eyes, recall the core insight, and code from scratch. Recognition is not the same as recall. Interviews test recall.
After finishing a category, move to mediums in that category before working through every easy on this list. Easy problems announce the pattern. Mediums hide it. That gap is the actual skill. Cycle between the two.
Arrays: The Vocabulary Layer
Every other structure eventually gets compared to arrays. Start here. These ten problems cover the moves you'll use in everything else.
| # | Problem | What It Teaches |
|---|---|---|
| 1 | Two Sum | Hash map complement lookup: store what you've seen, check the difference |
| 121 | Best Time to Buy and Sell Stock | Single-pass min tracking: one variable carries the running minimum |
| 217 | Contains Duplicate | Hash set membership: your first explicit O(1) lookup trade |
| 53 | Maximum Subarray | Kadane's algorithm: local vs. global max, DP showing up in array clothing |
| 283 | Move Zeroes | Write-pointer pattern: slow pointer tracks next valid write position |
| 66 | Plus One | Carry propagation right to left: the edge case is all nines |
| 26 | Remove Duplicates from Sorted Array | k-valid-elements pattern: write pointer, everything after is garbage |
| 136 | Single Number | XOR self-cancellation: a ^ a = 0 and a ^ 0 = a, in one pass |
| 268 | Missing Number | Gauss formula vs. XOR: expected sum minus actual, or XOR reduction |
| 169 | Majority Element | Boyer-Moore voting: cancellation proof when majority is guaranteed |
The Two Sum insight carries forward into dozens of problems. Any time you see "find a pair satisfying condition X," ask whether storing complements in a hash map gets you to O(n). It usually does. Building that reflex here pays dividends everywhere else.
Strings: Two Moves Cover Most Problems
Strings are character arrays with an immutability tax. Most string problems reduce to one of two moves: converge from both ends, or count character frequencies. That is genuinely most of them.
| # | Problem | What It Teaches |
|---|---|---|
| 125 | Valid Palindrome | Two pointers with filter: skip non-alphanumeric, converge inward |
| 344 | Reverse String | In-place swap: the simplest converging two-pointer template |
| 242 | Valid Anagram | Frequency count: int[26] beats a hash map on known character sets |
| 387 | First Unique Character | Two-pass hash: count first, scan second |
| 14 | Longest Common Prefix | Vertical scanning: compare column by column, stop on any mismatch |
| 13 | Roman to Integer | Hash map with lookahead: subtract when current value is less than next |
| 392 | Is Subsequence | Greedy two pointer: advance source pointer only on a match |
| 28 | Find the Index of the First Occurrence | Brute-force O(nm) baseline: the problem that makes you appreciate KMP |
Problem 392 is more useful than it looks. The greedy pointer advance is provably correct, and understanding why transfers to interval scheduling and stream matching problems at the medium level.
Linked Lists: Pointers Are Not Optional
Before you touch any linked list problem, you need to be comfortable modifying next pointers without losing track of nodes. If you haven't practiced this, you will drop nodes. Not sometimes. Every time. Practice Reverse Linked List until it takes under two minutes. Everything else here is built on it.
| # | Problem | What It Teaches |
|---|---|---|
| 206 | Reverse Linked List | prev/curr/next iterative reversal: the fundamental pointer manipulation |
| 21 | Merge Two Sorted Lists | Dummy head node: avoids null-checking the head as a special case |
| 141 | Linked List Cycle | Floyd's slow/fast detection: two pointers in the same structure |
| 83 | Remove Duplicates from Sorted List | Skip-ahead pointer: curr.next.val == curr.val, then bypass |
| 234 | Palindrome Linked List | Slow/fast + reverse second half: two techniques combined in one problem |
| 876 | Middle of the Linked List | Slow/fast for midpoint: when fast reaches end, slow is at the middle |
The dummy head node in problem 21 feels unnecessary until you try to write merge without it. Try without it. Then add it back. That five-minute exercise teaches more than any explanation.
Trees: Trust the Recursion
Tree problems teach recursion in a way array problems can't. Each node is a subproblem with the same structure as the whole. The hard part isn't the code. It's believing the recursive call handles the subtree correctly without you tracing every branch yourself.
| # | Problem | What It Teaches |
|---|---|---|
| 104 | Maximum Depth of Binary Tree | First recursive DFS: base case is null, return 1 + max(left, right) |
| 226 | Invert Binary Tree | Swap children recursively: three lines, teaches the trust-the-recursion mindset |
| 101 | Symmetric Tree | Mirror comparison: check outer pairs then inner pairs recursively |
| 100 | Same Tree | Structural equality: null-null match, value match, recurse both sides |
| 112 | Path Sum | Root-to-leaf DFS: carry a running sum, check at every leaf node |
| 110 | Balanced Binary Tree | Height and balance combined: return -1 to propagate imbalance upward |
| 543 | Diameter of Binary Tree | Global max with local return: the pattern behind most tree optimization |
| 872 | Leaf-Similar Trees | DFS leaf collection: extract, collect, then compare outside the recursion |
Problem 543 (Diameter) carries more weight than its difficulty tag suggests. Your recursive function returns one thing to the parent (height) and updates a global maximum for something else (diameter). This exact pattern appears in Maximum Path Sum, Binary Tree Cameras, and a long list of hard tree problems. Learn it here on an easy problem, not there under pressure.
Stack: Two Problems. That's It.
| # | Problem | What It Teaches |
|---|---|---|
| 20 | Valid Parentheses | Push/pop matching: bracket problems, expression validation, nested structures |
| 155 | Min Stack | Auxiliary structure design: shadow stack tracks a running minimum in O(1) |
Valid Parentheses shows up as a warmup in real interviews. If it takes more than five minutes, that's useful information. Not a judgment. Information. Do more stack work before moving on.
Hashing: Spend Space, Save Time
Hash problems build the habit of storing precomputed state to avoid redundant work. That habit transfers to more problems than any single pattern.
| # | Problem | What It Teaches |
|---|---|---|
| 202 | Happy Number | Cycle detection via set: stop when you've seen a state before |
| 383 | Ransom Note | Frequency subtraction: magazine letters fund the ransom letter |
| 349 | Intersection of Two Arrays | Set conversion and intersection: O(n+m) via two sets |
| 290 | Word Pattern | Bidirectional mapping: both directions must map consistently |
Word Pattern (#290) is the most underrated problem on this list. The bidirectional mapping bug trips people on harder problems for years. One-directional mapping looks correct until you hit a test case where two patterns map to the same word, and then you spend twenty minutes in a medium problem wondering why your solution fails. Debug that mistake here, not there.
Dynamic Programming: Five Problems, One Framework
These five problems exist so DP doesn't feel foreign by the time you hit mediums. Each introduces exactly one piece of the framework.
Don't skip Fibonacci because it's trivial. Watching memoization cut O(2^n) to O(n) explicitly is worth five minutes. That moment when the call tree collapses into a straight line is the whole point. It's also the clearest demonstration that caching works.
| # | Problem | What It Teaches |
|---|---|---|
| 509 | Fibonacci Number | Memoization basics: from O(2^n) recursion to O(n) by caching states |
| 70 | Climbing Stairs | Fibonacci disguised as DP: spot the recurrence relation under the story |
| 746 | Min Cost Climbing Stairs | Optimal substructure: dp[i] = min(dp[i-1], dp[i-2]) + cost[i] |
| 198 | House Robber | Skip-one DP: dp[i] = max(dp[i-1], dp[i-2] + nums[i]) |
| 118 | Pascal's Triangle | 2D DP construction: each cell depends on exactly two cells from the row above |
The recurrence patterns here appear repeatedly at the medium level. Solve these until pattern identification is instant, then read Dynamic Programming Is Just Recursion With a Memory to see how they fit together.
Binary Search: One Invariant, Endless Off-by-Ones
Binary search takes ten minutes to learn and years to stop getting wrong at the edges. Not an exaggeration. Joshua Bloch, the author of Effective Java and a former Google engineer, found a binary search bug in Java's standard library that had been sitting there for nine years. The bug was (low + high) / 2 overflowing. In production code. At Google.
| # | Problem | What It Teaches |
|---|---|---|
| 35 | Search Insert Position | Leftmost binary search: where would this element go if absent? |
| 374 | Guess Number Higher or Lower | Binary search on answer space: not an array, just a numerical range |
| 1351 | Count Negative Numbers in Sorted Matrix | Staircase search: start top-right, move left or down |
Search Insert Position (#35) is the canonical binary search template. Get the loop invariant right here and you'll stop writing off-by-one bugs in most future problems. For the full treatment, see Binary Search: One Invariant to Rule the Search Space.
Math and Bit Manipulation: Four Worth Knowing
| # | Problem | What It Teaches |
|---|---|---|
| 7 | Reverse Integer | Overflow detection: check the guard before you multiply, not after |
| 231 | Power of Two | Bit trick: n & (n-1) clears the lowest set bit, result is 0 for powers of 2 |
| 191 | Number of 1 Bits | Popcount via n & (n-1) loop: each iteration clears one set bit |
| 338 | Counting Bits | DP plus bits: dp[i] = dp[i >> 1] + (i & 1) ties two things together |
Counting Bits (#338) connects DP state transitions and bit patterns in a single problem. That combination shows up in bitmask DP at the hard level. One problem, two birds.
What's Next After Easy LeetCode Problems
Don't finish all 50 before touching mediums. Finish a category's easy set, then move to mediums in that same category. Easy problems announced the pattern. Mediums hide it. That gap is what you're actually training for.
If you're finishing mediums but struggling to explain your thinking in real time, the gap isn't more problems. Solving on your couch and explaining under interview pressure are different skills. SpaceComplexity runs realistic DSA mock interviews with real-time feedback on your communication, not just your code. Train both.