Skip to content

tangweikun/leetcode

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