My solutions to the NeetCode 150 problem set, written in Python. This is a pinned repo I actively update as I work through the roadmap.
83 / 150 solved
| Category | Solved | Problems |
|---|---|---|
| Arrays & Hashing | 9/9 | Contains Duplicate, Valid Anagram, Two Sum, Group Anagrams, Top K Frequent Elements, Encode and Decode Strings, Product of Array Except Self, Valid Sudoku, Longest Consecutive Sequence |
| Two Pointers | 5/5 | Valid Palindrome, Two Sum II, 3Sum, Container With Most Water, Trapping Rain Water |
| Sliding Window | 5/6 | Best Time to Buy and Sell Stock, Longest Substring Without Repeating Characters, Longest Repeating Character Replacement, Permutation in String, Minimum Window Substring |
| Stack | 6/6 | Valid Parentheses, Min Stack, Evaluate Reverse Polish Notation, Daily Temperatures, Car Fleet, Largest Rectangle in Histogram |
| Binary Search | 6/7 | Binary Search, Search a 2D Matrix, Koko Eating Bananas, Find Minimum in Rotated Sorted Array, Search in Rotated Sorted Array, Time Based Key-Value Store |
| Linked List | 10/11 | Reverse Linked List, Merge Two Sorted Lists, Reorder List, Remove Nth Node From End of List, Linked List Cycle, LRU Cache, Add Two Numbers, Find the Duplicate Number, Copy List With Random Pointer, Merge K Sorted Lists |
| Trees | 13/15 | Invert Binary Tree, Maximum Depth of Binary Tree, Diameter of Binary Tree, Balanced Binary Tree, Same Tree, Subtree of Another Tree, LCA of a BST, Binary Tree Level Order Traversal, Binary Tree Right Side View, Count Good Nodes, Validate BST, Kth Smallest in BST, Construct Tree from Preorder and Inorder |
| Heap / Priority Queue | 5/7 | Kth Largest Element in a Stream, Last Stone Weight, K Closest Points to Origin, Kth Largest Element in an Array, Task Scheduler |
| Backtracking | 9/10 | Subsets, Combination Sum, Combination Sum II, Permutations, Subsets II, Generate Parentheses, Word Search, Palindrome Partitioning, Letter Combinations of a Phone Number |
| Tries | 0/3 | — |
| Graphs | 12/13 | Number of Islands, Max Area of Island, Clone Graph, Walls and Gates, Rotting Oranges, Pacific Atlantic Water Flow, Surrounded Regions, Course Schedule, Course Schedule II, Graph Valid Tree, Number of Connected Components in an Undirected Graph, Redundant Connection |
| Advanced Graphs | 0/6 | — |
| 1-D Dynamic Programming | 4/12 | Climbing Stairs, Min Cost Climbing Stairs, House Robber, House Robber II |
| 2-D Dynamic Programming | 0/11 | — |
| Greedy | 0/8 | — |
| Intervals | 0/6 | — |
| Math & Geometry | 0/8 | — |
| Bit Manipulation | 0/7 | — |
Each folder maps to a NeetCode roadmap category. Each problem lives in its own subfolder with a solution.py.
neetcode-150/
├── Arrays-and-Hashing/
│ ├── two-sum/
│ │ └── solution.py
│ └── ...
├── Binary-Search/
├── Linked-List/
├── Sliding-Window/
├── Stack/
├── Trees/
├── Heap-Priority-Queue/
└── Two-Pointers/
- Language: Python 3
- Problems sourced from LeetCode, organized via the NeetCode roadmap