Awesome Open Source
Awesome Open Source


Solutions of algorithm problems using Javascript.


The solutions are located under /LeetcodeProblems. Each problem has a test file located under /LeetcodeProblemsTest.

Run Scripts

To run all the test run node Test.js in the console.

To run a specific problem in your console, go to the file test, add the call to the test function (test() ) and run in the console node <problem_file_path> (e.g. node LeetcodeProblems/Lowest_Common_Ancestor_of_a_Binary_Tree.js).

Leetcode Problems

Name Level Link
Edit Distance Hard
Remove Invalid Parentheses Hard
Longest Consecutive Sequence Hard
Minimum Window Substring Hard
Regular Expression Matching Hard
NQueens Hard
merge k sorted lists Hard
Set Matrix Zeroes Hard
Subarray Sum Equals K Medium
3Sum Medium
NumberOfIslands Medium
Swap Nodes in Pairs Medium
Add Two Numbers Medium
Clone Graph Medium
Coin Change Medium
Design Circular Deque Medium
Escape The Ghosts Medium
Generate Parenthesis Medium
Group Anagrams Medium
Kth Largest Element in an Array Medium
Linked List Cycle II Medium
Longest Palindromic Substring Medium
Max Area Of Island Medium
Maximal Square Medium
Permutations Medium
Permutations II Medium
Permutations Without Duplicates Medium
Restore IP Addresses Medium
SearchIng Rotated Sorted Array Medium
Search a 2D Matrix Medium
Search a 2D Matrix II Medium
Simplify Path Medium
Spiral Matrix Medium
Subsets Medium
Unique Binary Search Trees Medium
Unique Paths Medium
Verify Preorder Serialization of a Binary Tree Medium
Construct Binary Tree from Preorder and Inorder Traversal Medium
Lowest Common Ancestor of a Binary Tree Medium
Flood Fill Easy
Implement stack using queues Easy
Number of Segments in a String Easy
Maximun Subarray Easy
Min Stack Easy
Reverse String II Easy
Same Tree Easy
Sum Of Square Numbers Easy
Symmetric Tree Easy
Valid Parentheses Easy
Backspace String Compare Easy
Binary Gap Easy
Binary Gap Easy
Majority Element Easy
Tic Tac Toe
Permutations With Duplicates
Deletion Distance
Award Budget Cuts

Sorting Algorithms

Heap Sort
Quick Sort


Problems Level Link
Trips and Users Hard
Human Traffic of Stadium Hard
Rank Scores Medium
Consecutive Numbers Medium
Department Highest Salary Medium
Exchange Seats Medium
Nth Highest Salary Medium
Combine Two Tables Easy
Second Highest Salary Easy
Customers Who Never Order Easy
Reformat Department Table Easy
Employees Earning More Than Their Managers Easy
Delete Duplicate Emails Easy
Rising Temperature Easy


Other languages provides built-in classes (e.g Linked List, Tree, etc). This module contains util classes to use in your problems.


If you want to contribute to this repo by adding a problem you should:

  1. Add the description of the problem at the top of the file.
  2. Add a test file with some test cases. The test file must export a test() function which should run all the tests of the file.
  3. Add your problem to the Readme so that your problem shows up in the list of solutions.

PR Example:

Get A Weekly Email With Trending Projects For These Topics
No Spam. Unsubscribe easily at any time.
javascript (70,847
algorithms (480
data-structures (393
interview (272
interview-questions (203
leetcode (200
computer-science (176
interview-preparation (102
software-engineering (71
leetcode-solutions (69
coding-interviews (44
problem-solving (28