A pattern-first, beginner-friendly guide to 100 LeetCode problems from Easy to Medium. Every problem is taught the same way: Intuition -> Pseudocode -> Java -> Complexity -> Dry-run. The goal is not to memorize 100 answers. It is to learn ~16 reusable patterns so any new problem becomes recognizable.
Verified: 100/100 problems compile and pass all tests (679 test cases total). Run
javac Solution.java SolutionTest.java && java SolutionTestinside any problem folder.
Full curriculum table: PROBLEM-MAP.md.
Most beginners fail LeetCode for one reason: they treat every problem as a brand-new puzzle. Experienced solvers do the opposite – they map a problem onto a known pattern in seconds, then write code. This book teaches that mapping explicitly.
The structure is borrowed from the proven NeetCode 150 / Blind 75 roadmap, expanded to exactly 100 problems organized into 16 patterns, ordered easiest-first.
README.md first (it explains when the pattern applies and gives a template).The rule: never read the Java before you understand the pseudocode. Pseudocode is the bridge between human thinking and machine code. Skipping it is why beginners get stuck memorizing syntax instead of learning patterns. Each pattern’s README also ends with a Pattern Mastery Quiz – treat it as the gate before moving to the next pattern. Quiz answers are collapsible: attempt first, then reveal.
| # | Pattern | Problems | Difficulty ramp | What you learn |
|---|---|---|---|---|
| 1 | Arrays & Hashing | 8 | Easy | Sets, maps, counting |
| 2 | Two Pointers | 6 | Easy->Med | In-place array ops |
| 3 | Sliding Window | 6 | Easy->Med | Range queries |
| 4 | Stack | 5 | Easy->Med | LIFO, monotonic stack |
| 5 | Binary Search | 7 | Easy->Med | O(log n) on sorted data |
| 6 | Linked List | 7 | Easy->Med | Pointer manipulation |
| 7 | Trees | 9 | Easy->Med | Recursion, BFS/DFS |
| 8 | Tries | 4 | Med | Prefix trees |
| 9 | Heap / Priority Queue | 5 | Easy->Med | Top-K, scheduling |
| 10 | Backtracking | 6 | Med | Permutations, subsets |
| 11 | Graphs | 9 | Easy->Med | BFS, DFS, union-find |
| 12 | Greedy | 6 | Easy->Med | Local optimal -> global |
| 13 | Intervals | 4 | Med | Merge, sweep |
| 14 | 1-D Dynamic Programming | 8 | Easy->Med | Memoization, tabulation |
| 15 | 2-D Dynamic Programming | 7 | Med | Grid + string DP |
| 16 | Bit Manipulation | 3 | Easy->Med | XOR, masks |
Total: 100 problems across 16 patterns.
leetcode-textbook/
+- README.md <- you are here
+- 00-how-to-use-this-book.md
+- 01-patterns-overview.md
+- 02-complexity-cheatsheet.md
+- 03-java-crash-course.md
+- patterns/
| +- 01-arrays-hashing/
| | +- README.md <- pattern intro + template
| | +- 217-contains-duplicate/
| | | +- README.md <- problem + pseudocode + walkthrough
| | | +- Solution.java
| | | +- SolutionTest.java
| | +- 242-valid-anagram/
| | +- ...
| +- 02-two-pointers/
| +- ...
+- docs/
+- changelog-2026-07-05.md
Every problem folder is self-contained: read README.md, open Solution.java,
run SolutionTest.java to verify.
Each SolutionTest.java uses a plain main method (no JUnit dependency needed).
From inside any problem folder:
javac Solution.java SolutionTest.java && java SolutionTest
If you see All tests passed. the solution is correct on the included cases.
Java 11+ is required (javac -version to check).
This book goes Easy -> Medium. It deliberately excludes Hard problems because:
Once you finish this book, the standard next step is the NeetCode 150 Hard problems or LeetCode 75.
Curriculum structure adapted from NeetCode (neetcode.io) and the Blind 75 list. All solutions, pseudocode, and teaching notes written fresh for this book.
Built July 2026.