Skip to content

jzhangnu/Leetcode-JS-Solutions

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

99 Commits
 
 
 
 
 
 

Repository files navigation

leetcode-js

# Title Solution Difficulty Tag
1 Two Sum 🔑 Easy Hash Table
344 Reverse String 🔑 Easy
258 Add Digits 🔑 E Math
104 Maximum Depth of Binary Tree 🔑 E DFS
226 Invert Binary Tree 🔑 E Tree
283 Move Zeroes 🔑 E
349 Intersection of Two Arrays 🔑 E Binary Search / Hash Table
100 Same Tree 🔑 Easy DFS
242 Valid Anagram 🔑 E Hash Table
169 Majority Element 🔑 E Divide and Conquer
217 Contains Duplicate 🔑 E Hash Table
350 Intersection of Two Arrays II 🔑 E Hash Table / Binary Search
168 Excel Sheet Column Title 🔑 E Math
206 Reverse Linked List 🔑 E
387 First Unique Character in a String 🔑 E Hash Table / String
412 Fizz Buzz 🔑 E
326 Power of Three 🔑 E Math
136 Single Number 🔑 E Hash Table
83 Remove Duplicates from Sorted List 🔑 E Linked List
121 Best Time to Buy and Sell Stock 🔑 E DP
70 Climbing Stairs 🔑 E DP
263 Ugly Number 🔑🔑 E Math
389 Find the Difference 🔑 E Hash Table
257 Binary Tree Paths 🔑
111 Minimum Depth of Binary Tree 🔑 E Divide and Conquer / Binary Tree
53 Maximum Subarray 🔑 M Divide and Conquer / DP
110 Balanced Binary Tree 🔑 E DFS
2 Add Two Numbers 🔑 M Linked List
404 Sum of Left Leaves 🔑 E Recursion
88 Merge Sorted Array 🔑 E Array
167 Two Sum II - Input array is sorted 🔑 E Array
49 Group Anagrams 🔑 E Hash Table
229 Majority Element II 🔑 E Array
438 Find All Anagrams in a String 🔑 E Hash Table
125 Valid Palindrome 🔑 E String
237 Delete Node in a Linked List 🔑 E Linked List
21 Merge Two Sorted Lists 🔑 E Linked List
345 Reverse Vowels of a string 🔑 E String
27 Remove Element 🔑 E Array
205 Isomorphic Strings 🔑 E Hash Table
38 Count and Say 🔑 E String
290 Word Pattern 🔑 E Hash Table
219 Contains Duplicate I 🔑 E Hash Table
299 Bulls and Cows 🔑 E Hash Table
414 Third Maximum Number 🔑 E Array
189 Rotate Array 🔑 E Array
118 Pascal's Triangle 🔑 E Array
165 Compare Version Numbers 🔑 E Array
383 Ransom Note 🔑 E String
58 Length of Last Word 🔑 E String
20 Valid Parentheses 🔑 E String
14 Longest Common Prefix 🔑 E String
6 ZigZag Conversion 🔑 E String
202 Happy Number 🔑 E Hash Table
441 Arranging Coins 🔑 E Hash Table
225 Implement Stack using Queues 🔑 E Stack
198 House Robber 🔑 E DP
303 Range Sum Query - Immutable 🔑 E DP
448 Find ALL Numbers Disappeared in an Array 🔑 E DP
26 Remove Duplicates from Sorted Array 🔑 E DP
235 Lowest Common Ancestor of a Binary Search Tree 🔑 E Tree
278 First Bad Version 🔑 E Binary Search
392 Is Subsequence 🔑 E Binary Search
230 Kth Smallest Element in a BST 🔑 E Binary Search
9 Palindrome Number 🔑 E
131 Palindrome Partitioning 🔑 E Backtracking
28 Implement strStr() 🔑 E Two Pointers
515 Find Largest Value in Each Tree Row 🔑 M DFS
119 Pascal's Triangle II 🔑 E Array
204 Count Primes 🔑 E Hash Table
396 Rotate Function 🔑 E Math
203 Remove Linked List Elements 🔑 E Linked List
19 Remove Nth Node From End of List 🔑 E Linked List
844 Backspace String Compare 🔑 E Two Pointers
784 Letter Case Permutation 🔑 E Backtracking
234 Palindrome Linked List 🔑 E Linked List
112 Path Sum 🔑 E DFS
36 Valid Sudoku 🔑 E Hash Table
141 Linked List Cycle 🔑 E Linked List
102 Binary Tree Level Order Traversal 🔑 E BFS
24 Swap Nodes in Pairs 🔑 M Linked List
101 Symmetric Tree 🔑 E BFS
459 Repeated Substring Pattern 🔑 E String
455 Assign Cookies 🔑 E Greedy
832 Flipping an Image 🔑 E Array
566 Reshape the Matrix 🔑 E Array
643 Maximum Average Subarray I 🔑 E Array
674 Longest Continuous Increasing Subsequence 🔑 E Array
766 Toeplitz Matrix 🔑 E Array
867 Transpose Matrix 🔑 E Array
804 Unique Morse Code Words 🔑 E String
657 Judge Route Circle 🔑 E String
696 Count Binary Substrings 🔑 E String
841 Keys and Rooms 🔑 M DFS
513 Find Bottom Left Tree Value 🔑 M DFS
515 Find Largest Value in Each Tree Row 🔑 M DFS
337 House Robber III 🔑 M DFS
739 Daily Temperatures 🔑 M Hash Table
508 Most Frequent Subtree Sum 🔑 M Hash Table
554 Brick Wall 🔑 M Hash Table
648 Replace Words 🔑 M Hash Table
692 Top K Frequent Words 🔑 M Hash Table
200 Number of Islands 🔑 M Hash Table
694 Number of distinct Islands 🔑 M Hash Table
347 Top K Frequent Elements 🔑 M Hash TableGroup Shifted String
249 Group Shifted String 🔑 M Hash TableGroup Shifted String
876 Middle of the Linked List 🔑 E Linked List
238 Product of Array Except Self 🔑 M Array
260 Single Number III 🔑 M Array
724 Find Pivot Index 🔑 M Array

