The NeetCode 150 · learn it by watching it run
Every problem,running in front of you.
150 problems, each restated in plain words, solved in 6 languages, and drawn step by step as the algorithm runs on its example.
- Problems
- 150
- Patterns
- 18
- Languages
- 6
- Test cases run
- 771
Your progress
Open any problem to begin, and mark it understood when the idea clicks.
Your streak
0Study today to start a streak.
- 2026-09-19: not studied
- 2026-09-20: not studied
- 2026-09-21: not studied
- 2026-09-22: not studied
- 2026-09-23: not studied
- 2026-09-24: not studied
- 2026-09-25: not studied
- 2026-09-26: not studied
- 2026-09-27: not studied
- 2026-09-28: not studied
- 2026-09-29: not studied
- 2026-09-30: not studied
- 2026-10-01: not studied
- 2026-10-02: not studied
Save your progress
Pick up where you left off on any device. No password: sign in with a link we email you, or with Google or GitHub.
or
An account is optional. Without one, your progress is saved in this browser only.
We store your email address and your learning progress — nothing else. No ads, no tracking, never sold. Privacy Policy
18 · Patterns
Patterns
Each pattern is one idea that cracks a family of problems. Learn the idea once; use it everywhere it applies.
- 01Arrays & HashingTrade memory for time: a hash map answers “have I seen this?” in one step instead of a search.9 problems
- 02Two PointersTwo indices walking toward each other (or together) through ordered data, each step ruling out a whole row of possibilities.5 problems
- 03Sliding WindowA stretch of the array that grows at one end and shrinks at the other, so every contiguous stretch is considered without starting over.6 problems
- 04StackLast in, first out: keep the things still waiting to be matched or resolved, and deal with the newest first.7 problems
- 05Binary SearchHalve the possibilities with every question: whenever the answer lies on one side of a line you can test, log n steps find it.7 problems
- 06Linked ListNodes that know only the next one: every trick is about which arrows to redirect, in what order, without losing the rest of the chain.11 problems
- 07TreesA tree is a node and two smaller trees. Solve it for one node, trust the same function on the children, and the whole tree is solved.15 problems
- 08TriesStore words letter by letter down a tree, so every word sharing a beginning shares the path — and a prefix is found in as many steps as it has letters.3 problems
- 09Heap / Priority QueueA heap always knows its smallest (or largest) item, and adding or removing one costs only log n — the tool for “the best k” and “what comes next”.7 problems
- 10BacktrackingBuild an answer one choice at a time; when a choice leads nowhere, undo it and try the next. Every answer is a path through a tree of choices.9 problems
- 11GraphsThings joined to things — cells on a map, courses by their prerequisites, words by one letter. Depth-first goes deep along one path; breadth-first spreads out one ring at a time.13 problems
- 12Advanced GraphsWeighted edges and ordering constraints: shortest paths with Dijkstra and Bellman–Ford, the cheapest network with Prim, and a route that uses every edge once.6 problems
- 131-D Dynamic ProgrammingWhen the answer for n is built from answers for smaller n, compute each one once and keep it. A row of remembered answers, filled in order.12 problems
- 142-D Dynamic ProgrammingTwo things change at once — a position in each of two strings, a row and a column, an index and an amount — so the remembered answers form a table.11 problems
- 15GreedyMake the choice that looks best right now and never revisit it — correct only when you can argue no later step would ever want it undone.8 problems
- 16IntervalsStretches of a line, from a start to an end. Sort them by one end, and overlaps become a question about neighbours.6 problems
- 17Math & GeometryA little arithmetic or a picture of the grid turns a fiddly simulation into a few lines: rotations as flips, powers by squaring, digits by place value.8 problems
- 18Bit ManipulationNumbers are rows of 0s and 1s, and a handful of operations — AND, OR, XOR, shifts — work on every bit at once.7 problems
150 · All problems
All problems
Filter by pattern, difficulty or where you are with it.
- 217Contains DuplicateArrays & HashingEasyNot started
- 242Valid AnagramArrays & HashingEasyNot started
- 1Two SumArrays & HashingEasyNot started
- 49Group AnagramsArrays & HashingMediumNot started
- 347Top K Frequent ElementsArrays & HashingMediumNot started
- 238Product of Array Except SelfArrays & HashingMediumNot started
- 36Valid SudokuArrays & HashingMediumNot started
- 271Encode and Decode StringsArrays & HashingMediumNot started
- 128Longest Consecutive SequenceArrays & HashingMediumNot started
- 125Valid PalindromeTwo PointersEasyNot started
- 167Two Sum II – Input Array Is SortedTwo PointersMediumNot started
- 153SumTwo PointersMediumNot started
- 11Container With Most WaterTwo PointersMediumNot started
- 42Trapping Rain WaterTwo PointersHardNot started
- 121Best Time to Buy and Sell StockSliding WindowEasyNot started
- 3Longest Substring Without Repeating CharactersSliding WindowMediumNot started
- 424Longest Repeating Character ReplacementSliding WindowMediumNot started
- 567Permutation in StringSliding WindowMediumNot started
- 76Minimum Window SubstringSliding WindowHardNot started
- 239Sliding Window MaximumSliding WindowHardNot started
- 20Valid ParenthesesStackEasyNot started
- 155Min StackStackMediumNot started
- 150Evaluate Reverse Polish NotationStackMediumNot started
- 22Generate ParenthesesStackMediumNot started
- 739Daily TemperaturesStackMediumNot started
- 853Car FleetStackMediumNot started
- 84Largest Rectangle in HistogramStackHardNot started
- 704Binary SearchBinary SearchEasyNot started
- 74Search a 2D MatrixBinary SearchMediumNot started
- 875Koko Eating BananasBinary SearchMediumNot started
- 153Find Minimum in Rotated Sorted ArrayBinary SearchMediumNot started
- 33Search in Rotated Sorted ArrayBinary SearchMediumNot started
- 981Time Based Key-Value StoreBinary SearchMediumNot started
- 4Median of Two Sorted ArraysBinary SearchHardNot started
- 206Reverse Linked ListLinked ListEasyNot started
- 21Merge Two Sorted ListsLinked ListEasyNot started
- 143Reorder ListLinked ListMediumNot started
- 19Remove Nth Node From End of ListLinked ListMediumNot started
- 138Copy List with Random PointerLinked ListMediumNot started
- 2Add Two NumbersLinked ListMediumNot started
- 141Linked List CycleLinked ListEasyNot started
- 287Find the Duplicate NumberLinked ListMediumNot started
- 146LRU CacheLinked ListMediumNot started
- 23Merge k Sorted ListsLinked ListHardNot started
- 25Reverse Nodes in k-GroupLinked ListHardNot started
- 226Invert Binary TreeTreesEasyNot started
- 104Maximum Depth of Binary TreeTreesEasyNot started
- 543Diameter of Binary TreeTreesEasyNot started
- 110Balanced Binary TreeTreesEasyNot started
- 100Same TreeTreesEasyNot started
- 572Subtree of Another TreeTreesEasyNot started
- 235Lowest Common Ancestor of a Binary Search TreeTreesMediumNot started
- 102Binary Tree Level Order TraversalTreesMediumNot started
- 199Binary Tree Right Side ViewTreesMediumNot started
- 1448Count Good Nodes in Binary TreeTreesMediumNot started
- 98Validate Binary Search TreeTreesMediumNot started
- 230Kth Smallest Element in a BSTTreesMediumNot started
- 105Construct Binary Tree from Preorder and Inorder TraversalTreesMediumNot started
- 124Binary Tree Maximum Path SumTreesHardNot started
- 297Serialize and Deserialize Binary TreeTreesHardNot started
- 208Implement Trie (Prefix Tree)TriesMediumNot started
- 211Design Add and Search Words Data StructureTriesMediumNot started
- 212Word Search IITriesHardNot started
- 703Kth Largest Element in a StreamHeap / Priority QueueEasyNot started
- 1046Last Stone WeightHeap / Priority QueueEasyNot started
- 973K Closest Points to OriginHeap / Priority QueueMediumNot started
- 215Kth Largest Element in an ArrayHeap / Priority QueueMediumNot started
- 621Task SchedulerHeap / Priority QueueMediumNot started
- 355Design TwitterHeap / Priority QueueMediumNot started
- 295Find Median from Data StreamHeap / Priority QueueHardNot started
- 78SubsetsBacktrackingMediumNot started
- 39Combination SumBacktrackingMediumNot started
- 46PermutationsBacktrackingMediumNot started
- 90Subsets IIBacktrackingMediumNot started
- 40Combination Sum IIBacktrackingMediumNot started
- 79Word SearchBacktrackingMediumNot started
- 131Palindrome PartitioningBacktrackingMediumNot started
- 17Letter Combinations of a Phone NumberBacktrackingMediumNot started
- 51N-QueensBacktrackingHardNot started
- 200Number of IslandsGraphsMediumNot started
- 133Clone GraphGraphsMediumNot started
- 695Max Area of IslandGraphsMediumNot started
- 417Pacific Atlantic Water FlowGraphsMediumNot started
- 130Surrounded RegionsGraphsMediumNot started
- 994Rotting OrangesGraphsMediumNot started
- 286Walls and GatesGraphsMediumNot started
- 207Course ScheduleGraphsMediumNot started
- 210Course Schedule IIGraphsMediumNot started
- 684Redundant ConnectionGraphsMediumNot started
- 323Number of Connected Components in an Undirected GraphGraphsMediumNot started
- 261Graph Valid TreeGraphsMediumNot started
- 127Word LadderGraphsHardNot started
- 332Reconstruct ItineraryAdvanced GraphsHardNot started
- 1584Min Cost to Connect All PointsAdvanced GraphsMediumNot started
- 743Network Delay TimeAdvanced GraphsMediumNot started
- 778Swim in Rising WaterAdvanced GraphsHardNot started
- 269Alien DictionaryAdvanced GraphsHardNot started
- 787Cheapest Flights Within K StopsAdvanced GraphsMediumNot started
- 70Climbing Stairs1-D Dynamic ProgrammingEasyNot started
- 746Min Cost Climbing Stairs1-D Dynamic ProgrammingEasyNot started
- 198House Robber1-D Dynamic ProgrammingMediumNot started
- 213House Robber II1-D Dynamic ProgrammingMediumNot started
- 5Longest Palindromic Substring1-D Dynamic ProgrammingMediumNot started
- 647Palindromic Substrings1-D Dynamic ProgrammingMediumNot started
- 91Decode Ways1-D Dynamic ProgrammingMediumNot started
- 322Coin Change1-D Dynamic ProgrammingMediumNot started
- 152Maximum Product Subarray1-D Dynamic ProgrammingMediumNot started
- 139Word Break1-D Dynamic ProgrammingMediumNot started
- 300Longest Increasing Subsequence1-D Dynamic ProgrammingMediumNot started
- 416Partition Equal Subset Sum1-D Dynamic ProgrammingMediumNot started
- 62Unique Paths2-D Dynamic ProgrammingMediumNot started
- 1143Longest Common Subsequence2-D Dynamic ProgrammingMediumNot started
- 309Best Time to Buy and Sell Stock with Cooldown2-D Dynamic ProgrammingMediumNot started
- 518Coin Change II2-D Dynamic ProgrammingMediumNot started
- 494Target Sum2-D Dynamic ProgrammingMediumNot started
- 97Interleaving String2-D Dynamic ProgrammingMediumNot started
- 329Longest Increasing Path in a Matrix2-D Dynamic ProgrammingHardNot started
- 115Distinct Subsequences2-D Dynamic ProgrammingHardNot started
- 72Edit Distance2-D Dynamic ProgrammingMediumNot started
- 312Burst Balloons2-D Dynamic ProgrammingHardNot started
- 10Regular Expression Matching2-D Dynamic ProgrammingHardNot started
- 53Maximum SubarrayGreedyMediumNot started
- 55Jump GameGreedyMediumNot started
- 45Jump Game IIGreedyMediumNot started
- 134Gas StationGreedyMediumNot started
- 846Hand of StraightsGreedyMediumNot started
- 1899Merge Triplets to Form Target TripletGreedyMediumNot started
- 763Partition LabelsGreedyMediumNot started
- 678Valid Parenthesis StringGreedyMediumNot started
- 57Insert IntervalIntervalsMediumNot started
- 56Merge IntervalsIntervalsMediumNot started
- 435Non-overlapping IntervalsIntervalsMediumNot started
- 252Meeting RoomsIntervalsEasyNot started
- 253Meeting Rooms IIIntervalsMediumNot started
- 1851Minimum Interval to Include Each QueryIntervalsHardNot started
- 48Rotate ImageMath & GeometryMediumNot started
- 54Spiral MatrixMath & GeometryMediumNot started
- 73Set Matrix ZeroesMath & GeometryMediumNot started
- 202Happy NumberMath & GeometryEasyNot started
- 66Plus OneMath & GeometryEasyNot started
- 50Pow(x, n)Math & GeometryMediumNot started
- 43Multiply StringsMath & GeometryMediumNot started
- 2013Detect SquaresMath & GeometryMediumNot started
- 136Single NumberBit ManipulationEasyNot started
- 191Number of 1 BitsBit ManipulationEasyNot started
- 338Counting BitsBit ManipulationEasyNot started
- 190Reverse BitsBit ManipulationEasyNot started
- 268Missing NumberBit ManipulationEasyNot started
- 371Sum of Two IntegersBit ManipulationMediumNot started
- 7Reverse IntegerBit ManipulationMediumNot started