Coder Social home page Coder Social logo

lc-all-solutions's Introduction

leetcode solutions using python

This is my leetcode solution folder.

Language: python

Last updated: 2017-06-13

I've solved 547/547 problems (101 problems for a fee).

The source code was fetched using the tool leetcode-spider.

# Problems Solutions Difficulty
001 two-sum python Easy
002 add-two-numbers python Medium
003 longest-substring-without-repeating-characters python Medium
004 median-of-two-sorted-arrays python hard
005 longest-palindromic-substring python Medium
006 zigzag-conversion python Medium
007 reverse-integer python Easy
008 string-to-integer-atoi python Medium
009 palindrome-number python Easy
010 regular-expression-matching python hard
011 container-with-most-water python Medium
012 integer-to-roman python Medium
013 roman-to-integer python Easy
014 longest-common-prefix python Easy
015 3sum python Medium
016 3sum-closest python Medium
017 letter-combinations-of-a-phone-number python Medium
018 4sum python Medium
019 remove-nth-node-from-end-of-list python Medium
020 valid-parentheses python Easy
021 merge-two-sorted-lists python Easy
022 generate-parentheses python Medium
023 merge-k-sorted-lists python hard
024 swap-nodes-in-pairs python Medium
025 reverse-nodes-in-k-group python hard
026 remove-duplicates-from-sorted-array python Easy
027 remove-element python Easy
028 implement-strstr python Easy
029 divide-two-integers python Medium
030 substring-with-concatenation-of-all-words python hard
031 next-permutation python Medium
032 longest-valid-parentheses python hard
033 search-in-rotated-sorted-array python Medium
034 search-for-a-range python Medium
035 search-insert-position python Easy
036 valid-sudoku python Medium
037 sudoku-solver python hard
038 count-and-say python Easy
039 combination-sum python Medium
040 combination-sum-ii python Medium
041 first-missing-positive python hard
042 trapping-rain-water python hard
043 multiply-strings python Medium
044 wildcard-matching python hard
045 jump-game-ii python hard
046 permutations python Medium
047 permutations-ii python Medium
048 rotate-image python Medium
049 anagrams python Medium
050 powx-n python Medium
051 n-queens python hard
052 n-queens-ii python hard
053 maximum-subarray python Easy
054 spiral-matrix python Medium
055 jump-game python Medium
056 merge-intervals python Medium
057 insert-interval python hard
058 length-of-last-word python Easy
059 spiral-matrix-ii python Medium
060 permutation-sequence python Medium
061 rotate-list python Medium
062 unique-paths python Medium
063 unique-paths-ii python Medium
064 minimum-path-sum python Medium
065 valid-number python hard
066 plus-one python Easy
067 add-binary python Easy
068 text-justification python hard
069 sqrtx python Easy
070 climbing-stairs python Easy
071 simplify-path python Medium
072 edit-distance python hard
073 set-matrix-zeroes python Medium
074 search-a-2d-matrix python Medium
075 sort-colors python Medium
076 minimum-window-substring python hard
077 combinations python Medium
078 subsets python Medium
079 word-search python Medium
080 remove-duplicates-from-sorted-array-ii python Medium
081 search-in-rotated-sorted-array-ii python Medium
082 remove-duplicates-from-sorted-list-ii python Medium
083 remove-duplicates-from-sorted-list python Easy
084 largest-rectangle-in-histogram python hard
085 maximal-rectangle python hard
086 partition-list python Medium
087 scramble-string python hard
088 merge-sorted-array python Easy
089 gray-code python Medium
090 subsets-ii python Medium
091 decode-ways python Medium
092 reverse-linked-list-ii python Medium
093 restore-ip-addresses python Medium
094 binary-tree-inorder-traversal python Medium
095 unique-binary-search-trees-ii python Medium
096 unique-binary-search-trees python Medium
097 interleaving-string python hard
098 validate-binary-search-tree python Medium
099 recover-binary-search-tree python hard
100 same-tree python Easy
101 symmetric-tree python Easy
102 binary-tree-level-order-traversal python Medium
103 binary-tree-zigzag-level-order-traversal python Medium
104 maximum-depth-of-binary-tree python Easy
105 construct-binary-tree-from-preorder-and-inorder-traversal python Medium
106 construct-binary-tree-from-inorder-and-postorder-traversal python Medium
107 binary-tree-level-order-traversal-ii python Easy
108 convert-sorted-array-to-binary-search-tree python Easy
109 convert-sorted-list-to-binary-search-tree python Medium
110 balanced-binary-tree python Easy
111 minimum-depth-of-binary-tree python Easy
112 path-sum python Easy
113 path-sum-ii python Medium
114 flatten-binary-tree-to-linked-list python Medium
115 distinct-subsequences python hard
116 populating-next-right-pointers-in-each-node python Medium
117 populating-next-right-pointers-in-each-node-ii python Medium
118 pascals-triangle python Easy
119 pascals-triangle-ii python Easy
120 triangle python Medium
121 best-time-to-buy-and-sell-stock python Easy
122 best-time-to-buy-and-sell-stock-ii python Easy
123 best-time-to-buy-and-sell-stock-iii python hard
124 binary-tree-maximum-path-sum python hard
125 valid-palindrome python Easy
126 word-ladder-ii python hard
127 word-ladder python Medium
128 longest-consecutive-sequence python hard
129 sum-root-to-leaf-numbers python Medium
130 surrounded-regions python Medium
131 palindrome-partitioning python Medium
132 palindrome-partitioning-ii python hard
133 clone-graph python Medium
134 gas-station python Medium
135 candy python hard
136 single-number python Easy
137 single-number-ii python Medium
138 copy-list-with-random-pointer python Medium
139 word-break python Medium
140 word-break-ii python hard
141 linked-list-cycle python Easy
142 linked-list-cycle-ii python Medium
143 reorder-list python Medium
144 binary-tree-preorder-traversal python Medium
145 binary-tree-postorder-traversal python hard
146 lru-cache python hard
147 insertion-sort-list python Medium
148 sort-list python Medium
149 max-points-on-a-line python hard
150 evaluate-reverse-polish-notation python Medium
151 reverse-words-in-a-string python Medium
152 maximum-product-subarray python Medium
153 find-minimum-in-rotated-sorted-array python Medium
154 find-minimum-in-rotated-sorted-array-ii python hard
155 min-stack python Easy
156 binary-tree-upside-down python Medium
157 read-n-characters-given-read4 python Easy
158 read-n-characters-given-read4-ii-call-multiple-times python hard
159 longest-substring-with-at-most-two-distinct-characters python hard
160 intersection-of-two-linked-lists python Easy
161 one-edit-distance python Medium
162 find-peak-element python Medium
163 missing-ranges python Medium
164 maximum-gap python hard
165 compare-version-numbers python Medium
166 fraction-to-recurring-decimal python Medium
167 two-sum-ii-input-array-is-sorted python Easy
168 excel-sheet-column-title python Easy
169 majority-element python Easy
170 two-sum-iii-data-structure-design python Easy
171 excel-sheet-column-number python Easy
172 factorial-trailing-zeroes python Easy
173 binary-search-tree-iterator python Medium
174 dungeon-game python hard
179 largest-number python Medium
186 reverse-words-in-a-string-ii python Medium
187 repeated-dna-sequences python Medium
188 best-time-to-buy-and-sell-stock-iv python hard
189 rotate-array python Easy
190 reverse-bits python Easy
191 number-of-1-bits python Easy
198 house-robber python Easy
199 binary-tree-right-side-view python Medium
200 number-of-islands python Medium
201 bitwise-and-of-numbers-range python Medium
202 happy-number python Easy
203 remove-linked-list-elements python Easy
204 count-primes python Easy
205 isomorphic-strings python Easy
206 reverse-linked-list python Easy
207 course-schedule python Medium
208 implement-trie-prefix-tree python Medium
209 minimum-size-subarray-sum python Medium
210 course-schedule-ii python Medium
211 add-and-search-word-data-structure-design python Medium
212 word-search-ii python hard
213 house-robber-ii python Medium
214 shortest-palindrome python hard
215 kth-largest-element-in-an-array python Medium
216 combination-sum-iii python Medium
217 contains-duplicate python Easy
218 the-skyline-problem python hard
219 contains-duplicate-ii python Easy
220 contains-duplicate-iii python Medium
221 maximal-square python Medium
222 count-complete-tree-nodes python Medium
223 rectangle-area python Medium
224 basic-calculator python hard
225 implement-stack-using-queues python Easy
226 invert-binary-tree python Easy
227 basic-calculator-ii python Medium
228 summary-ranges python Medium
229 majority-element-ii python Medium
230 kth-smallest-element-in-a-bst python Medium
231 power-of-two python Easy
232 implement-queue-using-stacks python Easy
233 number-of-digit-one python hard
234 palindrome-linked-list python Easy
235 lowest-common-ancestor-of-a-binary-search-tree python Easy
236 lowest-common-ancestor-of-a-binary-tree python Medium
237 delete-node-in-a-linked-list python Easy
238 product-of-array-except-self python Medium
239 sliding-window-maximum python hard
240 search-a-2d-matrix-ii python Medium
241 different-ways-to-add-parentheses python Medium
242 valid-anagram python Easy
243 shortest-word-distance python Easy
244 shortest-word-distance-ii python Medium
245 shortest-word-distance-iii python Medium
246 strobogrammatic-number python Easy
247 strobogrammatic-number-ii python Medium
248 strobogrammatic-number-iii python hard
249 group-shifted-strings python Medium
250 count-univalue-subtrees python Medium
251 flatten-2d-vector python Medium
252 meeting-rooms python Easy
253 meeting-rooms-ii python Medium
254 factor-combinations python Medium
255 verify-preorder-sequence-in-binary-search-tree python Medium
256 paint-house python Easy
257 binary-tree-paths python Easy
258 add-digits python Easy
259 3sum-smaller python Medium
260 single-number-iii python Medium
261 graph-valid-tree python Medium
263 ugly-number python Easy
264 ugly-number-ii python Medium
265 paint-house-ii python hard
266 palindrome-permutation python Easy
267 palindrome-permutation-ii python Medium
268 missing-number python Easy
269 alien-dictionary python hard
270 closest-binary-search-tree-value python Easy
271 encode-and-decode-strings python Medium
272 closest-binary-search-tree-value-ii python hard
273 integer-to-english-words python hard
274 h-index python Medium
275 h-index-ii python Medium
276 paint-fence python Easy
277 find-the-celebrity python Medium
278 first-bad-version python Easy
279 perfect-squares python Medium
280 wiggle-sort python Medium
281 zigzag-iterator python Medium
282 expression-add-operators python hard
283 move-zeroes python Easy
284 peeking-iterator python Medium
285 inorder-successor-in-bst python Medium
286 walls-and-gates python Medium
287 find-the-duplicate-number python Medium
288 unique-word-abbreviation python Medium
289 game-of-life python Medium
290 word-pattern python Easy
291 word-pattern-ii python hard
292 nim-game python Easy
293 flip-game python Easy
294 flip-game-ii python Medium
295 find-median-from-data-stream python hard
296 best-meeting-point python hard
297 serialize-and-deserialize-binary-tree python hard
298 binary-tree-longest-consecutive-sequence python Medium
299 bulls-and-cows python Medium
300 longest-increasing-subsequence python Medium
301 remove-invalid-parentheses python hard
302 smallest-rectangle-enclosing-black-pixels python hard
303 range-sum-query-immutable python Easy
304 range-sum-query-2d-immutable python Medium
305 number-of-islands-ii python hard
306 additive-number python Medium
307 range-sum-query-mutable python Medium
308 range-sum-query-2d-mutable python hard
309 best-time-to-buy-and-sell-stock-with-cooldown python Medium
310 minimum-height-trees python Medium
311 sparse-matrix-multiplication python Medium
312 burst-balloons python hard
313 super-ugly-number python Medium
314 binary-tree-vertical-order-traversal python Medium
315 count-of-smaller-numbers-after-self python hard
316 remove-duplicate-letters python hard
317 shortest-distance-from-all-buildings python hard
318 maximum-product-of-word-lengths python Medium
319 bulb-switcher python Medium
320 generalized-abbreviation python Medium
321 create-maximum-number python hard
322 coin-change python Medium
323 number-of-connected-components-in-an-undirected-graph python Medium
324 wiggle-sort-ii python Medium
325 maximum-size-subarray-sum-equals-k python Medium
326 power-of-three python Easy
327 count-of-range-sum python hard
328 odd-even-linked-list python Medium
329 longest-increasing-path-in-a-matrix python hard
330 patching-array python hard
331 verify-preorder-serialization-of-a-binary-tree python Medium
332 reconstruct-itinerary python Medium
333 largest-bst-subtree python Medium
334 increasing-triplet-subsequence python Medium
335 self-crossing python hard
336 palindrome-pairs python hard
337 house-robber-iii python Medium
338 counting-bits python Medium
339 nested-list-weight-sum python Easy
340 longest-substring-with-at-most-k-distinct-characters python hard
341 flatten-nested-list-iterator python Medium
342 power-of-four python Easy
343 integer-break python Medium
344 reverse-string python Easy
345 reverse-vowels-of-a-string python Easy
346 moving-average-from-data-stream python Easy
347 top-k-frequent-elements python Medium
348 design-tic-tac-toe python Medium
349 intersection-of-two-arrays python Easy
350 intersection-of-two-arrays-ii python Easy
351 android-unlock-patterns python Medium
352 data-stream-as-disjoint-intervals python hard
353 design-snake-game python Medium
354 russian-doll-envelopes python hard
355 design-twitter python Medium
356 line-reflection python Medium
357 count-numbers-with-unique-digits python Medium
358 rearrange-string-k-distance-apart python hard
359 logger-rate-limiter python Easy
360 sort-transformed-array python Medium
361 bomb-enemy python Medium
362 design-hit-counter python Medium
363 max-sum-of-sub-matrix-no-larger-than-k python hard
364 nested-list-weight-sum-ii python Medium
365 water-and-jug-problem python Medium
366 find-leaves-of-binary-tree python Medium
367 valid-perfect-square python Easy
368 largest-divisible-subset python Medium
369 plus-one-linked-list python Medium
370 range-addition python Medium
371 sum-of-two-integers python Easy
372 super-pow python Medium
373 find-k-pairs-with-smallest-sums python Medium
374 guess-number-higher-or-lower python Easy
375 guess-number-higher-or-lower-ii python Medium
376 wiggle-subsequence python Medium
377 combination-sum-iv python Medium
378 kth-smallest-element-in-a-sorted-matrix python Medium
379 design-phone-directory python Medium
380 insert-delete-getrandom-o1 python Medium
381 insert-delete-getrandom-o1-duplicates-allowed python hard
382 linked-list-random-node python Medium
383 ransom-note python Easy
384 shuffle-an-array python Medium
385 mini-parser python Medium
386 lexicographical-numbers python Medium
387 first-unique-character-in-a-string python Easy
388 longest-absolute-file-path python Medium
389 find-the-difference python Easy
390 elimination-game python Medium
391 perfect-rectangle python hard
392 is-subsequence python Medium
393 utf-8-validation python Medium
394 decode-string python Medium
395 longest-substring-with-at-least-k-repeating-characters python Medium
396 rotate-function python Medium
397 integer-replacement python Medium
398 random-pick-index python Medium
399 evaluate-division python Medium
400 nth-digit python Easy
401 binary-watch python Easy
402 remove-k-digits python Medium
403 frog-jump python hard
404 sum-of-left-leaves python Easy
405 convert-a-number-to-hexadecimal python Easy
406 queue-reconstruction-by-height python Medium
407 trapping-rain-water-ii python hard
408 valid-word-abbreviation python Easy
409 longest-palindrome python Easy
410 split-array-largest-sum python hard
411 minimum-unique-word-abbreviation python hard
412 fizz-buzz python Easy
413 arithmetic-slices python Medium
414 third-maximum-number python Easy
415 add-strings python Easy
416 partition-equal-subset-sum python Medium
417 pacific-atlantic-water-flow python Medium
418 sentence-screen-fitting python Medium
419 battleships-in-a-board python Medium
420 strong-password-checker python hard
421 maximum-xor-of-two-numbers-in-an-array python Medium
422 valid-word-square python Easy
423 reconstruct-original-digits-from-english python Medium
424 longest-repeating-character-replacement python Medium
425 word-squares python hard
432 all-oone-data-structure python hard
434 number-of-segments-in-a-string python Easy
435 non-overlapping-intervals python Medium
436 find-right-interval python Medium
437 path-sum-iii python Easy
438 find-all-anagrams-in-a-string python Easy
439 ternary-expression-parser python Medium
440 k-th-smallest-in-lexicographical-order python hard
441 arranging-coins python Easy
442 find-all-duplicates-in-an-array python Medium
444 sequence-reconstruction python Medium
445 add-two-numbers-ii python Medium
446 arithmetic-slices-ii-subsequence python hard
447 number-of-boomerangs python Easy
448 find-all-numbers-disappeared-in-an-array python Easy
449 serialize-and-deserialize-bst python Medium
450 delete-node-in-a-bst python Medium
451 sort-characters-by-frequency python Medium
452 minimum-number-of-arrows-to-burst-balloons python Medium
453 minimum-moves-to-equal-array-elements python Easy
454 4sum-ii python Medium
455 assign-cookies python Easy
456 132-pattern python Medium
459 repeated-substring-pattern python Easy
460 lfu-cache python hard
461 hamming-distance python Easy
462 minimum-moves-to-equal-array-elements-ii python Medium
463 island-perimeter python Easy
464 can-i-win python Medium
465 optimal-account-balancing python hard
466 count-the-repetitions python hard
467 unique-substrings-in-wraparound-string python Medium
468 validate-ip-address python Medium
469 convex-polygon python Medium
471 encode-string-with-shortest-length python hard
472 concatenated-words python hard
473 matchsticks-to-square python Medium
474 ones-and-zeroes python Medium
475 heaters python Easy
476 number-complement python Easy
477 total-hamming-distance python Medium
480 sliding-window-median python hard
481 magical-string python Medium
482 license-key-formatting python Medium
483 smallest-good-base python hard
484 find-permutation python Medium
485 max-consecutive-ones python Easy
486 predict-the-winner python Medium
487 max-consecutive-ones-ii python Medium
488 zuma-game python hard
490 the-maze python Medium
491 increasing-subsequences python Medium
492 construct-the-rectangle python Easy
493 reverse-pairs python hard
494 target-sum python Medium
495 teemo-attacking python Medium
496 next-greater-element-i python Easy
498 diagonal-traverse python Medium
499 the-maze-iii python hard
500 keyboard-row python Easy
501 find-mode-in-binary-search-tree python Easy
502 ipo python hard
503 next-greater-element-ii python Medium
504 base-7 python Easy
505 the-maze-ii python Medium
506 relative-ranks python Easy
507 perfect-number python Easy
508 most-frequent-subtree-sum python Medium
513 find-bottom-left-tree-value python Medium
514 freedom-trail python hard
515 find-largest-value-in-each-tree-row python Medium
516 longest-palindromic-subsequence python Medium
517 super-washing-machines python hard
520 detect-capital python Easy
521 longest-uncommon-subsequence-i python Easy
522 longest-uncommon-subsequence-ii python Medium
523 continuous-subarray-sum python Medium
524 longest-word-in-dictionary-through-deleting python Medium
525 contiguous-array python Medium
526 beautiful-arrangement python Medium
527 word-abbreviation python hard
529 minesweeper python Medium
530 minimum-absolute-difference-in-bst python Easy
531 lonely-pixel-i python Medium
532 k-diff-pairs-in-an-array python Easy
533 lonely-pixel-ii python Medium
535 encode-and-decode-tinyurl python Medium
536 construct-binary-tree-from-string python Medium
537 complex-number-multiplication python Medium
538 convert-bst-to-greater-tree python Medium
539 minimum-time-difference python Medium
541 reverse-string-ii python Easy
542 01-matrix python Medium
543 diameter-of-binary-tree python Easy
544 output-contest-matches python Medium
545 boundary-of-binary-tree python Medium
546 remove-boxes python hard
547 friend-circles python Medium
548 split-array-with-equal-sum python Medium
549 binary-tree-longest-consecutive-sequence-ii python Medium
551 student-attendance-record-i python Easy
552 student-attendance-record-ii python hard
553 optimal-division python Medium
554 brick-wall python Medium
555 split-concatenated-strings python Medium
556 next-greater-element-iii python Medium
557 reverse-words-in-a-string-iii python Easy
560 subarray-sum-equals-k python Medium
561 array-partition-i python Easy
562 longest-line-of-consecutive-one-in-matrix python Medium
563 binary-tree-tilt python Easy
564 find-the-closest-palindrome python hard
565 array-nesting python Medium
566 reshape-the-matrix python Easy
567 permutation-in-string python Medium
568 maximum-vacation-days python hard
572 subtree-of-another-tree python Easy
573 squirrel-simulation python Medium
575 distribute-candies python Easy
576 out-of-boundary-paths python hard
581 shortest-unsorted-continuous-subarray python Easy
582 kill-process python Medium
583 delete-operation-for-two-strings python Medium
587 erect-the-fence python hard
588 design-in-memory-file-system python hard
591 tag-validator python hard
592 fraction-addition-and-subtraction python Medium
593 valid-square python Medium
594 longest-harmonious-subsequence python Easy
598 range-addition-ii python Easy
599 minimum-index-sum-of-two-lists python Easy
600 non-negative-integers-without-consecutive-ones python hard
604 design-compressed-string-iterator python Easy
605 can-place-flowers python Easy
606 construct-string-from-binary-tree python Easy
609 find-duplicate-file-in-system python Medium
611 valid-triangle-number python Medium
616 add-bold-tag-in-string python Medium
617 merge-two-binary-trees python Easy

lc-all-solutions's People

Contributors

csujedihy avatar

Watchers

Yune avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.