https://github.com/xxrjun/leetcode-python
Record of my leetcode journey. Solutions in python3.
https://github.com/xxrjun/leetcode-python
leetcode-python leetcode-solutions mysql pyhton python3
Last synced: 10 months ago
JSON representation
Record of my leetcode journey. Solutions in python3.
- Host: GitHub
- URL: https://github.com/xxrjun/leetcode-python
- Owner: xxrjun
- Created: 2022-07-11T03:03:58.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2022-09-20T06:08:59.000Z (over 3 years ago)
- Last Synced: 2024-11-15T02:38:47.091Z (about 1 year ago)
- Topics: leetcode-python, leetcode-solutions, mysql, pyhton, python3
- Language: Python
- Homepage:
- Size: 129 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# LeetCode Python
Start from 2022/07/11.
## Study Plan
| Study Plan (with leetcode link) | Code | Start At | Update | Day | Done |
| ------------------------------------------------------------------- | :-----------------------------------------: | -------- | -------- | ------------- | ------------------ |
| [Date Structure I](https://leetcode.com/study-plan/data-structure/) | [:link: link](./study-plan/ds-1/) | 22/07/11 | 22/07/18 | **_14 / 14_** | :white_check_mark: |
| [Algorithm I](https://leetcode.com/study-plan/algorithm/) | [:link: link](./study-plan/algo-1/) | 22/07/28 | 22/08/10 | **_14 / 14_** | :white_check_mark: |
| [Binary Search I](https://leetcode.com/study-plan/binary-search/) | [:link: link](./study-plan/binarysearch-1/) | 22/08/11 | 22/08/22 | **_12/ 12_** | :white_check_mark: |
## Resources
| Videos (Youtube) | Language | Programming Language |
| -------------------------------------------------------------------------------------------------------------------- | :------: | -------------------- |
| [NeetCode](https://www.youtube.com/c/NeetCode) | English | Python |
| [今天比昨天厲害](https://www.youtube.com/c/%E4%BB%8A%E5%A4%A9%E6%AF%94%E6%98%A8%E5%A4%A9%E5%8E%B2%E5%AE%B3/featured) | 中文 | Python |
| [花花醬 Hua Hua](https://www.youtube.com/c/HuaHuaLeetCode) | 中文 | C++ |
## Problems & Solutions
### [Solution Code in Python3](./solutions-python3/)
| # | Title | Level | Solution | Category |
| ---- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------ | ---------------------------------------------------------------------------------- | ------------------------------------ |
| 1 | [Two Sum](https://leetcode.com/problems/two-sum/) | Easy | [python](./solutions-python3/1-TwoSum.py) | Array, Hash Table |
| 3 | [Longest Substring Without Repeating Characters](https://leetcode.com/problems/longest-substring-without-repeating-characters/) | Medium | [python](./solutions-python3/3-LongestSubstringWithoutRepeatingCharacters.py) | Hash Table, String |
| 19 | [Remove Nth Node From End of List](https://leetcode.com/problems/remove-nth-node-from-end-of-list/) | Medium | [python](./solutions-python3/19-RemoveNthNodeFromEndofList.py) | Linked List, Two Pointers |
| 20 | [Valid Parentheses](https://leetcode.com/problems/valid-parentheses/) | Easy | [python](./solutions-python3/20-ValidParentheses.py) | Stack, String |
| 21 | [Merge Two Sorted Lists](https://leetcode.com/problems/merge-two-sorted-lists/) | Easy | [python](./solutions-python3/21-MergeTwoSortedLists.py) | Linked List, Recursions |
| 33 | [Search in Rotated Sorted Array](https://leetcode.com/problems/search-in-rotated-sorted-array/) | Medium | [python](./solutions-python3/33-SearchinRotatedSortedArray.py) | Array, Binary Search |
| 34 | [Find First and Last Position of Element in Sorted Array](https://leetcode.com/problems/find-first-and-last-position-of-element-in-sorted-array/) | Medium | [python](./solutions-python3/34-FindFirstandLastPositionofElementinSortedArray.py) | Array, Binary Search |
| 35 | [Search Insert Position](https://leetcode.com/problems/search-insert-position/) | Easy | [python](./solutions-python3/35-SearchInsertPosition.py) | Array, Binary Search |
| 36 | [Valid Sudoku](https://leetcode.com/problems/valid-sudoku/) | Medium | [python](./solutions-python3/36-ValidSudoku.py) | Array, Hash Table |
| 46 | [Permutations](https://leetcode.com/problems/permutations/) | Medium | [python](./solutions-python3/46-Permutations.py) | Array, Backtracking |
| 53 | [Maximum Subarray](https://leetcode.com/problems/maximum-subarray/) | Medium | [python](./solutions-python3/53-MaximumSubarray.py) | Array |
| 69 | [Sqrt(x)](https://leetcode.com/problems/sqrtx/) | Easy | [python](<./solutions-python3/69-Sqrt(x).py>) | Binary Search, Math |
| 70 | [Climbing Stairs](https://leetcode.com/problems/climbing-stairs/) | Easy | [python](./solutions-python3/70-ClimbingStairs.py) | Math |
| 74 | [Search a 2D Matrix](https://leetcode.com/problems/search-a-2d-matrix/) | Medium | [python](./solutions-python3/74-Searcha2DMatrix.py) | Array,Binary Search, Matrix |
| 77 | [Combinations](https://leetcode.com/problems/combinations/) | Medium | [python](./solutions-python3/77-Combinations.py) | Backtracking |
| 83 | [Remove Duplicates from Sorted List](https://leetcode.com/problems/remove-duplicates-from-sorted-list/) | Easy | [python](./solutions-python3/83-RemoveDuplicatesfromSortedList.py) | Linked List |
| 88 | [Merge Sorted Array](https://leetcode.com/problems/merge-sorted-array/) | Easy | [python](./solutions-python3/88-MergeSortedArray.py) | Array, Two Pointers |
| 94 | [Binary Tree Inorder Traversal](https://leetcode.com/problems/binary-tree-inorder-traversal/) | Easy | [python](./solutions-python3/94-BinaryTreeInorderTraversal.py) | DFS, Stack, Tree |
| 98 | [Validate Binary Search Tree](https://leetcode.com/problems/validate-binary-search-tree/) | Medium | [python](./solutions-python3/98-ValidateBinarySearchTree.py) | DFS, Tree |
| 101 | [Symmetric Tree](https://leetcode.com/problems/symmetric-tree/) | Easy | [python](./solutions-python3/101-SymmetricTree.py) | DFS, Tree |
| 102 | [Binary Tree Level Order Traversal](https://leetcode.com/problems/binary-tree-level-order-traversal/) | Medium | [python](./solutions-python3//102-BinaryTreeLevelOrderTraversal.py) | BFS, Tree |
| 104 | [Maximum Depth of Binary Tree](https://leetcode.com/problems/maximum-depth-of-binary-tree/) | Easy | [python](./solutions-python3/104-MaximumDepthofBinaryTree.py) | DFS, Tree |
| 112 | [Path Sum](https://leetcode.com/problems/path-sum/) | Easy | [python](./solutions-python3/112-PathSum.py) | DFS, Tree |
| 116 | [Populating Next Right Pointers in Each Node](https://leetcode.com/problems/populating-next-right-pointers-in-each-node/) | Medium | [python](./solutions-python3/116-PopulatingNextRightPointersinEachNode.py) | Linked List, Tree |
| 118 | [Pascal's Triangle](https://leetcode.com/problems/pascals-triangle/) | Easy | [python](./solutions-python3/118-PascalsTriangle.py) | Array |
| 120 | [Triangle](https://leetcode.com/problems/triangle/) | Medium | [python](./solutions-python3/120-Triangle.py) | Array |
| 121 | [Best Time to Buy and Sell Stock](https://leetcode.com/problems/best-time-to-buy-and-sell-stock/) | Easy | [python](./solutions-python3/121-BestTimetoBuyandSellStock.py) | Array |
| 136 | [Single Number](https://leetcode.com/problems/single-number/) | Easy | [python](./solutions-python3/136-SingleNumber.py) | Array |
| 141 | [Linked List Cycle](https://leetcode.com/problems/linked-list-cycle/) | Easy | [python](./solutions-python3/141-LinkedListCycle.py) | Hash Table, Two Pointers |
| 144 | [Binary Tree Preorder Traversal](https://leetcode.com/problems/binary-tree-preorder-traversal/) | Easy | [python](./solutions-python3/144-BinaryTreePreorderTraversal.py) | DFS,Stack, Tree |
| 145 | [Binary Tree Postorder Traversal](https://leetcode.com/problems/binary-tree-postorder-traversal/) | Easy | [python](./solutions-python3/145-BinaryTreePostorderTraversal.py) | DFS,Stack, Tree |
| 153 | [Find Minimum in Rotated Sorted Array](https://leetcode.com/problems/find-minimum-in-rotated-sorted-array/) | Medium | [python](./solutions-python3/153-FindMinimuminRotatedSortedArray.py) | Array, Binary Search |
| 167 | Two Sum II - Input Array Is Sorted | Medium | [python]() | Array,Binary Search, Two Pointers |
| 189 | Rotate Array | Medium | [python]() | Array, Math |
| 190 | Reverse Bits | Easy | [python]() | Bit Manipulation, Divide and Conquer |
| 191 | Number of 1 Bits | Easy | [python]() | Bit Manipulation, Divide and Conquer |
| 198 | House Robber | Medium | [python]() | Array |
| 203 | Remove Linked List Elements | Easy | [python]() | Linked List, Recursions |
| 206 | Reverse Linked List | Easy | [python]() | Linked List, Recursions |
| 217 | Contains Duplicate | Easy | [python]() | Array, Hash Table |
| 226 | Invert Binary Tree | Easy | [python]() | DFS, Tree |
| 231 | Power of Two | Easy | [python]() | Math |
| 232 | Implement Queue using Stacks | Easy | [python]() | Design, Queue, Stack |
| 235 | Lowest Common Ancestor of a Binary Search Tree | Easy | [python]() | DFS, Tree |
| 242 | Valid Anagram | Easy | [python]() | Hash Table, String |
| 278 | First Bad Version | Easy | [python]() | Binary Search, Interactive |
| 283 | Move Zeroes | Easy | [python]() | Array, Two Pointers |
| 344 | Reverse String | Easy | [python]() | Array, Two Pointers |
| 350 | [Intersection of Two Arrays II](https://leetcode.com/problems/intersection-of-two-arrays-ii/) | Easy | [python](./solutions-python3/350-IntersectionofTwoArraysII.py) | Array, Hash Table, Two Pointers |
| 367 | 367. Valid Perfect Square | Easy | [python]() | Binary Search, Math |
| 374 | Guess Number Higher or Lower | Easy | [python]() | Binary Search, Interactive |
| 383 | Ransom Note | Easy | [python]() | Hash Table, String |
| 387 | First Unique Character in a String | Easy | [python]() | Hash Table, String |
| 441 | Arranging Coins | Easy | [python]() | Binary Search ,Math |
| 542 | 01 Matrix | Medium | [python]() | Array |
| 557 | Reverse Words in a String III | Easy | [python]() | String, Two Pointers |
| 566 | Reshape the Matrix | Easy | [python]() | Array, Matrix |
| 567 | Permutation in String | Medium | [python]() | Hash Table, String, Two Pointers |
| 617 | Merge Two Binary Trees | Easy | [python]() | DFS, Tree |
| 633 | [Sum of Square Numbers](https://leetcode.com/problems/sum-of-square-numbers/) | Medium | [python](./solutions-python3/633-SumofSquareNumbers.py) | Binary Search, Math, Two Pointers |
| 653 | Two Sum IV - Input is a BST | Easy | [python]() | Hash Table, Tree, Two Pointers |
| 695 | Max Area of Island | Medium | [python]() | Array, DFS |
| 700 | Search in a Binary Search Tree | Easy | [python]() | Binary Search Tree, Tree |
| 701 | Insert into a Binary Search Tree | Medium | [python]() | Binary Search Tree, Tree |
| 702 | Binary Search | Easy | [python]() | Array, Binary Search |
| 733 | Flood Fill | Easy | [python]() | Array, DFS |
| 744 | Find Smallest Letter Greater Than Target | Easy | [python]() | Array, Binary Search |
| 784 | Letter Case Permutation | Medium | [python]() | Backtracking, String |
| 852 | Peak Index in a Mountain Array | Medium | [python]() | Array, Binary Search |
| 876 | Middle of the Linked List | Easy | [python]() | Linked List, Two Pointers |
| 977 | Squares of a Sorted Array | Easy | [python]() | Array, Sorting, Two Pointers |
| 994 | Rotting Oranges | Medium | [python]() | Array, BFS,Matrix |
| 1337 | [The K Weakest Rows in a Matrix](https://leetcode.com/problems/the-k-weakest-rows-in-a-matrix/) | Easy | [python](./solutions-python3/1337-TheKWeakestRowsinaMatrix.py) | Array, Binary Search, Sorting |
| 1346 | [Check If N and Its Double Exist](https://leetcode.com/problems/check-if-n-and-its-double-exist/) | Easy | [python](./solutions-python3/1346-CheckIfNandItsDoubleExist.py) | Array, Hash Table, Two Pointers |
| 1351 | Count Negative Numbers in a Sorted Matrix | Easy | [python]() | Array, Binary Search Tree, Matrix |
| 1385 | Find the Distance Value Between Two Arrays | Easy | [python]() | Array, Binary Search, Two Pointers |
| 1539 | Kth Missing Positive Number | Easy | [python]() | Array, Binary Search |
| 1608 | Special Array With X Elements Greater Than or Equal X | Easy | [python]() | Array, Binary Search, Sorting |
| 1855 | [Maximum Distance Between a Pair of Values](https://leetcode.com/problems/maximum-distance-between-a-pair-of-values/) | Medium | [python](./solutions-python3/1855-MaximumDistanceBetweenaPairofValues.py) | Array, Binary Search, Two Pointers |
### [Solution Code in MySQL](./solutions-mysql/)
| # | Title | Level | Solution | Category |
| ---- | ------------------------------------------------------------------------------------------------- | ----- | --------------------------------------------------------------- | -------- |
| 595 | [Big Countries](https://leetcode.com/problems/big-countries/) | Easy | [MySQL](./solutions-mysql/595-BigCountries.sql) | Database |
| 1757 | [Recyclable and Low Fat Products](https://leetcode.com/problems/recyclable-and-low-fat-products/) | Easy | [MySQL](./solutions-mysql/1757-RecyclableandLowFatProducts.sql) | Database |