This repository contains my personal solutions to the NeetCode 250 challenge โ a curated list of essential coding problems to build strong data structures and algorithms skills. Each solution is written in JavaScript with clear code and optimal approaches.
| Difficulty | Problem | Solution |
|---|---|---|
| Easy | Concatenation of Array | Link |
| Easy | Contains Duplicate | Link |
| Easy | Valid Anagram | Link |
| Easy | Two Sum | Link |
| Easy | Longest Common Prefix | Link |
| Medium | Group Anagrams | Link |
| Easy | Remove Element | Link |
| Easy | Majority Element | Link |
| Easy | Design Hashset | Link |
| Easy | Design HashMap | Link |
| Medium | Sort An Array | Link |
| Medium | Sort Colors | Link |
| Medium | Top K Frequent Elements | Link |
| Medium | Encode and Decode Strings | Link |
| Medium | Range Sum Query 2D Immutable | Link |
| Medium | Products of Array Except Self | Link |
| Medium | Valid Sudoku | Link |
| Medium | Longest Consecutive Sequence | Link |
| Medium | Best Time to Buy and Sell Stock II | Link |
| Medium | Majority Element II | Link |
| Medium | Subarray Sum Equals K | Link |
| Hard | First Missing Positive | Link |
| Difficulty | Problem | Solution |
|---|---|---|
| Easy | Reverse String | Link |
| Easy | Valid Palindrome | Link |
| Easy | Valid Palindrome II | Link |
| Easy | Merge Strings Alternately | Link |
| Easy | Merge Sorted Array | Link |
| Easy | Remove Duplicates From Sorted Array | Link |
| Medium | Two Integer Sum II | Link |
| Medium | 3Sum | Link |
| Medium | 4Sum | Link |
| Medium | Rotate Array | Link |
| Medium | Container With Most Water | Link |
| Medium | Boats to Save People | Link |
| Hard | Trapping Rain Water | Link |
| Difficulty | Problem | Solution |
|---|---|---|
| Easy | Contains Duplicate II | Link |
| Easy | Best Time to Buy and Sell Stock | Link |
| Medium | Longest Substring Without Repeating Characters | Link |
| Medium | Longest Repeating Character Replacement | Link |
| Medium | Permutation in String | Link |
| Medium | Minimum Size Subarray Sum | Link |
| Medium | Find K Closest Elements | Link |
| Hard | Minimum Window Substring | Link |
| Difficulty | Problem | Solution |
|---|---|---|
| Easy | Baseball Game | Link |
| Easy | Valid Parentheses | Link |
| Easy | Implement Stack Using Queues | Link |
| Easy | Implement Queue using Stacks | Link |
| Medium | Minimum Stack | Link |
| Medium | Evaluate Reverse Polish Notation | Link |
| Medium | Generate Parentheses | Link |
| Medium | Asteroid Collision | Link |
| Medium | Daily Temperatures | Link |
| Medium | Online Stock Span | Link |
| Medium | Car Fleet | Link |
| Medium | Simplify Path | Link |
| Medium | Decode String | Link |
| Hard | Maximum Frequency Stack | Link |
| Hard | Largest Rectangle In Histogram | Link |
| Difficulty | Problem | Solution |
|---|---|---|
| Easy | Binary Search | Link |
| Easy | Search Insert Position | Link |
| Easy | Guess Number Higher Or Lower | Link |
| Easy | Sqrt(x) | Link |
| Medium | Search a 2D Matrix | Link |
| Medium | Koko Eating Bananas | Link |
| Medium | Capacity to Ship Packages Within D Days | Link |
| Medium | Find Minimum in Rotated Sorted Array | Link |
| Medium | Search in Rotated Sorted Array | Link |
| Medium | Search in Rotated Sorted Array II | Link |
| Medium | Time Based Key-Value Store | Link |
| Hard | Split Array Largest Sum | Link |
| Hard | Find in Mountain Array | Link |
| Difficulty | Problem | Solution |
|---|---|---|
| Easy | Reverse Linked List | Link |
| Easy | Merge Two Sorted Linked Lists | Link |
| Easy | Linked List Cycle Detection | Link |
| Medium | Reorder Linked List | Link |
| Medium | Remove Node From End of Linked List | Link |
| Medium | Copy Linked List with Random Pointer | Link |
| Medium | Add Two Numbers | Link |
| Medium | Find the Duplicate Number | Link |
| Medium | Reverse Linked List II | Link |
| Medium | Design Circular Queue | Link |
| Medium | LRU Cache | Link |
| Difficulty | Problem | Solution |
|---|---|---|
| Easy | Binary Tree Inorder Traversal | Link |
| Easy | Binary Tree Preorder Traversal | Link |
| Easy | Binary Tree Postorder Traversal | Link |
| Easy | Invert Binary Tree | Link |
| Easy | Maximum Depth of Binary Tree | Link |
| Easy | Diameter of Binary Tree | Link |
| Easy | Balanced Binary Tree | Link |
| Easy | Same Binary Tree | Link |
| Easy | Subtree of Another Tree | Link |
| Medium | Lowest Common Ancestor in Binary Search Tree | Link |
| Medium | Insert into a Binary Search Tree | Link |
| Medium | Delete Node in a BST | Link |
| Medium | Binary Tree Level Order Traversal | Link |
| Medium | Binary Tree Right Side View | Link |
| Medium | Construct Quad Tree | Link |
| Medium | Count Good Nodes in Binary Tree | Link |
| Medium | Valid Binary Search Tree | Link |
| Medium | Kth Smallest Integer in BST | Link |
| Medium | Construct Binary Tree from Preorder and Inorder Traversal | Link |
| Medium | House Robber III | Link |
| Medium | Delete Leaves With a Given Value | Link |
| Difficulty | Problem | Solution |
|---|---|---|
| Easy | Kth Largest Element in a Stream | Link |
| Easy | Last Stone Weight | Link |
| Medium | K Closest Points to Origin | Link |
| Medium | Kth Largest Element in an Array | Link |
| Medium | Task Scheduler | Link |
| Medium | Design Twitter | Link |
| Medium | Single Threaded CPU | Link |
| Medium | Reorganize String | Link |
| Medium | Longest Happy String | Link |
| Medium | Car Pooling | Link |
| Difficulty | Problem | Solution |
|---|---|---|
| Easy | Sum of All Subsets XOR Total | Link |
| Medium | Subsets | Link |
| Medium | Combination Sum | Link |
| Medium | Combination Sum II | Link |