/LeetCode

LeetCode Problems' Solutions

Primary LanguageJupyter Notebook

LeetCode

LeetCode Algorithm

Solutions of 111 algorithm problems starting from the highest pass rate on LeetCode.

Updating 1 problem everyday.

Notes:

"♥" means you need to buy a book from Leetcode

"♦" means I need to review that question again

Title Solution Difficulty Remark
1 Two Sum Python3 Easy
3 Longest Substring Without Repeating Characters Python3 Medium
5 Longest Palindromic Substring Python3 Medium
9 Palindrome Number Python3 Easy
10 Regular Expression Matching Python3 Hard
15 3Sum Python3 Medium
36 Valid Sudoku Python3 Medium
38 Count and Say Python3 Medium
39 Combination Sum Python3 Medium
40 Combination Sum II Python3 Medium
43 Multiply Strings Python3 Medium
44 Wildcard Matching Python3 Hard
46 Permutations Python3 Medium
50 Pow(x, n) Python3 Medium
53 Maximum Subarray Python3 Easy
70 Climbing Stairs Python3 Easy
89 Gray Code Python3 Medium
104 Single Number C++ Easy
136 Single Number C++ Easy
150 Evaluate Reverse Polish Notation Python3 Medium
169 Majority Element C++ Easy
206 Reverse Linked List Python3 Easy
237 Delete Node in a Linked List Python3 Easy
226 Invert Binary Tree C++ Easy
258 Add Digits C++ Easy
260 Single Number III C++ Medium
283 Move Zeroes C++ Easy
292 Nim Game C++ Easy
338 Counting Bits C++ Easy
343 Integer Break Python3 Medium
344 Reverse String C++ Easy
371 Sum of Two Integers C++ Easy
389 Find the Difference C++ Easy
406 Queue Reconstruction by Height C++ Medium
409 Longest Palindrome Python3 Easy
412 Fizz Buzz C++ Easy
413 Arithmetic Slices C++ Medium
419 Battleships in a Board C++ Medium
442 Find All Duplicates in an Array C++ Medium
448 Find All Numbers Disappeared in an Array C++ Easy
451 Sort Characters By Frequency C++ Medium
461 Hamming Distance C++ Easy
462 Minimum Moves to Equal Array Elements II C++ Medium
463 Island Perimeter C++ Easy
476 Number Complement C++ Easy
485 Max Consecutive Ones C++ Easy
495 Teemo Attacking C++ Medium
496 Next Greater Element I C++ Easy
500 Keyboard Row C++ Easy
508 Most Frequent Subtree Sum C++ Medium
513 Find Bottom Left Tree Value C++ Medium
515 Find Largest Value in Each Tree Row C++ Medium
520 Detect Capital C++ Easy
521 Longest Uncommon Subsequence I C++ Easy
526 Beautiful Arrangement C++ Medium
535 Encode and Decode TinyURL C++ Medium
537 Complex Number Multiplication C++ Medium
540 Single Element in a Sorted Array C++ Medium
553 SOptimal Division C++ Medium
557 Reverse Words in a String III C++ Easy
561 Array Partition I C++ Easy
566 Reshape the Matrix C++ Easy
575 Distribute Candies C++ Easy
589 N-ary Tree Preorder Traversal Python3 Easy
590 N-ary Tree Postorder Traversal Python3 Easy
609 Find Duplicate File in System C++ Medium
617 Merge Two Binary Trees C++ Easy
621 Task Scheduler Python3 Medium
637 Average of Levels in Binary Tree C++ Easy
641 Design Circular Deque Python3 Medium
647 Palindromic Substrings C++ Medium
654 Maximum Binary Tree C++ Medium
657 Judge Route Circle C++ Easy
665 Non-decreasing Array Python3 Easy
667 Beautiful Arrangement II C++ Medium
669 Trim a Binary Search Tree C++ Easy
677 Map Sum Pairs C++ Medium
682 Baseball Game C++ Easy
690 Employee Importance C++ Easy
693 Binary Number with Alternating Bits C++ Easy
695 Max Area of Island C++ Easy
696 Count Binary Substrings C++ Easy
701 Insert into a Binary Search Tree Python3 Medium
709 To Lower Case Python3 Easy
712 Minimum ASCII Delete Sum for Two Strings C++ Medium
728 Self Dividing Numbers C++ Easy
739 Daily Temperatures C++ Medium
748 Shortest Completing Word C++ Medium
762 Prime Number of Set Bits in Binary Representation C++ Easy
763 Partition Labels C++ Medium
766 Toeplitz Matrix C++ Easy
771 Jewels and Stones C++ Easy
784 Letter Case Permutation C++ Easy
788 Rotated Digits C++ Easy
789 Escape The Ghosts C++ Medium
791 Custom Sort String C++ Medium
796 Rotate String C++ Easy
797 All Paths From Source to Target C++ Medium
804 Unique Morse Code Words Python3 Easy
812 Largest Triangle Area C++ Easy
814 Binary Tree Pruning Python3 Medium
817 Linked List Components Python3 Medium
890 Find and Replace Pattern Python3 Medium
893 Groups of Special-Equivalent Strings Python3 Easy
912 Sort an Array Python3 Medium
933 Number of Recent Calls Python3 Easy
979 Distribute Coins in Binary Tree Python3 Medium
980 Unique Paths III Python3 Hard
983 Minimum Cost For Tickets Python3 Medium
1021 Remove Outermost Parentheses Python3 Easy
1108 Defanging an IP Address Python3 Easy