Nov 30

M406. Queue Reconstruction by Height    Solutions     Greedy

M268. Missing Number    Solutions     Array | Bit

Dec 1

M46. Permutations    Solutions     Backtracking | Recursion

M78. Subsets    Solutions     Backtracking | Recursion

Dec 4

M137. Single Number II    Solutions     Bit manipulation

Dec 25

266. Palindrome Permutation    Solutions     Hash Table

463. Island Perimeter    Solutions     DFS

339. Nested List Weight Sum    Solutions     Recursion

243. Shortest Word Distance    Solutions     Array

M244. Shortest Word Distance II    Solutions     Array

M245. Shortest Word Distance III    Solutions     Array

Jan 4

293. Flip Game    Solutions     Hash Table

M294. Flip Game II    Solutions    

M17. Letter Combinations of a Phone Number    Solutions    

Jan 5

80. Remove Duplicates from Sorted Array II    Solutions     Two pointers

11. Container With Most Water    Solutions     Two pointers

Jan 8

151. Reverse Words in a String    Solutions     String

3. Longest Substring Without Repeating Characters    Solutions     HashMap | Two Pointers

Jan 10

?408. Valid Word Abbreviation   

Solutions     ++      String

5. Longest Palindromic Substring   

Solutions     ++++      String

Jan 11

346. Moving Average from Data Stream   

Solutions     ++      Desgin

160. Intersection of Two Linked Lists   

Solutions     ++      Linked List

152. Maximum Product Subarray   

Solutions     M +++      Array

Jan 12

171. Excel Sheet Column Number   

Solutions     ++      Math

Jan 14

371. Sum of Two Integers   

Solutions     ++      Bit

Jan 18

67. Add Binary   

Solutions     ++      Math String

186. Reverse Words in a String II   

Solutions     +++      String

Jan 24

66. Plus One   

Solutions     +++      Array

M79. Word Search   

Solutions     +++      Array

Jan 25

54. Spiral Matrix   

Solutions     +++++      Array

434. Number of Segments in a String   

Solutions     +++      String

35. Search Insert Position   

Solutions     +++      Array Binary Search

215. Kth Largest Element in an Array   

Solutions          Array Binary Search

215. Kth Largest Element in an Array   

Solutions     +++      Array Binary Search

Feb 17

506. Relative Ranks    ++      Hashmap

508. Most Frequent Subtree Sum    solutions    M     Hashmap

687. Longest Univalue Path    solutions    M     Hashmap

647. Palindromic Substrings    solutions    M     String

594. Longest Harmonious Subsequence    solutions    E     HashMap

771. Jewels and Stones    solutions    E     HashMap

451. Sort Characters By Frequency    solutions    M     HashMap

435. Non-overlapping Intervals    solutions    M     Greedy

560. Subarray Sum Equals K    solutions    M     hashTable

557. Reverse Words in a String III    solutions    M     hashTable

442. Find All Duplicates in an Array    solutions    M     array

695. Max Area of Island    solutions    E     DFS

581. Shortest Unsorted Continuous Subarray    solutions    E     Array

About

🍹 Leetcode solutions using JavaScript.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages