A curated list of data structures and algorithms problems
along with the solution in JavaScript to crack engineering interviews
Go through Usage Guide before you start solving
- Running Sum of 1d Array
- Fibonacci Number
- Shuffle the Array
- Search Insert Position
- Pascal's Triangle
- Reverse String
- Matrix Diagonal Sum
- Reverse Integer
- Jewels and Stones
- Kids With the Greatest Number of Candies
- Maximum Product of Two Elements in an Array
- Merge Sorted Array
- Missing Number
- Majority Element
- Single Number
- Rotate Array
- Two Sum
- Move Zeroes
- Squares of a Sorted Array
- Maximum Subarray
- Search in Rotated Sorted Array
- Product of Array Except Self
- How Many Numbers Are Smaller Than the Current Number
- Best Time to Buy and Sell Stock
- Container With Most Water
- House Robber
- Sort Colors
- Subsets
- Combination Sum
- 3 Sum
- Find the Duplicate Number
- Coin Change
- Jump Game
- Kth Largest Element in an Array
- Longest Increasing Subsequence
- Maximum Product Subarray
- Search a 2D Matrix
- Spiral Matrix
- Flipping an Image
- Unique Paths
- Word Search
- Set Matrix Zeroes
- Number of Islands
- Minimum Path Sum
- Path With Minimum Effort
- Course Schedule
- Merge Intervals
- Non-overlapping Intervals
- Ransom Note
- Valid Parentheses
- Check if the Sentence Is Pangram
- Valid Anagram
- Longest Common Prefix
- Reverse Only Letters
- First Unique Character in a String
- Palindromic Substrings
- Longest Substring Without Repeating Characters
- Longest Palindromic Substring
- Group Anagrams
- Generate Parentheses
- Middle of the Linked List
- Merge Two Sorted Lists
- Remove Duplicates from Sorted List
- Linked List Cycle
- Intersection of Two Linked Lists
- Reverse Linked List
- Add Two Numbers
- Palindrome Linked List
- Swapping Nodes in a Linked List
- Odd Even Linked List
- Reorder List
- Remove Nth Node From End of List
- Path Sum
- Invert Binary Tree
- Cousins in Binary Tree
- Diameter of Binary Tree
- Binary Tree Paths
- Average of Levels in Binary Tree
- Maximum Depth of Binary Tree
- Merge Two Binary Trees
- Same Tree
- Sum of Left Leaves
- Leaf-Similar Trees
- Symmetric Tree
- Range Sum of BST
- Search in a Binary Search Tree
- Minimum Absolute Difference in BST
- Minimum Distance Between BST Nodes
- Lowest Common Ancestor of a Binary Search Tree
- Validate Binary Search Tree
If you want to contribute, improve or suggest changes to this repo, then check out the Contributing Guide
This repository is MIT licensed. Read more