223 interview problems,
step by step.
Every problem from NeetCode 150 and LeetCode's Top Interview 150, grouped by pattern. Each one is solved up to two ways in Python, Java and C++, with an animated walkthrough of the example input that shows how every variable changes, plus the time and space complexity.
Arrays & Hashing
31 animated solutionsContains Duplicate
Contains Duplicate II
Find the Index of the First Occurrence in a String
Isomorphic Strings
Length of Last Word
Longest Common Prefix
Majority Element
Merge Sorted Array
Ransom Note
Remove Duplicates from Sorted Array
Remove Element
Roman to Integer
Two Sum
Valid Anagram
Word Pattern
Best Time to Buy and Sell Stock II
Encode and Decode Strings
Group Anagrams
H-Index
Insert Delete GetRandom O(1)
Integer to Roman
Longest Consecutive Sequence
Product of Array Except Self
Remove Duplicates from Sorted Array II
Reverse Words in a String
Rotate Array
Top K Frequent Elements
Valid Sudoku
Zigzag Conversion
Candy
Text Justification
Two Pointers
6 animated solutionsSliding Window
8 animated solutionsStack
9 animated solutionsBinary Search
10 animated solutionsLinked List
16 animated solutionsLinked List Cycle
Merge Two Sorted Lists
Reverse Linked List
Add Two Numbers
Copy List With Random Pointer
Find The Duplicate Number
LRU Cache
Partition List
Remove Duplicates from Sorted List II
Remove Nth Node From End of List
Reorder List
Reverse Linked List II
Rotate List
Sort List
Merge K Sorted Lists
Reverse Nodes In K Group
Trees
29 animated solutionsAverage of Levels in Binary Tree
Balanced Binary Tree
Convert Sorted Array to Binary Search Tree
Diameter of Binary Tree
Invert Binary Tree
Maximum Depth of Binary Tree
Minimum Absolute Difference in BST
Path Sum
Same Tree
Subtree of Another Tree
Symmetric Tree
Binary Search Tree Iterator
Binary Tree Level Order Traversal
Binary Tree Right Side View
Binary Tree Zigzag Level Order Traversal
Construct Binary Tree From Preorder And Inorder Traversal
Construct Binary Tree from Inorder and Postorder Traversal
Construct Quad Tree
Count Complete Tree Nodes
Count Good Nodes In Binary Tree
Flatten Binary Tree to Linked List
Kth Smallest Element In a Bst
Lowest Common Ancestor of a Binary Search Tree
Lowest Common Ancestor of a Binary Tree
Populating Next Right Pointers in Each Node II
Sum Root to Leaf Numbers
Validate Binary Search Tree
Binary Tree Maximum Path Sum
Serialize And Deserialize Binary Tree
Tries
3 animated solutionsHeap / Priority Queue
9 animated solutionsBacktracking
11 animated solutionsGraphs
16 animated solutionsClone Graph
Course Schedule
Course Schedule II
Evaluate Division
Graph Valid Tree
Max Area of Island
Minimum Genetic Mutation
Number of Connected Components In An Undirected Graph
Number of Islands
Pacific Atlantic Water Flow
Redundant Connection
Rotting Oranges
Snakes and Ladders
Surrounded Regions
Walls And Gates
Word Ladder
Advanced Graphs
6 animated solutions1-D Dynamic Programming
12 animated solutions2-D Dynamic Programming
17 animated solutionsBest Time to Buy And Sell Stock With Cooldown
Coin Change II
Edit Distance
Interleaving String
Longest Common Subsequence
Maximal Square
Minimum Path Sum
Target Sum
Triangle
Unique Paths
Unique Paths II
Best Time to Buy and Sell Stock III
Best Time to Buy and Sell Stock IV
Burst Balloons
Distinct Subsequences
Longest Increasing Path In a Matrix
Regular Expression Matching