Giter VIP home page Giter VIP logo

algorithms-leetcode-javascript's Introduction

Algorithms-Javascript

Solutions of algorithm problems using Javascript. https://ignacio-chiazzo.github.io/Algorithms-Leetcode-Javascript/

Structure

The solutions are located under /LeetcodeProblems. Each solutions exports the main function(s) which to be tested. Each problem has a test file located under /LeetcodeProblemsTest.

Run Scripts

To run all the test run node Main.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 https://leetcode.com/problems/edit-distance/
Remove Invalid Parentheses Hard https://leetcode.com/problems/remove-invalid-parentheses/
Longest Consecutive Sequence Hard https://leetcode.com/problems/longest-consecutive-sequence/
Minimum Window Substring Hard https://leetcode.com/problems/minimum-window-substring/
Regular Expression Matching Hard https://leetcode.com/problems/regular-expression-matching/
NQueens Hard https://leetcode.com/problems/n-queens/
merge k sorted lists Hard https://leetcode.com/problems/merge-k-sorted-lists/
Set Matrix Zeroes Hard https://leetcode.com/problems/set-matrix-zeroes/
Subarray Sum Equals K Medium https://leetcode.com/problems/subarray-sum-equals-k/
3Sum Medium https://leetcode.com/problems/3sum/
NumberOfIslands Medium https://leetcode.com/problems/number-of-islands/
Swap Nodes in Pairs Medium https://leetcode.com/problems/swap-nodes-in-pairs/
Add Two Numbers Medium https://leetcode.com/problems/add-two-numbers/
Clone Graph Medium https://leetcode.com/problems/clone-graph/
Coin Change Medium https://leetcode.com/problems/coin-change/
Design Circular Deque Medium https://leetcode.com/problems/design-circular-deque/
Escape The Ghosts Medium https://leetcode.com/problems/escape-the-ghosts/
Generate Parenthesis Medium https://leetcode.com/problems/generate-parentheses
Group Anagrams Medium https://leetcode.com/problems/group-anagrams/
Kth Largest Element in an Array Medium https://leetcode.com/problems/kth-largest-element-in-an-array/
Linked List Cycle II Medium https://leetcode.com/problems/linked-list-cycle-ii/
Longest Palindromic Substring Medium https://leetcode.com/problems/longest-palindromic-substring/
Max Area Of Island Medium https://leetcode.com/problems/max-area-of-island/
Maximal Square Medium https://leetcode.com/problems/maximal-square/
Permutations Medium https://leetcode.com/problems/permutations/
Permutations II Medium https://leetcode.com/problems/permutations-ii/
Permutations Without Duplicates Medium https://leetcode.com/problems/permutations/
Restore IP Addresses Medium https://leetcode.com/problems/restore-ip-addresses/
SearchIng Rotated Sorted Array Medium https://leetcode.com/problems/search-in-rotated-sorted-array/
Search a 2D Matrix Medium https://leetcode.com/problems/search-a-2d-matrix/
Search a 2D Matrix II Medium https://leetcode.com/problems/search-a-2d-matrix/
Simplify Path Medium https://leetcode.com/problems/simplify-path/
Spiral Matrix Medium https://leetcode.com/problems/spiral-matrix/
Subsets Medium https://leetcode.com/problems/subsets/
Unique Binary Search Trees Medium https://leetcode.com/problems/unique-binary-search-trees/
Unique Paths Medium https://leetcode.com/problems/unique-paths/
Verify Preorder Serialization of a Binary Tree Medium https://leetcode.com/problems/verify-preorder-serialization-of-a-binary-tree/
Construct Binary Tree from Preorder and Inorder Traversal Medium https://leetcode.com/problems/construct-binary-tree-from-preorder-and-inorder-traversal/
Lowest Common Ancestor of a Binary Tree Medium https://leetcode.com/problems/lowest-common-ancestor-of-a-binary-tree/
Flood Fill Easy https://leetcode.com/problems/flood-fill/
Implement stack using queues Easy https://leetcode.com/problems/implement-stack-using-queues/
Number of Segments in a String Easy https://leetcode.com/problems/number-of-segments-in-a-string/
Maximun Subarray Easy https://leetcode.com/problems/maximum-subarray
Min Stack Easy https://leetcode.com/problems/min-stack/
Reverse String II Easy https://leetcode.com/problems/reverse-string-ii/
Same Tree Easy https://leetcode.com/problems/same-tree/
Sum Of Square Numbers Easy https://leetcode.com/problems/sum-of-square-numbers/
Symmetric Tree Easy https://leetcode.com/problems/symmetric-tree/
Valid Parentheses Easy https://leetcode.com/problems/valid-parentheses/
Backspace String Compare Easy https://leetcode.com/problems/backspace-string-compare/
Binary Gap Easy https://leetcode.com/problems/binary-gap/
Binary Gap Easy https://leetcode.com/problems/binary-gap/
Majority Element Easy https://leetcode.com/problems/majority-element/
Tic Tac Toe
Permutations With Duplicates
Deletion Distance
Award Budget Cuts

Sorting Algorithms

Algoritmhs
Heap Sort

Databases

Problems Level Link
Consecutive Numbers Medium https://leetcode.com/problems/consecutive-numbers
Department Highest Salary Medium https://leetcode.com/problems/department-highest-salary
Exchange Seats Medium https://leetcode.com/problems/exchange-seats
Nth Highest Salary Medium https://leetcode.com/problems/nth-highest-salary
Combine Two Tables Easy https://leetcode.com/problems/combine-two-tables
Second Highest Salary Easy https://leetcode.com/problems/second-highest-salary
Customers Who Never Order Easy https://leetcode.com/problems/customers-who-never-order
Reformat Department Table Easy https://leetcode.com/problems/reformat-department-table
Employees Earning More Than Their Managers Easy https://leetcode.com/problems/employees-earning-more-than-their-managers/
Delete Duplicate Emails Easy https://leetcode.com/problems/delete-duplicate-emails
Rising Temperature Easy https://leetcode.com/problems/rising-temperature

UtilsClasses

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

Contributions

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: ignacio-chiazzo#39

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.