Skip to content

Solutions collection of LeetCode submissions in JavaScript & TypeScript (LeetCode 解题集之 JavaScript & TypeScript 版)

License

Notifications You must be signed in to change notification settings

hijiangtao/LeetCode-with-JavaScript

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

LeetCode in JavaScript

This is the solutions collection of my LeetCode submissions, most of them are programmed in JavaScript. All JavaScript codes are wrote in ECMAScript 6 standard, each solution file will contain a problem description in the beginning, and followed by some necessary explanation, some problems will provide more than one solution, please refer to the comments after the main solution for one specific problem.

ATTENTION: If you also use JavaScript as your coding language, you should pay attention to some JavaScript INTERNAL issues, such as bitwise operators, so as to let you not drop into some trouble which may be caused by JavaScript itself.

Progress: 171/2520 Solutions

ID Title Solution Difficulty
1 Two Sum JavaScript· TypeScript Easy
2 Add Two Numbers JavaScript Medium
3 Longest Substring Without Repeating Characters JavaScript Medium
4 Median of Two Sorted Arrays JavaScript Hard
5 Longest Palindromic Substring JavaScript Medium
6 ZigZag Conversion JavaScript Medium
7 Reverse Integer JavaScript Easy
8 String to Integer (atoi) JavaScript Medium
11 Container With Most Water JavaScript Medium
13 Roman to Integer JavaScript Easy
14 Longest Common Prefix JavaScript Easy
15 3Sum JavaScript Medium
16 3Sum Closest JavaScript Medium
17 Letter Combinations of a Phone Number JavaScript Medium
18 4sum TypeScript Medium
19 Remove Nth Node From End of List JavaScript Medium
20 valid-parentheses TypeScript Easy
22 Generate Parentheses JavaScript Medium
24 swap-nodes-in-pairs TypeScript Medium
26 Remove Duplicates from Sorted Array JavaScript Easy
27 Remove Element JavaScript Easy
28 Implement strStr() JavaScript Easy
29 Divide Two Integers JavaScript Medium
31 next-permutation TypeScript Medium
33 Search in Rotated Sorted Array JavaScript Medium
34 Search for a Range JavaScript Medium
35 Search Insert Position JavaScript Easy
38 count-and-say TypeScript Medium
39 Combination Sum JavaScript Medium
40 Combination Sum II JavaScript Medium
41 First Missing Positive JavaScript Hard
42 Trapping Rain Water JavaScript Hard
43 Multiply Strings JavaScript Medium
45 Jump Game II JavaScript Hard
46 Permutations JavaScript Medium
47 permutations-ii TypeScript Medium
48 Rotate Image JavaScript Medium
49 Group Anagrams JavaScript Medium
50 powx-n TypeScript Medium
53 Maximum Subarray JavaScript · TypeScript Easy
54 Spiral Matrix JavaScript Medium
55 Jump Game * JavaScript Medium
56 Merge Intervals JavaScript Medium
57 Insert Interval JavaScript Hard
62 Unique Paths JavaScript Medium
63 Unique Paths ii JavaScript Medium
64 minimum-path-sum TypeScript Medium
66 Plus One JavaScript Easy
69 Sqrt(x) JavaScript Easy
70 climbing-stairs TypeScript Easy
71 Simplify Path JavaScript Medium
73 Set Matrix Zeroes JavaScript Medium
75 Sort Colors JavaScript Medium
77 combinations TypeScript Medium
80 Remove Duplicates from Sorted Array II JavaScript Medium
81 Search in Rotated Sorted Array II JavaScript Medium
88 Merge Sorted Array JavaScript Medium
91 Decode Ways JavaScript Medium
93 Restore IP Addresses JavaScript Medium
94 Binary Tree Inorder Traversal TypeScript Easy
95 unique-binary-search-trees-ii TypeScript Medium
96 unique-binary-search-trees TypeScript Medium
97 interleaving-string TypeScript Medium
98 Validate Binary Search Tree JavaScript Medium
99 recover-binary-search-tree TypeScript Medium
100 Same Tree JavaScript Easy
101 Symmetric Tree JavaScript Easy
102 Binary Tree Level Order Traversal JavaScript Medium
103 binary-tree-zigzag-level-order-traversal TypeScript Medium
104 Maximum Depth of Binary Tree JavaScript Easy
107 Binary Tree Level Order Traversal II JavaScript Easy
108 Convert Sorted Array to Binary Search Tree JavaScript Easy
110 balanced-binary-tree TypeScript Easy
111 Minimum Depth of Binary Tree JavaScript · TypeScript Easy
114 flatten-binary-tree-to-linked-list TypeScript Medium
116 populating-next-right-pointers-in-each-node TypeScript Medium
120 Triangle JavaScript Medium
121 Best Time to Buy and Sell Stock JavaScript · TypeScript Easy
122 Best Time to Buy and Sell Stock II JavaScript Easy
123 Best Time to Buy and Sell Stock III * JavaScript Hard
127 Word Ladder JavaScript Medium
128 Longest Consecutive Sequence JavaScript Medium
129 sum-root-to-leaf-numbers TypeScript Medium
130 Surrounded Regions JavaScript Medium
131 palindrome-partitioning TypeScript Medium
133 Clone Graph JavaScript Medium
134 Gas Station JavaScript · TypeScript Medium
135 Candy JavaScript Hard
136 Single Number JavaScript Easy
137 Single Number II JavaScript Medium
139 word-break TypeScript Medium
143 reorder-list TypeScript Medium
147 insertion-sort-list TypeScript Medium
148 sort-list TypeScript Medium
151 Reverse Words in a String JavaScript Medium
152 Maximum Product Subarray JavaScript Medium
153 Find Minimum in Rotated Sorted Array JavaScript Medium
154 Find Minimum in Rotated Sorted Array II JavaScript Medium
162 Find Peak Element JavaScript Medium
164 Maximum Gap JavaScript Hard
165 Compare Version Numbers JavaScript Medium
166 fraction-to-recurring-decimal TypeScript Medium
169 Majority Element JavaScript Easy
175 Combine Two Tables SQL Easy
176 Second Highest Salary SQL Easy
177 Nth Highest Salary SQL Medium
179 largest-number TypeScript Medium
181 Employees Earning More Than Their Managers SQL Easy
182 Duplicate Emails SQL Easy
183 Customers Who Never Order SQL Easy
184 Department Highest Salary SQL Medium
188 Best Time to Buy and Sell Stock IV JavaScript Hard
189 Rotate Array JavaScript Easy
190 Reverse Bits JavaScript Easy
196 Delete Duplicate Emails SQL Easy
197 Rising Temperature SQL Easy
198 house-robber TypeScript Medium
203 remove-linked-list-elements TypeScript Easy
206 Reverse Linked List JavaScript Easy
207 Course Schedule JavaScript Medium
209 Minimum Size Subarray Sum JavaScript Medium
210 Course Schedule II JavaScript Medium
213 house-robber-ii TypeScript Medium
215 Kth Largest Element in an Array JavaScript Medium
217 Contains Duplicate JavaScript · TypeScript Easy
219 Contains Duplicate II JavaScript Easy
220 Contains Duplicate III JavaScript · TypeScript Medium
228 Summary Ranges JavaScript Medium
230 kth-smallest-element-in-a-bst TypeScript Medium
238 Product of Array Except Self JavaScript Medium
239 Sliding Window Maximum JavaScript Hard
240 Search a 2D Matrix II JavaScript · TypeScript Medium
274 H-Index JavaScript Medium
275 H-Index II JavaScript Medium
278 First Bad Version JavaScript Easy
283 Move Zeroes JavaScript Easy
287 Find the Duplicate Number JavaScript Medium
289 Game of Life JavaScript Medium
295 Find Median from Data Stream JavaScript Hard
299 Bulls and Cows JavaScript Medium
300 Longest Increasing Subsequence JavaScript Medium
307 Range Sum Query - Mutable JavaScript Medium
309 Best Time to Buy and Sell Stock with Cooldown JavaScript Medium
310 Minimum Height Trees JavaScript Medium
315 Count of Smaller Numbers After Self * JavaScript Hard
316 remove-duplicate-letters TypeScript Medium
322 Coin Change JavaScript Medium
327 Count of Range Sum JavaScript Hard
334 Increasing Triplet Subsequence JavaScript · TypeScript Medium
340 Longest Substring with At Most K Distinct Characters JavaScript Hard
342 Power of Four JavaScript Easy
344 Reverse String JavaScript Easy
349 Intersection of Two Arrays JavaScript Easy
350 Intersection of Two Arrays ii JavaScript Easy
371 Sum of Two Integers JavaScript Easy
374 Guess Number Higher or Lower JavaScript Easy
376 Wiggle Subsequence JavaScript · TypeScript Medium
384 Shuffle an Array JavaScript Medium
395 Longest Substring with At Least K Repeating Characters JavaScript Medium
404 Sum of Left Leaves JavaScript Easy
406 queue-reconstruction-by-height TypeScript Medium
413 Arithmetic Slices JavaScript Medium
416 Partition Equal Subset Sum JavaScript Medium
424 Longest Repeating Character Replacement JavaScript Medium
434 Number of Segments in a String JavaScript Easy
486 Predict the Winner JavaScript Medium
494 Target Sum JavaScript Medium
516 Longest Palindromic Subsequence JavaScript Medium
523 Continuous Subarray Sum JavaScript Medium
539 Minimum Time Difference JavaScript Medium
687 Longest Univalue Path JavaScript Easy
779 K-th Symbol in Grammar JavaScript Medium
NO NAME TypeScript Easy

About

Solutions collection of LeetCode submissions in JavaScript & TypeScript (LeetCode 解题集之 JavaScript & TypeScript 版)

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •