Skip to content

A collection of my solutions to Leet Code problems in Javascript.

Notifications You must be signed in to change notification settings

LeooZeballos/leetcode-js

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Leet Code - Javascript

A collection of my solutions to Leet Code problems in Javascript.

Running the tests for a problem

To run the tests, you must have Node.js installed.

Then, run the following command for the problem you want to test:

node <folder>/<problem-name>.js

Problems Solved

# Title Solution Difficulty
1 Two Sum JavaScript Easy
2 Add Two Numbers JavaScript Medium
3 Longest Substring Without Repeating Characters JavaScript Medium
5 Longest Palindromic Substring JavaScript Medium
7 Reverse Integer JavaScript Medium
9 Palindrome Number JavaScript Easy
13 Roman to Integer JavaScript Easy
14 Longest Common Prefix JavaScript Easy
19 Remove Nth Node From End of List JavaScript Medium
20 Valid Parentheses JavaScript Easy
21 Merge Two Sorted Lists JavaScript Easy
26 Remove Duplicates from Sorted Array JavaScript Easy
27 Remove Element JavaScript Easy
35 Search Insert Position JavaScript Easy
36 Valid Sudoku JavaScript Medium
46 Permutations JavaScript Medium
53 Maximum Subarray JavaScript Easy
58 Length of Last Word JavaScript Easy
62 Unique Paths JavaScript Medium
66 Plus One JavaScript Easy
70 Climbing Stairs JavaScript Easy
74 Search a 2D Matrix JavaScript Medium
77 Combinations JavaScript Medium
83 Remove Duplicates from Sorted List JavaScript Easy
88 Merge Sorted Array JavaScript Easy
94 Binary Tree Inorder Traversal JavaScript Easy
98 Validate Binary Search Tree JavaScript Medium
100 Same Tree JavaScript Easy
101 Symmetric Tree JavaScript Easy
102 Binary Tree Level Order Traversal JavaScript Medium
104 Maximum Depth of Binary Tree JavaScript Easy
112 Path Sum JavaScript Easy
116 Populating Next Right Pointers in Each Node JavaScript Medium
118 Pascal's Triangle JavaScript Easy
120 Triangle JavaScript Medium
121 Best Time to Buy and Sell Stock JavaScript Easy
134 Gas Station JavaScript Medium
136 Single Number JavaScript Easy
141 Linked List Cycle JavaScript Easy
142 Linked List Cycle II JavaScript Medium
144 Binary Tree Preorder Traversal JavaScript Easy
145 Binary Tree Postorder Traversal JavaScript Easy
149 Max Points on a Line JavaScript Hard
167 Two Sum II - Input array is sorted JavaScript Medium
189 Rotate Array JavaScript Medium
190 Reverse Bits JavaScript Easy
191 Number of 1 Bits JavaScript Easy
198 House Robber JavaScript Medium
200 Number of Islands JavaScript Medium
203 Remove Linked List Elements JavaScript Easy
205 Isomorphic Strings JavaScript Easy
206 Reverse Linked List JavaScript Easy
217 Contains Duplicate JavaScript Easy
226 Invert Binary Tree JavaScript Easy
231 Power of Two JavaScript Easy
232 Implement Queue using Stacks JavaScript Easy
235 Lowest Common Ancestor of a Binary Search Tree JavaScript Easy
242 Valid Anagram JavaScript Easy
283 Move Zeroes JavaScript Easy
290 Word Pattern JavaScript Easy
299 Bulls and Cows JavaScript Medium
344 Reverse String JavaScript Easy
350 Intersection of Two Arrays II JavaScript Easy
383 Ransom Note JavaScript Easy
387 First Unique Character in a String JavaScript Easy
392 Is Subsequence JavaScript Easy
394 Decode String JavaScript Medium
409 Longest Palindrome JavaScript Easy
424 Longest Repeating Character Replacement JavaScript Medium
438 Find All Anagrams in a String JavaScript Medium
452 Minimum Number of Arrows to Burst Balloons JavaScript Medium
509 Fibonacci Number JavaScript Easy
542 01 Matrix JavaScript Medium
557 Reverse Words in a String III JavaScript Easy
566 Reshape the Matrix JavaScript Easy
567 Permutation in String JavaScript Medium
589 N-ary Tree Preorder Traversal JavaScript Easy
617 Merge Two Binary Trees JavaScript Easy
653 Two Sum IV - Input is a BST JavaScript Easy
692 Top K Frequent Words JavaScript Medium
695 Max Area of Island JavaScript Medium
700 Search in a Binary Search Tree JavaScript Easy
701 Insert into a Binary Search Tree JavaScript Medium
704 Binary Search JavaScript Easy
724 Find Pivot Index JavaScript Easy
733 Flood Fill JavaScript Easy
746 Min Cost Climbing Stairs JavaScript Easy
784 Letter Case Permutation JavaScript Medium
844 Backspace String Compare JavaScript Easy
876 Middle of the Linked List JavaScript Easy
953 Verifying an Alien Dictionary JavaScript Easy
977 Squares of a Sorted Array JavaScript Easy
994 Rotting Oranges JavaScript Medium
1046 Last Stone Weight JavaScript Easy
1061 Lexicographically Smallest Equivalent String JavaScript Medium
1071 Greatest Common Divisor of Strings JavaScript Easy
1443 Minimum Time to Collect All Apples in a Tree JavaScript Medium
1480 Running Sum of 1d Array JavaScript Easy
1519 Number of Nodes in the Sub-Tree With the Same Label JavaScript Medium
1833 Maximum Ice Cream Bars JavaScript Medium
2246 Longest Path With Different Adyacent Characters JavaScript Hard

License

MIT License

Copyright (c) 2023 - Leonel A. Zeballos

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

About

A collection of my solutions to Leet Code problems in Javascript.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published