- π© Easy: 63 / 109
- π¨ Medium: 50 / 290
- π₯ Hard: 0 / 52
- Arrays & Hashing (30/58)
- Two Pointers (11/18)
- Sliding Window (7/15)
- Stack (13/19)
- Binary Search (8/24)
- Linked List (2/29)
- Trees (0/42)
- Tries (2/4)
- Heap / Priority Queue (0/17)
- Backtracking (9/18)
- Graphs (1/39)
- Advanced Graphs (0/11)
- 1-D Dynamic Programming (4/36)
- 2-D Dynamic Programming (3/26)
- Greedy (11/18)
- Intervals (5/8)
- Math & Geometry (4/22)
- Bit Manipulation (2/11)
- JavaScript (0/30)
This repository contains solutions to the NeetCode 450+ problem set, a carefully curated list of LeetCode problems designed to help you master coding interviews. Problems are organized by topic and difficulty level.
- Clone this repository
- Pick a topic from the Table of Contents
- Solve problems in order of difficulty (Easy β Medium β Hard)
- Mark your progress in the tracking section
View Problems (58)
- π© Contains Duplicate
- π© Valid Anagram
- π© Two Sum
- π© Concatenation of Array
- π© Replace Elements With Greatest Element On Right Side
- π© Is Subsequence
- π© Length of Last Word
- π© Longest Common Prefix
- π© Pascals Triangle
- π© Remove Element
- π© Unique Email Addresses
- π© Isomorphic Strings
- π© Can Place Flowers
- π© Majority Element
- π© Next Greater Element I
- π© Find Pivot Index
- π© Range Sum Query - Immutable
- π© Find All Numbers Disappeared in An Array
- π© Maximum Number of Balloons
- π© Word Pattern
- π© Design HashSet
- π© Design HashMap
- π© Find The Index of The First Occurrence in a String
- π© Sign of An Array
- π© Find the Difference of Two Arrays
- π© Design Parking System
- π¨ Group Anagrams
- π¨ Sort an Array
- π¨ Top K Frequent Elements
- π¨ Product of Array Except Self
- π¨ Valid Sudoku
- π¨ Encode and Decode Strings
- π¨ Longest Consecutive Sequence
- π¨ Sort Colors
- π¨ Encode and Decode TinyURL
- π¨ Brick Wall
- π¨ Best Time to Buy And Sell Stock II
- π¨ Subarray Sum Equals K
- π¨ Unique Length 3 Palindromic Subsequences
- π¨ Minimum Number of Swaps to Make The String Balanced
- π¨ Number of Pairs of Interchangeable Rectangles
- π¨ Maximum Product of The Length of Two Palindromic Subsequences
- π¨ Grid Game
- π¨ Find All Anagrams in a String
- π¨ Wiggle Sort
- π¨ Largest Number
- π¨ Continuous Subarray Sum
- π¨ Push Dominoes
- π¨ Repeated DNA Sequences
- π¨ Insert Delete Get Random O(1)
- π¨ Check if a String Contains all Binary Codes of Size K
- π¨ Range Sum Query 2D Immutable
- π¨ Non Decreasing Array
- π¨ Number of Zero-Filled Subarrays
- π¨ Optimal Partition of String
- π¨ Design Underground System
- π¨ Minimum Penalty for a Shop
- π₯ First Missing Positive
- π₯ Text Justification
- π₯ Naming a Company
View Problems (18)
- π© Valid Palindrome
- π© Valid Palindrome II
- π© Minimum Difference Between Highest And Lowest of K Scores
- π© Merge Strings Alternately
- π© Reverse String
- π© Merge Sorted Array
- π© Move Zeroes
- π© Remove Duplicates From Sorted Array
- π¨ Remove Duplicates From Sorted Array II
- π¨ Two Sum II Input Array Is Sorted
- π¨ 3Sum
- π¨ 4Sum
- π¨ Container With Most Water
- π¨ Number of Subsequences That Satisfy The Given Sum Condition
- π¨ Rotate Array
- π¨ Array With Elements Not Equal to Average of Neighbors
- π¨ Boats to Save People
- π₯ Trapping Rain Water
View Problems (15)
- π¨ Number of Sub Arrays of Size K and Avg Greater than or Equal to Threshold
- π¨ Longest Substring Without Repeating Characters
- π¨ Longest Repeating Character Replacement
- π¨ Permutation In String
- π¨ Frequency of The Most Frequent Element
- π¨ Fruits into Basket
- π¨ Maximum Number of Vowels in a Substring of Given Length
- π¨ Minimum Number of Flips to Make The Binary String Alternating
- π¨ Minimum Size Subarray Sum
- π¨ Find K Closest Elements
- π¨ Minimum Operations to Reduce X to Zero
View Problems (19)
- π© Valid Parentheses
- π© Baseball Game
- π© Implement Stack Using Queues
- π¨ Min Stack
- π¨ Evaluate Reverse Polish Notation
- π¨ Removing Stars From a String
- π¨ Validate Stack Sequences
- π¨ Generate Parentheses
- π¨ Asteroid Collision
- π¨ Daily Temperatures
- π¨ Online Stock Span
- π¨ Car Fleet
- π¨ Simplify Path
- π¨ Decode String
- π¨ Remove K Digits
- π¨ Remove All Adjacent Duplicates In String II
- π¨ 132 Pattern
View Problems (24)
- π© Binary Search
- π© Search Insert Position
- π© Guess Number Higher Or Lower
- π© Arranging Coins
- π© Squares of a Sorted Array
- π© Valid Perfect Square
- π© Sqrt(x)
- π¨ Single Element in a Sorted Array
- π¨ Capacity to Ship Packages
- π¨ Find Peak Element
- π¨ Successful Pairs of Spells and Potions
- π¨ Search a 2D Matrix
- π¨ Koko Eating Bananas
- π¨ Minimize the Maximum Difference of Pairs
- π¨ Find Minimum In Rotated Sorted Array
- π¨ Search In Rotated Sorted Array
- π¨ Search In Rotated Sorted Array II
- π¨ Time Based Key Value Store
- π¨ Find First And Last Position of Element In Sorted Array
- π¨ Maximum Number of Removable Characters
- π¨ Populating Next Right Pointers In Each Node
- π¨ Search Suggestions System
View Problems (29)
- π© Reverse Linked List
- π© Merge Two Sorted Lists
- π© Palindrome Linked List
- π© Remove Linked List Elements
- π© Remove Duplicates From Sorted List
- π© Middle of the Linked List
- π© Intersection of Two Linked Lists
- π© Linked List Cycle
- π¨ Reorder List
- π¨ Maximum Twin Sum Of A Linked List
- π¨ Remove Nth Node From End of List
- π¨ Swapping Nodes in a Linked List
- π¨ Copy List With Random Pointer
- π¨ Design Linked List
- π¨ Design Browser History
- π¨ Add Two Numbers
- π¨ Find The Duplicate Number
- π¨ Swap Nodes In Pairs
- π¨ Sort List
- π¨ Partition List
- π¨ Rotate List
- π¨ Reverse Linked List II
- π¨ Design Circular Queue
- π¨ Insertion Sort List
- π¨ Split Linked List in Parts
- π¨ LRU Cache
- π₯ LFU Cache
- π₯ Merge K Sorted Lists
- π₯ Reverse Nodes In K Group
View Problems (42)
- π© Binary Tree Inorder Traversal
- π© Binary Tree Preorder Traversal
- π© Binary Tree Postorder Traversal
- π© Invert Binary Tree
- π© Maximum Depth of Binary Tree
- π© Diameter of Binary Tree
- π© Balanced Binary Tree
- π© Same Tree
- π© Subtree of Another Tree
- π© Convert Sorted Array to Binary Search Tree
- π© Merge Two Binary Trees
- π© Path Sum
- π© Construct String From Binary Tree
- π© Minimum Distance between BST Nodes
- π© Symmetric Tree
- π¨ Lowest Common Ancestor of a Binary Search Tree
- π¨ Insert into a Binary Search Tree
- π¨ Delete Node in a BST
- π¨ Binary Tree Level Order Traversal
- π¨ Binary Tree Right Side View
- π¨ Minimum Time to Collect All Apples in a Tree
- π¨ Binary Tree Zigzag Level Order Traversal
- π¨ Construct Quad Tree
- π¨ Find Duplicate Subtrees
- π¨ Check Completeness of a Binary Tree
- π¨ Construct Binary Tree from Inorder and Postorder Traversal
- π¨ Maximum Width of Binary Tree
- π¨ Time Needed to Inform All Employees
- π¨ Count Good Nodes In Binary Tree
- π¨ Validate Binary Search Tree
- π¨ Kth Smallest Element In a Bst
- π¨ Construct Binary Tree From Preorder And Inorder Traversal
- π¨ Unique Binary Search Trees
- π¨ Unique Binary Search Trees II
- π¨ Sum Root to Leaf Numbers
- π¨ House Robber III
- π¨ Flip Equivalent Binary Trees
- π¨ Operations On Tree
- π¨ All Possible Full Binary Trees
- π¨ Find Bottom Left Tree Value
- π¨ Trim a Binary Search Tree
- π¨ Binary Search Tree Iterator
- π¨ Convert Bst to Greater Tree
View Problems (4)
- π¨ Implement Trie Prefix Tree
- π¨ Design Add And Search Words Data Structure
- π¨ Extra Characters in a String
- π₯ Word Search II
View Problems (17)
- π¨ K Closest Points to Origin
- π¨ Kth Largest Element In An Array
- π¨ Task Scheduler
- π¨ Design Twitter
- π¨ Single Threaded Cpu
- π¨ Seat Reservation Manager
- π¨ Process Tasks Using Servers
- π¨ Find The Kth Largest Integer In The Array
- π¨ Reorganize String
- π¨ Longest Happy String
- π¨ Car Pooling
- π¨ Maximum Subsequence Score
- π₯ Minimize Deviation in Array
- π₯ Find Median From Data Stream
- π₯ Maximum Performance of a Team
- π₯ IPO
View Problems (18)
- π¨ Subsets
- π¨ Combination Sum
- π¨ Combinations
- π¨ Permutations
- π¨ Subsets II
- π¨ Combination Sum II
- π¨ Permutations II
- π¨ Word Search
- π¨ Palindrome Partitioning
- π¨ Restore IP Addresses
- π¨ Letter Combinations of a Phone Number
- π¨ Matchsticks to Square
- π¨ Splitting a String Into Descending Consecutive Values
- π¨ Find Unique Binary String
- π¨ Maximum Length of a Concatenated String With Unique Characters
- π¨ Partition to K Equal Sum Subsets
- π₯ N Queens
- π₯ N Queens II
View Problems (39)
- π¨ Number of Islands
- π¨ Clone Graph
- π¨ Max Area of Island
- π¨ Count Sub Islands
- π¨ Pacific Atlantic Water Flow
- π¨ Surrounded Regions
- π¨ Reorder Routes to Make All Paths Lead to The City Zero
- π¨ Rotting Oranges
- π¨ Walls And Gates
- π¨ Snakes And Ladders
- π¨ Open The Lock
- π¨ Find Eventual Safe States
- π¨ Course Schedule
- π¨ Course Schedule II
- π¨ Course Schedule IV
- π¨ Check if Move Is Legal
- π¨ Shortest Bridge
- π¨ Shortest Path in Binary Matrix
- π¨ Redundant Connection
- π¨ Number of Connected Components In An Undirected Graph
- π¨ Graph Valid Tree
- π¨ Accounts Merge
- π¨ Find Closest Node to Given Two Nodes
- π¨ As Far from Land as Possible
- π¨ Shortest Path with Alternating Colors
- π¨ Minimum Fuel Cost to Report to the Capital
- π¨ Minimum Score of a Path Between Two Cities
- π¨ Number of Closed Islands
- π¨ Number of Enclaves
- π¨ Minimum Number of Vertices to Reach all Nodes
- π¨ Is Graph Bipartite?
- π¨ Evaluate Division
- π¨ Detonate the Maximum Bombs
View Problems (11)
View Problems (36)
- π© Climbing Stairs
- π© Min Cost Climbing Stairs
- π© N-th Tribonacci Number
- π¨ House Robber
- π¨ House Robber II
- π¨ Longest Palindromic Substring
- π¨ Palindromic Substrings
- π¨ Decode Ways
- π¨ Coin Change
- π¨ Maximum Product Subarray
- π¨ Word Break
- π¨ Longest Increasing Subsequence
- π¨ Partition Equal Subset Sum
- π¨ Triangle
- π¨ Delete And Earn
- π¨ Paint House
- π¨ Combination Sum IV
- π¨ Perfect Squares
- π¨ Check if There is a Valid Partition For The Array
- π¨ Maximum Subarray Min Product
- π¨ Minimum Cost For Tickets
- π¨ Integer Break
- π¨ Number of Longest Increasing Subsequence
- π¨ Uncrossed Lines
- π¨ Solving Questions With Brainpower
- π¨ Count Ways to Build Good Strings
- π¨ New 21 Game
- π¨ Best Team with no Conflicts
View Problems (26)
- π¨ Unique Paths
- π¨ Unique Paths II
- π¨ Longest Common Subsequence
- π¨ Longest Palindromic Subsequence
- π¨ Last Stone Weight II
- π¨ Best Time to Buy And Sell Stock With Cooldown
- π¨ Coin Change II
- π¨ Target Sum
- π¨ Interleaving String
- π¨ Stone Game
- π¨ Minimum Path Sum
- π¨ Maximal Square
- π¨ Ones and Zeroes
- π¨ Maximum Alternating Subsequence Sum
- π¨ Edit Distance
- π¨ Stone Game II
- π¨ Flip String to Monotone Increasing
- π₯ Longest Increasing Path In a Matrix
- π₯ Distinct Subsequences
- π₯ Count Vowels Permutation
- π₯ Burst Balloons
- π₯ Number of Ways to Rearrange Sticks With K Sticks Visible
- π₯ Regular Expression Matching
- π₯ Maximum Value of K Coins from Piles
- π₯ Number of Music Playlists
- π₯ Number of Ways to Form a Target String Given a Dictionary
- π₯ Profitable Schemes
- π₯ Minimum Cost to Cut a Stick
View Problems (18)
- π¨ Maximum Subarray
- π¨ Maximum Sum Circular Subarray
- π¨ Longest Turbulent Array
- π¨ Jump Game
- π¨ Jump Game II
- π¨ Jump Game VII
- π¨ Gas Station
- π¨ Hand of Straights
- π¨ Minimize Maximum of Array
- π¨ Dota2 Senate
- π¨ Maximum Points You Can Obtain From Cards
- π¨ Merge Triplets to Form Target Triplet
- π¨ Partition Labels
- π¨ Valid Parenthesis String
- π¨ Eliminate Maximum Number of Monsters
- π¨ Two City Scheduling
- π¨ Maximum Length of Pair Chain
- π¨ Minimum Deletions to Make Character Frequencies Unique
- π₯ Candy
View Problems (8)
- π© Meeting Rooms
- π¨ Insert Interval
- π¨ Merge Intervals
- π¨ Non Overlapping Intervals
- π¨ Meeting Rooms II
- π¨ Remove Covered Intervals
View Problems (22)
- π© Excel Sheet Column Title
- π© Greatest Common Divisor of Strings
- π© Count Odd Numbers in an Interval Range
- π© Matrix Diagonal Sum
- π© Happy Number
- π© Plus One
- π© Palindrome Number
- π© Ugly Number
- π© Shift 2D Grid
- π© Roman to Integer
- π¨ Rotate Image
- π¨ Spiral Matrix
- π¨ Spiral Matrix II
- π¨ Set Matrix Zeroes
- π¨ Integer to Roman
- π¨ Pow(x, n)
- π¨ Multiply Strings
- π¨ Detect Squares
- π¨ Robot Bounded In Circle
- π¨ Zigzag Conversion
- π¨ Find Missing Observations
View Problems (11)
- π© Single Number
- π© Number of 1 Bits
- π© Counting Bits
- π© Reverse Bits
- π© Missing Number
- π© Shuffle the Array
- π© Add to Array-Form of Integer
- π© Add Binary
- π¨ Sum of Two Integers
- π¨ Reverse Integer
View Problems (30)
- π© Create Hello World Function
- π© Counter
- π© Counter II
- π© Apply Transform over each Element in Array
- π© Filter Elements from Array
- π© Array Reduce Transformation
- π© Function Composition
- π© Allow One Function Call
- π© Sleep
- π© Array Prototype Last
- π© Chunk Array
- π© Array Wrapper
- π© Generate Fibonacci Sequence
- π© Promise Time Limit
- π¨ Memoize
- π¨ Curry
- π¨ Promise Pool
- π¨ Cache With Time Limit
- π¨ Debounce
- π¨ Throttle
- π¨ JSON Deep Equal
- π¨ Convert Object to JSON String
- π¨ Array of Objects to Matrix
- π¨ Difference Between Two Objects
- π¨ Flatten Deeply Nested Array
- π¨ Group By
- π¨ Check if Object Instance of Class
- π¨ Call Function with Custom Context
- π¨ Event Emitter
- π¨ Nested Array Generator