Skip to content

tangweikun/leetcode

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ”₯ Leetcode πŸ”₯

Travis Build Maintainability TestCoverage Insight.io PRs Welcome code style: prettier

Practice make Perfect

  • πŸŽ‰ Unit test with jest
  • ✨ Simple code
  • 🎨 Readable code

Logo

Getting Start

git clone https://github.com/tangweikun/leetcode.git
cd leetcode
npm install
npm run test // also you can run `npm run watch`

Recommend

Contents

# Title README Difficulty LeetCode TAGS
1 compare-version-numbers πŸ“— Easy LeetCode String
2 set-matrix-zeroes πŸ“— Easy LeetCode Array
3 triangle πŸ“— Medium LeetCode DP
4 length-of-last-word πŸ“— Easy LeetCode String
5 baseball-game πŸ“— Easy LeetCode Stack
6 132-pattern πŸ“— Medium LeetCode Stack
7 LongestCommonPrefix πŸ“— Easy LeetCode String
8 longest-substring-without-repeating-characters πŸ“— Easy LeetCode String
9 global-and-local-inversions πŸ“— Medium LeetCode Array
10 min-stack πŸ“— Medium LeetCode Stack
11 rotate-image πŸ“— Medium LeetCode Array
12 task-scheduler πŸ“— Medium LeetCode Array
13 search-insert-position πŸ“— Easy LeetCode BinarySearch
14 judge-route-circle πŸ“— Easy LeetCode String
15 advantage-shuffle πŸ“— Medium LeetCode Array
16 number-of-matching-subsequences πŸ“— Medium LeetCode Array
17 valid-parentheses πŸ“— Easy LeetCode String
18 power-of-two πŸ“— Easy LeetCode Math
19 number-of-1-bits πŸ“— Easy LeetCode Bit
20 my-calendar-ii πŸ“— Easy LeetCode Array
21 subdomain-visit-count πŸ“— Easy LeetCode HashTable
22 top-k-frequent-elements πŸ“— Medium LeetCode HashTable
23 climbing-stairs πŸ“— Easy LeetCode DP
24 remove-element πŸ“— Easy LeetCode Array
25 implement-strstr πŸ“— Easy LeetCode String
26 largest-number-at-least-twice-of-others πŸ“— Easy LeetCode Array
27 powx-n πŸ“— Easy LeetCode Math
28 replace-words πŸ“— Medium LeetCode HashTable
29 remove-duplicates-from-sorted-array πŸ“— Easy LeetCode Two Pointer
30 roman-to-integer πŸ“— Easy LeetCode Math
31 maximum-subarray πŸ“— Easy LeetCode Array
32 plus-one πŸ“— Easy LeetCode Math
33 add-binary πŸ“— Easy LeetCode Math
34 sqrtx πŸ“— Easy LeetCode Math
35 merge-sorted-array πŸ“— Easy LeetCode Array
36 count-and-say πŸ“— Easy LeetCode String
37 best-time-to-buy-and-sell-stock πŸ“— Easy LeetCode Array
38 best-time-to-buy-and-sell-stock-ii πŸ“— Easy LeetCode Array
39 valid-palindrome πŸ“— Easy LeetCode TwoPointers
40 single-number πŸ“— Easy LeetCode Bit
41 two-sum-ii-input-array-is-sorted πŸ“— Easy LeetCode Array
42 rotate-array πŸ“— Easy LeetCode Array
43 reverse-bits πŸ“— Easy LeetCode Bit
44 asteroid-collision πŸ“— Medium LeetCode Stack
45 top-k-frequent-words πŸ“— Medium LeetCode HashTable
46 contiguous-array πŸ“— Medium LeetCode HashTable
47 group-anagrams πŸ“— Easy LeetCode HashTable
48 happy-number πŸ“— Easy LeetCode Math
49 fizz-buzz πŸ“— Easy LeetCode Math
50 hamming-distance πŸ“— Easy LeetCode Bit
51 intersection-of-two-arrays πŸ“— Easy LeetCode TowPointers
52 intersection-of-two-arrays-ii πŸ“— Easy LeetCode TwoPointers
53 island-perimeter πŸ“— Easy LeetCode HashTable
54 keyboard-row πŸ“— Easy LeetCode HashTable
55 longest-palindrome πŸ“— Easy LeetCode HashTable
56 longest-continuous-increasing-subsequence πŸ“— Easy LeetCode Array
57 longest-harmonious-subsequence πŸ“— Easy LeetCode HashTable
58 first-unique-character-in-a-string πŸ“— Easy LeetCode String
59 find-the-difference πŸ“— Easy LeetCode HashTable
60 add-digits πŸ“— Easy LeetCode Math
61 add-strings πŸ“— Easy LeetCode Math
62 array-partition-i πŸ“— Easy LeetCode Array
63 arranging-coins πŸ“— Easy LeetCode Math
64 contains-duplicate πŸ“— Easy LeetCode Array
65 contains-duplicate-ii πŸ“— Easy LeetCode Array
66 count-binary-substrings πŸ“— Easy LeetCode String
67 detect-capital πŸ“— Easy LeetCode String
68 distribute-candies πŸ“— Easy LeetCode HashTable
69 count-primes πŸ“— Easy LeetCode Math
70 base-7 πŸ“— Easy LeetCode
71 power-of-three πŸ“— Easy LeetCode Math
72 power-of-four πŸ“— Easy LeetCode math
73 number-of-segments-in-a-string πŸ“— Easy LeetCode String
74 reverse-string πŸ“— Easy LeetCode String
75 reverse-string-ii πŸ“— Easy LeetCode String
76 reverse-words-in-a-string-iii πŸ“— Easy LeetCode String
77 reverse-vowels-of-a-string πŸ“— Easy LeetCode String
78 ugly-number πŸ“— Easy LeetCode Math
79 valid-anagram πŸ“— Easy LeetCode HashTable
80 valid-palindrome-ii πŸ“— Easy LeetCode String
81 word-pattern πŸ“— Easy LeetCode HashTable
82 binary-number-with-alternating-bits πŸ“— Easy LeetCode Bit
83 find-all-anagrams-in-a-string πŸ“— Easy LeetCode HashTable
84 factorial-trailing-zeroes πŸ“— Easy LeetCode Math
85 find-smallest-letter-greater-than-target πŸ“— Easy LeetCode BinarySearch
86 find-pivot-index πŸ“— Easy LeetCode Array
87 license-key-formatting πŸ“— Easy LeetCode
88 longest-uncommon-subsequence-i πŸ“— Easy LeetCode String
89 majority-element πŸ“— Easy LeetCode Array
90 perfect-number πŸ“— Easy LeetCode Math
91 prime-number-of-set-bits-in-binary-representation πŸ“— Easy LeetCode Bit
92 number-complement πŸ“— Easy LeetCode Bit
93 move-zeroes πŸ“— Easy LeetCode Array
94 relative-ranks πŸ“— Easy LeetCode
95 valid-perfect-square πŸ“— Easy LeetCode Math
96 string-compression πŸ“— Easy LeetCode String
97 student-attendance-record-i πŸ“— Easy LeetCode String
98 max-consecutive-ones πŸ“— Easy LeetCode Array
99 maximum-average-subarray-i πŸ“— Easy LeetCode Array
100 minimum-index-sum-of-two-lists πŸ“— Easy LeetCode
101 sum-of-square-numbers πŸ“— Easy LeetCode Math
102 set-mismatch πŸ“— Easy LeetCode Math
103 find-the-duplicate-number πŸ“— Medium LeetCode Math
104 self-dividing-numbers πŸ“— Easy LeetCode Math
105 missing-number πŸ“— Easy LeetCode Math
106 maximum-product-of-three-numbers πŸ“— Easy LeetCode Math
107 complex-number-multiplication πŸ“— Medium LeetCode Math
108 ugly-number-ii πŸ“— Medium LeetCode Math, DP
109 valid-square πŸ“— Medium LeetCode Math
110 1-bit-and-2-bit-characters πŸ“— Easy LeetCode Array
111 can-place-flowers πŸ“— Easy LeetCode Array
112 find-all-numbers-disappeared-in-an-array πŸ“— Easy LeetCode Array
113 container-with-most-water πŸ“— Medium LeetCode Array
114 degree-of-an-array πŸ“— Easy LeetCode Array
115 find-all-duplicates-in-an-array πŸ“— Easy LeetCode Array
116 find-minimum-in-rotated-sorted-array πŸ“— Easy LeetCode Array
117 find-minimum-in-rotated-sorted-array-ii πŸ“— Easy LeetCode Array
118 find-peak-element πŸ“— Medium LeetCode Array
119 jump-game πŸ“— Medium LeetCode DP
120 jump-game-ii πŸ“— Hard LeetCode DP
121 max-chunks-to-make-sorted πŸ“— Medium LeetCode Array
122 maximum-swap πŸ“— Medium LeetCode Array
123 min-cost-climbing-stairs πŸ“— Medium LeetCode DP
124 minimum-size-subarray-sum πŸ“— Medium LeetCode Array
125 remove-duplicates-from-sorted-array-ii πŸ“— Medium LeetCode Array
126 search-for-a-range πŸ“— Medium LeetCode Array
127 subarray-product-less-than-k πŸ“— Medium LeetCode Array
128 daily-temperatures πŸ“— Medium LeetCode Stack
129 sum-of-two-integers πŸ“— Easy LeetCode Bit
130 jewels-and-stones πŸ“— Easy LeetCode HashTable
131 number-of-boomerangs πŸ“— Easy LeetCode HashTable
132 isomorphic-strings πŸ“— Easy LeetCode HashTable
133 counting-bits πŸ“— Easy LeetCode Bit
134 valid-triangle-number πŸ“— Medium LeetCode Array
135 repeated-substring-pattern πŸ“— Easy LeetCode String
136 maximum-depth-of-binary-tree πŸ“— Easy LeetCode BinaryTree
137 merge-two-binary-trees πŸ“— Easy LeetCode BinaryTree
138 average-of-levels-in-binary-tree πŸ“— Easy LeetCode BinaryTree
139 find-duplicate-subtrees πŸ“— Medium LeetCode BinaryTree
140 minimum-window-substring πŸ“— Hard LeetCode String
141 invert-binary-tree πŸ“— Easy LeetCode BinaryTree
142 two-sum-iv-input-is-a-bst πŸ“— Easy LeetCode BinaryTree
143 same-tree πŸ“— Easy LeetCode BinaryTree
144 sum-of-left-leaves πŸ“— Easy LeetCode BinaryTree
145 trim-a-binary-search-tree πŸ“— Easy LeetCode BinaryTree
146 toeplitz-matrix πŸ“— Easy LeetCode Array
147 reshape-the-matrix πŸ“— Easy LeetCode Array
148 next-greater-element-i πŸ“— Easy LeetCode Array
149 nim-game πŸ“— Easy LeetCode BrainTeaser
150 rotated-digits πŸ“— Easy LeetCode String
151 excel-sheet-column-number πŸ“— Easy LeetCode Math
152 ransom-note πŸ“— Easy LeetCode String
153 k-diff-pairs-in-an-array πŸ“— Easy LeetCode Array
154 third-maximum-number πŸ“— Easy LeetCode Array
155 single-element-in-a-sorted-array πŸ“— Medium LeetCode Array
156 single-number-iii πŸ“— Medium LeetCode Array
157 arithmetic-slices πŸ“— Medium LeetCode Math,DP
158 palindromic-substrings πŸ“— Medium LeetCode String,DP
159 maximum-xor-of-two-numbers-in-an-array πŸ“— Medium LeetCode Bit
160 sort-characters-by-frequency πŸ“— Medium LeetCode HashTable
161 rotate-string πŸ“— Medium LeetCode String
162 product-of-array-except-self πŸ“— Medium LeetCode Array
163 teemo-attacking πŸ“— Medium LeetCode Array
164 queue-reconstruction-by-height πŸ“— Medium LeetCode Greedy
165 4sum-ii πŸ“— Medium LeetCode HashTable
166 01-matrix πŸ“— Medium LeetCode HashTable
167 3sum πŸ“— Medium LeetCode TwoPointers
168 3sum-closest πŸ“— Medium LeetCode TwoPointers
169 4Sum πŸ“— Medium LeetCode TwoPointers
170 add-two-numbers πŸ“— Medium LeetCode LinkedList
171 add-two-numbers-ii πŸ“— Medium LeetCode LinkedList
172 add-and-search-word-data-structure-design πŸ“— Medium LeetCode LinkedList
173 additive-number πŸ“— Medium LeetCode String
174 assign-cookies πŸ“— Easy LeetCode Greedy
175 basic-calculator πŸ“— Medium LeetCode Stack
176 basic-calculator-ii πŸ“— Medium LeetCode Stack
177 target-sum πŸ“— Medium LeetCode DP
178 implement-queue-using-stacks πŸ“— Easy LeetCode Stack
179 implement-stack-using-queues πŸ“— Easy LeetCode Stack
180 next-greater-element-ii πŸ“— Medium LeetCode Stack
181 binary-tree-tilt πŸ“— Easy LeetCode Tree
182 diameter-of-binary-tree πŸ“— Easy LeetCode Tree
183 symmetric-tree πŸ“— Easy LeetCode Tree
184 second-minimum-node-in-a-binary-tree πŸ“— Easy LeetCode Tree
185 subtree-of-another-tree πŸ“— Easy LeetCode Tree
186 binary-tree-paths πŸ“— Easy LeetCode DFS
187 path-sum πŸ“— Easy LeetCode DFS
188 minimum-depth-of-binary-tree πŸ“— Easy LeetCode DFS
189 find-bottom-left-tree-value πŸ“— Medium LeetCode DFS
190 decode-string πŸ“— Medium LeetCode DFS,Stack
191 find-largest-value-in-each-tree-row πŸ“— Medium LeetCode DFS
192 max-area-of-island πŸ“— Easy LeetCode DFS
193 flood-fill πŸ“— Easy LeetCode DFS
194 balanced-binary-tree πŸ“— Easy LeetCode DFS
195 friend-circles πŸ“— Medium LeetCode DFS
196 house-robber-iii πŸ“— Medium LeetCode DFS
197 increasing-subsequences πŸ“— Medium LeetCode DFS
198 sum-root-to-leaf-numbers πŸ“— Medium LeetCode DFS
199 number-of-islands πŸ“— Medium LeetCode DFS
200 path-sum-ii πŸ“— Medium LeetCode DFS
201 matchsticks-to-square πŸ“— Medium LeetCode DFS
202 two-sum πŸ“— Easy LeetCode Array
203 unique-morse-code-words πŸ“— Easy LeetCode Hash
204 image-smoother πŸ“— Easy LeetCode Array
205 pascals-triangle πŸ“— Easy LeetCode Array
206 pascals-triangle-ii πŸ“— Easy LeetCode Array
207 shortest-unsorted-continuous-subarray πŸ“— Easy LeetCode Array
208 Non-decreasingArray πŸ“— Easy LeetCode Array
209 range-addition-ii πŸ“— Easy LeetCode Math
210 repeated-string-match πŸ“— Easy LeetCode Math
211 house-robber πŸ“— Easy LeetCode DP
212 minimum-ascii-delete-sum-for-two-strings πŸ“— Medium LeetCode DP
213 maximum-length-of-pair-chain πŸ“— Medium LeetCode DP,Greedy
214 integer-break πŸ“— Medium LeetCode DP
215 count-numbers-with-unique-digits πŸ“— Medium LeetCode DP
216 best-time-to-buy-and-sell-stock-with-transaction-fee πŸ“— Medium LeetCode DP,Greedy
217 shopping-offers πŸ“— Medium LeetCode DP,DFS
218 predict-the-winner πŸ“— Medium LeetCode DP
219 2-keys-keyboard πŸ“— Medium LeetCode DP
220 is-subsequence πŸ“— Medium LeetCode DP
221 delete-and-earn πŸ“— Medium LeetCode DP
222 longest-palindromic-subsequence πŸ“— Medium LeetCode DP
223 combination-sum-iv πŸ“— Medium LeetCode DP
224 maximum-length-of-repeated-subarray πŸ“— Medium LeetCode DP
225 minimum-path-sum πŸ“— Medium LeetCode DP
226 largest-sum-of-averages πŸ“— Medium LeetCode DP
227 longest-increasing-subsequence πŸ“— Medium LeetCode DP
228 partition-equal-subset-sum πŸ“— Medium LeetCode DP
229 flipping-an-image πŸ“— Easy LeetCode Array
230 positions-of-large-groups πŸ“— Easy LeetCode Array
231 magic-squares-in-grid πŸ“— Easy LeetCode Array
232 array-nesting πŸ“— Medium LeetCode Array
233 combination-sum-iii πŸ“— Medium LeetCode Backtracking
234 subsets πŸ“— Medium LeetCode Backtracking
235 my-calendar-i πŸ“— Medium LeetCode Array
236 combination-sum πŸ“— Medium LeetCode Backtracking
237 spiral-matrix-ii πŸ“— Medium LeetCode Backtracking
238 number-of-subarrays-with-bounded-maximum πŸ“— Medium LeetCode Array
239 subarray-sum-equals-k πŸ“— Medium LeetCode HashTable
240 sort-colors πŸ“— Medium LeetCode HashTable
241 subsets-ii πŸ“— Medium LeetCode Backtracking
242 summary-ranges πŸ“— Medium LeetCode Array
243 merge-intervals πŸ“— Medium LeetCode Array
244 minimum-moves-to-equal-array-elements πŸ“— Easy LeetCode Math
245 minimum-moves-to-equal-array-elements-ii πŸ“— Easy LeetCode Math
246 backspace-string-compare πŸ“— Easy LeetCode Stack
247 partition-labels πŸ“— Medium LeetCode TwoPointers,Greedy
248 peak-index-in-a-mountain-array πŸ“— Easy LeetCode BinarySearch
249 goat-latin πŸ“— Easy LeetCode String
250 custom-sort-string πŸ“— Medium LeetCode String
251 nth-digit πŸ“— Easy LeetCode Math
252 transpose-matrix πŸ“— Easy LeetCode Array
253 maximize-distance-to-closest-person πŸ“— Easy LeetCode Array
254 bulls-and-cows πŸ“— Medium LeetCode HashTable
255 construct-the-rectangle πŸ“— Easy LeetCode Math
256 most-common-word πŸ“— Easy LeetCode String
257 shortest-distance-to-a-character πŸ“— Easy LeetCode String
258 binary-gap πŸ“— Easy LeetCode String
259 lemonade-change πŸ“— Easy LeetCode Greedy
260 excel-sheet-column-title πŸ“— Easy LeetCode Math
261 largest-triangle-area πŸ“— Easy LeetCode Math
262 reordered-power-of-2 πŸ“— Medium LeetCode Math
263 spiral-matrix Medium LeetCode Math
264 long-pressed-name Easy LeetCode String
265 uncommon-words-from-two-sentences Easy LeetCode String
266 reverse-only-letters Easy LeetCode String
267 powerful-integers Easy LeetCode Math
268 minimum-add-to-make-parentheses-valid Easy LeetCode String

Collaborators


weikun tang