• Stars
    star
    201
  • Rank 194,491 (Top 4 %)
  • Language
    JavaScript
  • License
    Apache License 2.0
  • Created almost 8 years ago
  • Updated 10 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

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

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

More Repositories

1

resume

个人中文简历 Latex 源码 https://hijiangtao.github.io/
TeX
1,788
star
2

glmaps

Data visualization examples and tutorials from scratch. 数据可视化示例代码集与新手学习教程。
JavaScript
376
star
3

javascript-articles-monthly

JavaScript 文章精选月刊
318
star
4

FE-Cookbook

HTML/CSS & JavaScript, Web and related. 前端手册
JavaScript
290
star
5

weapp-newsapp

微信小程序-公众号热门文章信息流
JavaScript
199
star
6

hijiangtao.github.io

Joe's Blog
JavaScript
131
star
7

ss-vis-component

VIS components for a security system, to monitor the state and confirm the system's health running.
JavaScript
90
star
8

friendlyhello-docker

《Docker 学习新手笔记:从入门到放弃》一文与示例代码
Python
43
star
9

Force-Directed-Layout

A Force Directed Layout work wrote in ES2015
JavaScript
22
star
10

d3-treemap-with-react-demo

绘制 D3 TreeMap 动画的一些设计思路
JavaScript
14
star
11

rainmood

一个简单项目,只有一个页面。循环播放十首电影原声精选,背景乐为下雨声。
JavaScript
12
star
12

infovis-ucas

Programming Assignment Project for Information Visualization Course on University of Chinese Academy of Sciences
JavaScript
12
star
13

build-time-analysis-webpack-plugin

A webpack plugin that output the build time file by file as a JSON format with filters
JavaScript
11
star
14

learn-rust-with-rustlings

🎉 Rustlings Solutions (Rustlings 解题集)
Rust
8
star
15

dark-tech

Dark-Tech : A New Hexo Theme
HTML
6
star
16

UrbanFACET

UrbanFACET: Visually Profiling Cities from Mobile Device Recorded Movement Data of Millions of City Residents
JavaScript
6
star
17

billboard-generator

Generate your billboard in a second
TypeScript
4
star
18

octo-note

A simple and small note app
JavaScript
2
star
19

hijiangtao.js.org

hijiangtao.js.org
2
star
20

awesome-toolbox

My Awesome Toolbox
2
star
21

slides

Personal Sharing X
HTML
2
star
22

ng-highcharts

Another highcharts directive for Angular but with pure highcharts imported from highcharts.js
TypeScript
2
star
23

hijiangtao

It's me! https://github.com/hijiangtao
1
star
24

ngut

HTML
1
star
25

shaonian.eu

CSS
1
star
26

custom-decorator-project

TypeScript 装饰器介绍与示例教程一文示例代码
HTML
1
star
27

fudao-hello

Debug @fudao/hello like a hero
TypeScript
1
star
28

dice

Roll a dice and make your day.
TypeScript
1
star
29

ngrx-store-example

Example code for @ngrx/store v9
TypeScript
1
star
30

simple-server

A funny server created with koa2.
JavaScript
1
star