diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml new file mode 100644 index 000000000..2f943cf35 --- /dev/null +++ b/.github/FUNDING.yml @@ -0,0 +1,13 @@ +# These are supported funding model platforms + +github: [halfrost] +patreon: # Replace with a single Patreon username +open_collective: # Replace with a single Open Collective username +ko_fi: # Replace with a single Ko-fi username +tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel +community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry +liberapay: # Replace with a single Liberapay username +issuehunt: # Replace with a single IssueHunt username +otechie: # Replace with a single Otechie username +lfx_crowdfunding: # Replace with a single LFX Crowdfunding project-name e.g., cloud-foundry +custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2'] diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index bea6ae885..42d1586b1 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -28,12 +28,11 @@ jobs: hugo -D --minify - name: Deploy to Server # 第四步,rsync推文件 - uses: AEnterprise/rsync-deploy@v1.0 # 使用别人包装好的步骤镜像 - env: - DEPLOY_KEY: ${{ secrets.DEPLOY_KEY }} # 引用配置,SSH私钥 - ARGS: -avz --delete --exclude='*.pyc' # rsync参数,排除.pyc文件 - SERVER_PORT: '22' # SSH端口 - FOLDER: ./website/public/* #推送的文件夹,路径相对于代码仓库的根目录 - SERVER_IP: ${{ secrets.SSH_HOST }} # 引用配置,服务器的host名(IP或者域名domain.com) - USERNAME: ${{ secrets.SSH_USERNAME }} # 引用配置,服务器登录名 - SERVER_DESTINATION: /var/www/books/leetcode/ # 部署到目标文件夹 + uses: appleboy/ssh-action@v0.1.3 # 使用别人包装好的步骤镜像 + with: + host: ${{ secrets.SSH_HOST }} + username: ${{ secrets.SSH_USERNAME }} + key: ${{ secrets.DEPLOY_KEY }} + port: ${{ secrets.SERVER_PORT }} + script: | + rsync -avz --delete --exclude='*.pyc' ./website/public/ ${{ secrets.SSH_USERNAME }}@${{ secrets.SSH_HOST }}:${{ secrets.SERVER_DESTINATION }} diff --git a/.gitignore b/.gitignore new file mode 100644 index 000000000..e1e2e99aa --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +*.toml +.idea diff --git a/.vscode/settings.json b/.vscode/settings.json index 931396477..eb946948d 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -3,6 +3,7 @@ "go.formatFlags": [ "-s" ], + "go.autocompleteUnimportedPackages": true, "[go]": { "editor.insertSpaces": false, "editor.formatOnSave": true, diff --git a/README.md b/README.md old mode 100644 new mode 100755 index cd9c3e5f6..ebb30e7d1 --- a/README.md +++ b/README.md @@ -1,25 +1,29 @@ # LeetCode in Go -[LeetCode Online Judge](https://leetcode.com/) is a website containing many **algorithm questions**. Most of them are real interview questions of **Google, Facebook, LinkedIn, Apple**, etc. This repo shows my solutions in Go with the code style strictly follows the [Google Golang Style Guide](https://github.com/golang/go/wiki/CodeReviewComments). Please feel free to reference and **STAR** to support this repo, thank you! +[LeetCode Online Judge](https://leetcode.com/) is a website containing many **algorithm questions**. Most of them are real interview questions of **Google, Facebook, LinkedIn, Apple**, etc. and it always help to sharp our algorithm Skills. Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview. This repo shows my solutions in Go with the code style strictly follows the [Google Golang Style Guide](https://github.com/golang/go/wiki/CodeReviewComments). Please feel free to reference and **STAR** to support this repo, thank you!
-
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
@@ -79,6 +83,9 @@
* [✅ Segment Tree](#segment-tree)
* [✅ Binary Indexed Tree](#binary-indexed-tree)
+
+
+
| 数据结构 | 变种 | 相关题目 | 讲解文章 |
|:-------:|:-------|:------|:------|
|顺序线性表:向量||||
@@ -115,1551 +122,2469 @@
## LeetCode Problems
-## 一. 目录
+## 一. 个人数据
+
+| | Easy | Medium | Hard | Total |
+|:--------:|:--------:|:--------:|:--------:|:--------:|
+|Optimizing|31|78|43|152|
+|Accepted|**287**|**484**|**142**|**913**|
+|Total|600|1305|539|2444|
+|Perfection Rate|89.2%|83.9%|69.7%|83.4%|
+|Completion Rate|47.8%|37.1%|26.3%|37.4%|
+|------------|----------------------------|----------------------------|----------------------------|----------------------------|
-| # | Title | Solution | Acceptance | Difficulty | Frequency |
+## 二. 目录
+
+以下已经收录了 787 道题的题解,还有 11 道题在尝试优化到 beats 100%
+
+| No. | Title | Solution | Acceptance | Difficulty | Frequency |
|:--------:|:--------------------------------------------------------------|:--------:|:--------:|:--------:|:--------:|
-| 0001 | Two Sum | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0001.Two-Sum) | 45.6% | Easy | |
-| 0002 | Add Two Numbers | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0002.Add-Two-Numbers) | 33.9% | Medium | |
-| 0003 | Longest Substring Without Repeating Characters | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0003.Longest-Substring-Without-Repeating-Characters) | 30.4% | Medium | |
-| 0004 | Median of Two Sorted Arrays | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0004.Median-of-Two-Sorted-Arrays) | 29.6% | Hard | |
-| 0005 | Longest Palindromic Substring | | 29.4% | Medium | |
-| 0006 | ZigZag Conversion | | 36.3% | Medium | |
-| 0007 | Reverse Integer | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0007.Reverse-Integer) | 25.8% | Easy | |
-| 0008 | String to Integer (atoi) | | 15.4% | Medium | |
-| 0009 | Palindrome Number | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0009.Palindrome-Number) | 48.4% | Easy | |
-| 0010 | Regular Expression Matching | | 26.8% | Hard | |
-| 0011 | Container With Most Water | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0011.Container-With-Most-Water) | 50.8% | Medium | |
-| 0012 | Integer to Roman | | 55.0% | Medium | |
-| 0013 | Roman to Integer | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0013.Roman-to-Integer) | 55.7% | Easy | |
-| 0014 | Longest Common Prefix | | 35.4% | Easy | |
-| 0015 | 3Sum | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0015.3Sum) | 26.8% | Medium | |
-| 0016 | 3Sum Closest | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0016.3Sum-Closest) | 46.0% | Medium | |
-| 0017 | Letter Combinations of a Phone Number | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0017.Letter-Combinations-of-a-Phone-Number) | 46.8% | Medium | |
-| 0018 | 4Sum | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0018.4Sum) | 33.6% | Medium | |
-| 0019 | Remove Nth Node From End of List | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0019.Remove-Nth-Node-From-End-of-List) | 35.2% | Medium | |
-| 0020 | Valid Parentheses | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0020.Valid-Parentheses) | 38.9% | Easy | |
-| 0021 | Merge Two Sorted Lists | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0021.Merge-Two-Sorted-Lists) | 53.5% | Easy | |
-| 0022 | Generate Parentheses | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0022.Generate-Parentheses) | 62.6% | Medium | |
-| 0023 | Merge k Sorted Lists | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0023.Merge-k-Sorted-Lists) | 40.2% | Hard | |
-| 0024 | Swap Nodes in Pairs | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0024.Swap-Nodes-in-Pairs) | 50.3% | Medium | |
-| 0025 | Reverse Nodes in k-Group | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0025.Reverse-Nodes-in-k-Group) | 42.0% | Hard | |
-| 0026 | Remove Duplicates from Sorted Array | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0026.Remove-Duplicates-from-Sorted-Array) | 45.1% | Easy | |
-| 0027 | Remove Element | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0027.Remove-Element) | 48.2% | Easy | |
-| 0028 | Implement strStr() | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0028.Implement-strStr) | 34.5% | Easy | |
-| 0029 | Divide Two Integers | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0029.Divide-Two-Integers) | 16.4% | Medium | |
-| 0030 | Substring with Concatenation of All Words | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0030.Substring-with-Concatenation-of-All-Words)(是否还有更优解) | 25.4% | Hard | |
-| 0031 | Next Permutation | | 32.6% | Medium | |
-| 0032 | Longest Valid Parentheses | | 28.4% | Hard | |
-| 0033 | Search in Rotated Sorted Array | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0033.Search-in-Rotated-Sorted-Array) | 34.5% | Medium | |
-| 0034 | Find First and Last Position of Element in Sorted Array | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0034.Find-First-and-Last-Position-of-Element-in-Sorted-Array) | 36.1% | Medium | |
-| 0035 | Search Insert Position | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0035.Search-Insert-Position) | 42.6% | Easy | |
-| 0036 | Valid Sudoku | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0036.Valid-Sudoku) | 48.7% | Medium | |
-| 0037 | Sudoku Solver | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0037.Sudoku-Solver) | 43.5% | Hard | |
-| 0038 | Count and Say | | 44.6% | Easy | |
-| 0039 | Combination Sum | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0039.Combination-Sum) | 56.0% | Medium | |
-| 0040 | Combination Sum II | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0040.Combination-Sum-II) | 48.1% | Medium | |
-| 0041 | First Missing Positive | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0041.First-Missing-Positive) | 32.0% | Hard | |
-| 0042 | Trapping Rain Water | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0042.Trapping-Rain-Water) | 48.8% | Hard | |
-| 0043 | Multiply Strings | | 33.9% | Medium | |
-| 0044 | Wildcard Matching | | 24.7% | Hard | |
-| 0045 | Jump Game II | | 30.5% | Hard | |
-| 0046 | Permutations | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0046.Permutations) | 63.5% | Medium | |
-| 0047 | Permutations II | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0047.Permutations-II) | 46.4% | Medium | |
-| 0048 | Rotate Image | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0048.Rotate-Image) | 56.6% | Medium | |
-| 0049 | Group Anagrams | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0049.Group-Anagrams) | 56.8% | Medium | |
-| 0050 | Pow(x, n) | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0050.Powx-n) | 30.3% | Medium | |
-| 0051 | N-Queens | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0051.N-Queens) | 46.6% | Hard | |
-| 0052 | N-Queens II | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0052.N-Queens-II) | 57.8% | Hard | |
-| 0053 | Maximum Subarray | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0053.Maximum-Subarray) | 46.5% | Easy | |
-| 0054 | Spiral Matrix | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0054.Spiral-Matrix) | 34.1% | Medium | |
-| 0055 | Jump Game | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0055.Jump-Game) | 34.6% | Medium | |
-| 0056 | Merge Intervals | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0056.Merge-Intervals) | 39.3% | Medium | |
-| 0057 | Insert Interval | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0057.Insert-Interval) | 33.5% | Hard | |
-| 0058 | Length of Last Word | | 32.6% | Easy | |
-| 0059 | Spiral Matrix II | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0059.Spiral-Matrix-II) | 53.8% | Medium | |
-| 0060 | Permutation Sequence | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0060.Permutation-Sequence) | 38.4% | Hard | |
-| 0061 | Rotate List | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0061.Rotate-List) | 30.0% | Medium | |
-| 0062 | Unique Paths | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0062.Unique-Paths) | 54.1% | Medium | |
-| 0063 | Unique Paths II | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0063.Unique-Paths-II) | 34.5% | Medium | |
-| 0064 | Minimum Path Sum | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0064.Minimum-Path-Sum) | 54.4% | Medium | |
-| 0065 | Valid Number | | 15.3% | Hard | |
-| 0066 | Plus One | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0066.Plus-One) | 43.0% | Easy | |
-| 0067 | Add Binary | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0067.Add-Binary) | 45.2% | Easy | |
-| 0068 | Text Justification | | 27.7% | Hard | |
-| 0069 | Sqrt(x) | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0069.Sqrtx) | 33.9% | Easy | |
-| 0070 | Climbing Stairs | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0070.Climbing-Stairs) | 47.8% | Easy | |
-| 0071 | Simplify Path | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0071.Simplify-Path) | 32.6% | Medium | |
-| 0072 | Edit Distance | | 44.8% | Hard | |
-| 0073 | Set Matrix Zeroes | | 43.1% | Medium | |
-| 0074 | Search a 2D Matrix | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0074.Search-a-2D-Matrix) | 36.5% | Medium | |
-| 0075 | Sort Colors | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0075.Sort-Colors) | 47.3% | Medium | |
-| 0076 | Minimum Window Substring | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0076.Minimum-Window-Substring) | 34.6% | Hard | |
-| 0077 | Combinations | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0077.Combinations) | 54.7% | Medium | |
-| 0078 | Subsets | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0078.Subsets) | 61.9% | Medium | |
-| 0079 | Word Search | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0079.Word-Search) | 35.6% | Medium | |
-| 0080 | Remove Duplicates from Sorted Array II | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0080.Remove-Duplicates-from-Sorted-Array-II) | 43.9% | Medium | |
-| 0081 | Search in Rotated Sorted Array II | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0081.Search-in-Rotated-Sorted-Array-II) | 33.0% | Medium | |
-| 0082 | Remove Duplicates from Sorted List II | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0082.Remove-Duplicates-from-Sorted-List-II) | 36.8% | Medium | |
-| 0083 | Remove Duplicates from Sorted List | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0083.Remove-Duplicates-from-Sorted-List) | 45.4% | Easy | |
-| 0084 | Largest Rectangle in Histogram | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0084.Largest-Rectangle-in-Histogram) | 35.1% | Hard | |
-| 0085 | Maximal Rectangle | | 37.7% | Hard | |
-| 0086 | Partition List | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0086.Partition-List) | 41.4% | Medium | |
-| 0087 | Scramble String | | 33.7% | Hard | |
-| 0088 | Merge Sorted Array | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0088.Merge-Sorted-Array) | 39.4% | Easy | |
-| 0089 | Gray Code | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0089.Gray-Code) | 49.1% | Medium | |
-| 0090 | Subsets II | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0090.Subsets-II) | 47.1% | Medium | |
-| 0091 | Decode Ways | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0091.Decode-Ways) | 24.6% | Medium | |
-| 0092 | Reverse Linked List II | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0092.Reverse-Linked-List-II) | 38.8% | Medium | |
-| 0093 | Restore IP Addresses | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0093.Restore-IP-Addresses) | 35.6% | Medium | |
-| 0094 | Binary Tree Inorder Traversal | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0094.Binary-Tree-Inorder-Traversal) | 63.3% | Medium | |
-| 0095 | Unique Binary Search Trees II | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0095.Unique-Binary-Search-Trees-II) | 40.6% | Medium | |
-| 0096 | Unique Binary Search Trees | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0096.Unique-Binary-Search-Trees) | 52.9% | Medium | |
-| 0097 | Interleaving String | | 31.5% | Hard | |
-| 0098 | Validate Binary Search Tree | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0098.Validate-Binary-Search-Tree) | 27.8% | Medium | |
-| 0099 | Recover Binary Search Tree | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0099.Recover-Binary-Search-Tree) | 39.6% | Hard | |
-| 0100 | Same Tree | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0100.Same-Tree) | 53.4% | Easy | |
-| 0101 | Symmetric Tree | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0101.Symmetric-Tree) | 46.8% | Easy | |
-| 0102 | Binary Tree Level Order Traversal | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0102.Binary-Tree-Level-Order-Traversal) | 54.5% | Medium | |
-| 0103 | Binary Tree Zigzag Level Order Traversal | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0103.Binary-Tree-Zigzag-Level-Order-Traversal) | 48.3% | Medium | |
-| 0104 | Maximum Depth of Binary Tree | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0104.Maximum-Depth-of-Binary-Tree) | 66.0% | Easy | |
-| 0105 | Construct Binary Tree from Preorder and Inorder Traversal | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0105.Construct-Binary-Tree-from-Preorder-and-Inorder-Traversal) | 48.8% | Medium | |
-| 0106 | Construct Binary Tree from Inorder and Postorder Traversal | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0106.Construct-Binary-Tree-from-Inorder-and-Postorder-Traversal) | 47.1% | Medium | |
-| 0107 | Binary Tree Level Order Traversal II | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0107.Binary-Tree-Level-Order-Traversal-II) | 53.5% | Easy | |
-| 0108 | Convert Sorted Array to Binary Search Tree | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0108.Convert-Sorted-Array-to-Binary-Search-Tree) | 57.9% | Easy | |
-| 0109 | Convert Sorted List to Binary Search Tree | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0109.Convert-Sorted-List-to-Binary-Search-Tree) | 47.6% | Medium | |
-| 0110 | Balanced Binary Tree | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0110.Balanced-Binary-Tree) | 43.5% | Easy | |
-| 0111 | Minimum Depth of Binary Tree | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0111.Minimum-Depth-of-Binary-Tree) | 37.4% | Easy | |
-| 0112 | Path Sum | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0112.Path-Sum) | 41.1% | Easy | |
-| 0113 | Path Sum II | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0113.Path-Sum-II) | 46.6% | Medium | |
-| 0114 | Flatten Binary Tree to Linked List | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0114.Flatten-Binary-Tree-to-Linked-List) | 49.2% | Medium | |
-| 0115 | Distinct Subsequences | | 38.2% | Hard | |
-| 0116 | Populating Next Right Pointers in Each Node | | 45.2% | Medium | |
-| 0117 | Populating Next Right Pointers in Each Node II | | 39.1% | Medium | |
-| 0118 | Pascal's Triangle | | 52.4% | Easy | |
-| 0119 | Pascal's Triangle II | | 49.0% | Easy | |
-| 0120 | Triangle | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0120.Triangle) | 44.1% | Medium | |
-| 0121 | Best Time to Buy and Sell Stock | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0121.Best-Time-to-Buy-and-Sell-Stock) | 50.4% | Easy | |
-| 0122 | Best Time to Buy and Sell Stock II | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0122.Best-Time-to-Buy-and-Sell-Stock-II) | 56.9% | Easy | |
-| 0123 | Best Time to Buy and Sell Stock III | | 37.4% | Hard | |
-| 0124 | Binary Tree Maximum Path Sum | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0124.Binary-Tree-Maximum-Path-Sum) | 34.3% | Hard | |
-| 0125 | Valid Palindrome | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0125.Valid-Palindrome) | 36.7% | Easy | |
-| 0126 | Word Ladder II | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0126.Word-Ladder-II) | 22.1% | Hard | |
-| 0127 | Word Ladder | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0127.Word-Ladder) | 29.5% | Medium | |
-| 0128 | Longest Consecutive Sequence | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0128.Longest-Consecutive-Sequence) | 45.1% | Hard | |
-| 0129 | Sum Root to Leaf Numbers | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0129.Sum-Root-to-Leaf-Numbers) | 49.0% | Medium | |
-| 0130 | Surrounded Regions | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0130.Surrounded-Regions) | 28.1% | Medium | |
-| 0131 | Palindrome Partitioning | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0131.Palindrome-Partitioning) | 47.5% | Medium | |
-| 0132 | Palindrome Partitioning II | | 30.2% | Hard | |
-| 0133 | Clone Graph | | 34.7% | Medium | |
-| 0134 | Gas Station | | 38.5% | Medium | |
-| 0135 | Candy | | 31.6% | Hard | |
-| 0136 | Single Number | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0136.Single-Number) | 65.5% | Easy | |
-| 0137 | Single Number II | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0137.Single-Number-II) | 52.4% | Medium | |
-| 0138 | Copy List with Random Pointer | | 36.3% | Medium | |
-| 0139 | Word Break | | 40.0% | Medium | |
-| 0140 | Word Break II | | 32.6% | Hard | |
-| 0141 | Linked List Cycle | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0141.Linked-List-Cycle) | 41.1% | Easy | |
-| 0142 | Linked List Cycle II | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0142.Linked-List-Cycle-II) | 37.3% | Medium | |
-| 0143 | Reorder List | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0143.Reorder-List) | 37.0% | Medium | |
-| 0144 | Binary Tree Preorder Traversal | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0144.Binary-Tree-Preorder-Traversal) | 55.6% | Medium | |
-| 0145 | Binary Tree Postorder Traversal | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0145.Binary-Tree-Postorder-Traversal) | 54.9% | Hard | |
-| 0146 | LRU Cache | | 33.1% | Medium | |
-| 0147 | Insertion Sort List | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0147.Insertion-Sort-List) | 41.1% | Medium | |
-| 0148 | Sort List | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0148.Sort-List) | 42.3% | Medium | |
-| 0149 | Max Points on a Line | | 16.9% | Hard | |
-| 0150 | Evaluate Reverse Polish Notation | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0150.Evaluate-Reverse-Polish-Notation) | 36.3% | Medium | |
-| 0151 | Reverse Words in a String | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0151.Reverse-Words-in-a-String) | 21.9% | Medium | |
-| 0152 | Maximum Product Subarray | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0152.Maximum-Product-Subarray) | 31.7% | Medium | |
-| 0153 | Find Minimum in Rotated Sorted Array | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0153.Find-Minimum-in-Rotated-Sorted-Array) | 45.1% | Medium | |
-| 0154 | Find Minimum in Rotated Sorted Array II | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0154.Find-Minimum-in-Rotated-Sorted-Array-II) | 41.6% | Hard | |
-| 0155 | Min Stack | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0155.Min-Stack) | 44.4% | Easy | |
-| 0156 | Binary Tree Upside Down | | 55.0% | Medium | |
-| 0157 | Read N Characters Given Read4 | | 34.2% | Easy | |
-| 0158 | Read N Characters Given Read4 II - Call multiple times | | 33.7% | Hard | |
-| 0159 | Longest Substring with At Most Two Distinct Characters | | 49.4% | Medium | |
-| 0160 | Intersection of Two Linked Lists | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0160.Intersection-of-Two-Linked-Lists) | 40.5% | Easy | |
-| 0161 | One Edit Distance | | 32.3% | Medium | |
-| 0162 | Find Peak Element | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0162.Find-Peak-Element) | 43.3% | Medium | |
-| 0163 | Missing Ranges | | 24.3% | Medium | |
-| 0164 | Maximum Gap | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0164.Maximum-Gap) | 35.4% | Hard | |
-| 0165 | Compare Version Numbers | | 27.4% | Medium | |
-| 0166 | Fraction to Recurring Decimal | | 21.6% | Medium | |
-| 0167 | Two Sum II - Input array is sorted | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0167.Two-Sum-II---Input-array-is-sorted) | 54.0% | Easy | |
-| 0168 | Excel Sheet Column Title | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0168.Excel-Sheet-Column-Title) | 31.0% | Easy | |
-| 0169 | Majority Element | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0169.Majority-Element) | 58.7% | Easy | |
-| 0170 | Two Sum III - Data structure design | | 33.5% | Easy | |
-| 0171 | Excel Sheet Column Number | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0171.Excel-Sheet-Column-Number) | 54.6% | Easy | |
-| 0172 | Factorial Trailing Zeroes | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0172.Factorial-Trailing-Zeroes) | 37.8% | Easy | |
-| 0173 | Binary Search Tree Iterator | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0173.Binary-Search-Tree-Iterator) | 56.5% | Medium | |
-| 0174 | Dungeon Game | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0174.Dungeon-Game) | 32.3% | Hard | |
-| 0175 | Combine Two Tables | | 60.7% | Easy | |
-| 0176 | Second Highest Salary | | 31.6% | Easy | |
-| 0177 | Nth Highest Salary | | 31.3% | Medium | |
-| 0178 | Rank Scores | | 45.8% | Medium | |
-| 0179 | Largest Number | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0179.Largest-Number) | 28.7% | Medium | |
-| 0180 | Consecutive Numbers | | 39.7% | Medium | |
-| 0181 | Employees Earning More Than Their Managers | | 56.8% | Easy | |
-| 0182 | Duplicate Emails | | 62.0% | Easy | |
-| 0183 | Customers Who Never Order | | 53.4% | Easy | |
-| 0184 | Department Highest Salary | | 36.6% | Medium | |
-| 0185 | Department Top Three Salaries | | 34.5% | Hard | |
-| 0186 | Reverse Words in a String II | | 43.3% | Medium | |
-| 0187 | Repeated DNA Sequences | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0187.Repeated-DNA-Sequences) | 38.9% | Medium | |
-| 0188 | Best Time to Buy and Sell Stock IV | | 28.0% | Hard | |
-| 0189 | Rotate Array | | 34.7% | Easy | |
-| 0190 | Reverse Bits | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0190.Reverse-Bits) | 39.7% | Easy | |
-| 0191 | Number of 1 Bits | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0191.Number-of-1-Bits) | 49.8% | Easy | |
-| 0192 | Word Frequency | | 25.8% | Medium | |
-| 0193 | Valid Phone Numbers | | 25.3% | Easy | |
-| 0194 | Transpose File | | 24.1% | Medium | |
-| 0195 | Tenth Line | | 33.0% | Easy | |
-| 0196 | Delete Duplicate Emails | | 41.0% | Easy | |
-| 0197 | Rising Temperature | | 38.4% | Easy | |
-| 0198 | House Robber | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0198.House-Robber) | 42.0% | Easy | |
-| 0199 | Binary Tree Right Side View | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0199.Binary-Tree-Right-Side-View) | 54.0% | Medium | |
-| 0200 | Number of Islands | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0200.Number-of-Islands) | 46.8% | Medium | |
-| 0201 | Bitwise AND of Numbers Range | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0201.Bitwise-AND-of-Numbers-Range) | 39.3% | Medium | |
-| 0202 | Happy Number | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0202.Happy-Number) | 50.4% | Easy | |
-| 0203 | Remove Linked List Elements | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0203.Remove-Linked-List-Elements) | 38.6% | Easy | |
-| 0204 | Count Primes | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0204.Count-Primes) | 31.5% | Easy | |
-| 0205 | Isomorphic Strings | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0205.Isomorphic-Strings) | 39.8% | Easy | |
-| 0206 | Reverse Linked List | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0206.Reverse-Linked-List) | 62.5% | Easy | |
-| 0207 | Course Schedule | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0207.Course-Schedule) | 43.1% | Medium | |
-| 0208 | Implement Trie (Prefix Tree) | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0208.Implement-Trie-Prefix-Tree) | 49.3% | Medium | |
-| 0209 | Minimum Size Subarray Sum | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0209.Minimum-Size-Subarray-Sum) | 38.1% | Medium | |
-| 0210 | Course Schedule II | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0210.Course-Schedule-II) | 40.7% | Medium | |
-| 0211 | Add and Search Word - Data structure design | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0211.Add-and-Search-Word---Data-structure-design) | 38.1% | Medium | |
-| 0212 | Word Search II | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0212.Word-Search-II) | 34.8% | Hard | |
-| 0213 | House Robber II | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0213.House-Robber-II) | 36.5% | Medium | |
-| 0214 | Shortest Palindrome | | 29.8% | Hard | |
-| 0215 | Kth Largest Element in an Array | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0215.Kth-Largest-Element-in-an-Array) | 55.3% | Medium | |
-| 0216 | Combination Sum III | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0216.Combination-Sum-III) | 56.5% | Medium | |
-| 0217 | Contains Duplicate | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0217.Contains-Duplicate) | 56.0% | Easy | |
-| 0218 | The Skyline Problem | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0218.The-Skyline-Problem) | 34.5% | Hard | |
-| 0219 | Contains Duplicate II | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0219.Contains-Duplicate-II) | 37.7% | Easy | |
-| 0220 | Contains Duplicate III | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0220.Contains-Duplicate-III) | 20.9% | Medium | |
-| 0221 | Maximal Square | | 37.7% | Medium | |
-| 0222 | Count Complete Tree Nodes | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0222.Count-Complete-Tree-Nodes) | 46.7% | Medium | |
-| 0223 | Rectangle Area | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0223.Rectangle-Area) | 37.8% | Medium | |
-| 0224 | Basic Calculator | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0224.Basic-Calculator) | 36.8% | Hard | |
-| 0225 | Implement Stack using Queues | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0225.Implement-Stack-using-Queues) | 45.1% | Easy | |
-| 0226 | Invert Binary Tree | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0226.Invert-Binary-Tree) | 64.9% | Easy | |
-| 0227 | Basic Calculator II | | 36.9% | Medium | |
-| 0228 | Summary Ranges | | 39.5% | Medium | |
-| 0229 | Majority Element II | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0229.Majority-Element-II) | 35.6% | Medium | |
-| 0230 | Kth Smallest Element in a BST | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0230.Kth-Smallest-Element-in-a-BST) | 60.2% | Medium | |
-| 0231 | Power of Two | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0231.Power-of-Two) | 43.7% | Easy | |
-| 0232 | Implement Queue using Stacks | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0232.Implement-Queue-using-Stacks) | 49.5% | Easy | |
-| 0233 | Number of Digit One | | 31.3% | Hard | |
-| 0234 | Palindrome Linked List | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0234.Palindrome-Linked-List) | 39.2% | Easy | |
-| 0235 | Lowest Common Ancestor of a Binary Search Tree | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0235.Lowest-Common-Ancestor-of-a-Binary-Search-Tree) | 49.9% | Easy | |
-| 0236 | Lowest Common Ancestor of a Binary Tree | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0236.Lowest-Common-Ancestor-of-a-Binary-Tree) | 45.6% | Medium | |
-| 0237 | Delete Node in a Linked List | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0237.Delete-Node-in-a-Linked-List) | 63.7% | Easy | |
-| 0238 | Product of Array Except Self | | 60.1% | Medium | |
-| 0239 | Sliding Window Maximum | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0239.Sliding-Window-Maximum) | 43.0% | Hard | |
-| 0240 | Search a 2D Matrix II | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0240.Search-a-2D-Matrix-II) | 43.1% | Medium | |
-| 0241 | Different Ways to Add Parentheses | | 55.2% | Medium | |
-| 0242 | Valid Anagram | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0242.Valid-Anagram) | 56.8% | Easy | |
-| 0243 | Shortest Word Distance | | 61.0% | Easy | |
-| 0244 | Shortest Word Distance II | | 52.3% | Medium | |
-| 0245 | Shortest Word Distance III | | 55.3% | Medium | |
-| 0246 | Strobogrammatic Number | | 45.0% | Easy | |
-| 0247 | Strobogrammatic Number II | | 47.6% | Medium | |
-| 0248 | Strobogrammatic Number III | | 39.6% | Hard | |
-| 0249 | Group Shifted Strings | | 55.0% | Medium | |
-| 0250 | Count Univalue Subtrees | | 51.9% | Medium | |
-| 0251 | Flatten 2D Vector | | 45.7% | Medium | |
-| 0252 | Meeting Rooms | | 54.6% | Easy | |
-| 0253 | Meeting Rooms II | | 45.7% | Medium | |
-| 0254 | Factor Combinations | | 46.7% | Medium | |
-| 0255 | Verify Preorder Sequence in Binary Search Tree | | 45.7% | Medium | |
-| 0256 | Paint House | | 52.1% | Easy | |
-| 0257 | Binary Tree Paths | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0257.Binary-Tree-Paths) | 51.4% | Easy | |
-| 0258 | Add Digits | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0258.Add-Digits) | 57.6% | Easy | |
-| 0259 | 3Sum Smaller | | 47.6% | Medium | |
-| 0260 | Single Number III | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0260.Single-Number-III) | 64.3% | Medium | |
-| 0261 | Graph Valid Tree | | 42.2% | Medium | |
-| 0262 | Trips and Users | | 32.6% | Hard | |
-| 0263 | Ugly Number | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0263.Ugly-Number) | 41.6% | Easy | |
-| 0264 | Ugly Number II | | 42.0% | Medium | |
-| 0265 | Paint House II | | 44.6% | Hard | |
-| 0266 | Palindrome Permutation | | 61.9% | Easy | |
-| 0267 | Palindrome Permutation II | | 36.4% | Medium | |
-| 0268 | Missing Number | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0268.Missing-Number) | 51.7% | Easy | |
-| 0269 | Alien Dictionary | | 33.3% | Hard | |
-| 0270 | Closest Binary Search Tree Value | | 48.1% | Easy | |
-| 0271 | Encode and Decode Strings | | 31.5% | Medium | |
-| 0272 | Closest Binary Search Tree Value II | | 50.5% | Hard | |
-| 0273 | Integer to English Words | | 27.0% | Hard | |
-| 0274 | H-Index | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0274.H-Index) | 35.9% | Medium | |
-| 0275 | H-Index II | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0275.H-Index-II) | 35.9% | Medium | |
-| 0276 | Paint Fence | | 38.3% | Easy | |
-| 0277 | Find the Celebrity | | 41.8% | Medium | |
-| 0278 | First Bad Version | | 35.7% | Easy | |
-| 0279 | Perfect Squares | | 47.3% | Medium | |
-| 0280 | Wiggle Sort | | 63.8% | Medium | |
-| 0281 | Zigzag Iterator | | 58.4% | Medium | |
-| 0282 | Expression Add Operators | | 35.5% | Hard | |
-| 0283 | Move Zeroes | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0283.Move-Zeroes) | 57.8% | Easy | |
-| 0284 | Peeking Iterator | | 45.6% | Medium | |
-| 0285 | Inorder Successor in BST | | 40.3% | Medium | |
-| 0286 | Walls and Gates | | 54.5% | Medium | |
-| 0287 | Find the Duplicate Number | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0287.Find-the-Duplicate-Number) | 55.5% | Medium | |
-| 0288 | Unique Word Abbreviation | | 21.9% | Medium | |
-| 0289 | Game of Life | | 54.4% | Medium | |
-| 0290 | Word Pattern | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0290.Word-Pattern) | 37.0% | Easy | |
-| 0291 | Word Pattern II | | 43.4% | Hard | |
-| 0292 | Nim Game | | 54.9% | Easy | |
-| 0293 | Flip Game | | 60.6% | Easy | |
-| 0294 | Flip Game II | | 50.0% | Medium | |
-| 0295 | Find Median from Data Stream | | 44.3% | Hard | |
-| 0296 | Best Meeting Point | | 57.5% | Hard | |
-| 0297 | Serialize and Deserialize Binary Tree | | 47.4% | Hard | |
-| 0298 | Binary Tree Longest Consecutive Sequence | | 47.1% | Medium | |
-| 0299 | Bulls and Cows | | 42.4% | Easy | |
-| 0300 | Longest Increasing Subsequence | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0300.Longest-Increasing-Subsequence) | 42.6% | Medium | |
-| 0301 | Remove Invalid Parentheses | | 43.3% | Hard | |
-| 0302 | Smallest Rectangle Enclosing Black Pixels | | 51.6% | Hard | |
-| 0303 | Range Sum Query - Immutable | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0303.Range-Sum-Query---Immutable) | 44.7% | Easy | |
-| 0304 | Range Sum Query 2D - Immutable | | 38.5% | Medium | |
-| 0305 | Number of Islands II | | 40.1% | Hard | |
-| 0306 | Additive Number | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0306.Additive-Number) | 29.3% | Medium | |
-| 0307 | Range Sum Query - Mutable | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0307.Range-Sum-Query---Mutable) | 34.6% | Medium | |
-| 0308 | Range Sum Query 2D - Mutable | | 35.6% | Hard | |
-| 0309 | Best Time to Buy and Sell Stock with Cooldown | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0309.Best-Time-to-Buy-and-Sell-Stock-with-Cooldown) | 47.4% | Medium | |
-| 0310 | Minimum Height Trees | | 32.3% | Medium | |
-| 0311 | Sparse Matrix Multiplication | | 61.8% | Medium | |
-| 0312 | Burst Balloons | | 51.7% | Hard | |
-| 0313 | Super Ugly Number | | 45.0% | Medium | |
-| 0314 | Binary Tree Vertical Order Traversal | | 45.2% | Medium | |
-| 0315 | Count of Smaller Numbers After Self | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0315.Count-of-Smaller-Numbers-After-Self) | 41.5% | Hard | |
-| 0316 | Remove Duplicate Letters | | 35.8% | Hard | |
-| 0317 | Shortest Distance from All Buildings | | 41.4% | Hard | |
-| 0318 | Maximum Product of Word Lengths | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0318.Maximum-Product-of-Word-Lengths) | 51.2% | Medium | |
-| 0319 | Bulb Switcher | | 45.4% | Medium | |
-| 0320 | Generalized Abbreviation | | 52.0% | Medium | |
-| 0321 | Create Maximum Number | | 27.0% | Hard | |
-| 0322 | Coin Change | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0322.Coin-Change) | 35.4% | Medium | |
-| 0323 | Number of Connected Components in an Undirected Graph | | 56.0% | Medium | |
-| 0324 | Wiggle Sort II | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0324.Wiggle-Sort-II) | 29.9% | Medium | |
-| 0325 | Maximum Size Subarray Sum Equals k | | 46.8% | Medium | |
-| 0326 | Power of Three | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0326.Power-of-Three) | 42.1% | Easy | |
-| 0327 | Count of Range Sum | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0327.Count-of-Range-Sum) | 35.1% | Hard | |
-| 0328 | Odd Even Linked List | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0328.Odd-Even-Linked-List) | 55.7% | Medium | |
-| 0329 | Longest Increasing Path in a Matrix | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0329.Longest-Increasing-Path-in-a-Matrix) | 43.4% | Hard | |
-| 0330 | Patching Array | | 34.5% | Hard | |
-| 0331 | Verify Preorder Serialization of a Binary Tree | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0331.Verify-Preorder-Serialization-of-a-Binary-Tree) | 40.4% | Medium | |
-| 0332 | Reconstruct Itinerary | | 36.7% | Medium | |
-| 0333 | Largest BST Subtree | | 35.8% | Medium | |
-| 0334 | Increasing Triplet Subsequence | | 40.0% | Medium | |
-| 0335 | Self Crossing | | 28.0% | Hard | |
-| 0336 | Palindrome Pairs | | 33.7% | Hard | |
-| 0337 | House Robber III | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0337.House-Robber-III) | 50.6% | Medium | |
-| 0338 | Counting Bits | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0338.Counting-Bits) | 69.5% | Medium | |
-| 0339 | Nested List Weight Sum | | 73.9% | Easy | |
-| 0340 | Longest Substring with At Most K Distinct Characters | | 44.0% | Hard | |
-| 0341 | Flatten Nested List Iterator | | 52.9% | Medium | |
-| 0342 | Power of Four | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0342.Power-of-Four) | 41.7% | Easy | |
-| 0343 | Integer Break | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0343.Integer-Break) | 50.4% | Medium | |
-| 0344 | Reverse String | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0344.Reverse-String) | 68.5% | Easy | |
-| 0345 | Reverse Vowels of a String | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0345.Reverse-Vowels-of-a-String) | 44.2% | Easy | |
-| 0346 | Moving Average from Data Stream | | 70.9% | Easy | |
-| 0347 | Top K Frequent Elements | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0347.Top-K-Frequent-Elements) | 61.2% | Medium | |
-| 0348 | Design Tic-Tac-Toe | | 54.3% | Medium | |
-| 0349 | Intersection of Two Arrays | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0349.Intersection-of-Two-Arrays) | 62.5% | Easy | |
-| 0350 | Intersection of Two Arrays II | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0350.Intersection-of-Two-Arrays-II) | 51.3% | Easy | |
-| 0351 | Android Unlock Patterns | | 48.4% | Medium | |
-| 0352 | Data Stream as Disjoint Intervals | | 47.3% | Hard | |
-| 0353 | Design Snake Game | | 34.1% | Medium | |
-| 0354 | Russian Doll Envelopes | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0354.Russian-Doll-Envelopes) | 35.6% | Hard | |
-| 0355 | Design Twitter | | 30.3% | Medium | |
-| 0356 | Line Reflection | | 31.8% | Medium | |
-| 0357 | Count Numbers with Unique Digits | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0357.Count-Numbers-with-Unique-Digits) | 48.4% | Medium | |
-| 0358 | Rearrange String k Distance Apart | | 34.9% | Hard | |
-| 0359 | Logger Rate Limiter | | 70.8% | Easy | |
-| 0360 | Sort Transformed Array | | 48.8% | Medium | |
-| 0361 | Bomb Enemy | | 46.0% | Medium | |
-| 0362 | Design Hit Counter | | 63.6% | Medium | |
-| 0363 | Max Sum of Rectangle No Larger Than K | | 37.3% | Hard | |
-| 0364 | Nested List Weight Sum II | | 62.7% | Medium | |
-| 0365 | Water and Jug Problem | | 30.6% | Medium | |
-| 0366 | Find Leaves of Binary Tree | | 70.6% | Medium | |
-| 0367 | Valid Perfect Square | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0367.Valid-Perfect-Square) | 41.7% | Easy | |
-| 0368 | Largest Divisible Subset | | 38.1% | Medium | |
-| 0369 | Plus One Linked List | | 58.2% | Medium | |
-| 0370 | Range Addition | | 62.8% | Medium | |
-| 0371 | Sum of Two Integers | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0371.Sum-of-Two-Integers) | 50.7% | Medium | |
-| 0372 | Super Pow | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0372.Super-Pow) | 36.4% | Medium | |
-| 0373 | Find K Pairs with Smallest Sums | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0373.Find-K-Pairs-with-Smallest-Sums) | 36.7% | Medium | |
-| 0374 | Guess Number Higher or Lower | | 43.0% | Easy | |
-| 0375 | Guess Number Higher or Lower II | | 40.3% | Medium | |
-| 0376 | Wiggle Subsequence | | 39.6% | Medium | |
-| 0377 | Combination Sum IV | | 45.3% | Medium | |
-| 0378 | Kth Smallest Element in a Sorted Matrix | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0378.Kth-Smallest-Element-in-a-Sorted-Matrix) | 54.3% | Medium | |
-| 0379 | Design Phone Directory | | 46.8% | Medium | |
-| 0380 | Insert Delete GetRandom O(1) | | 47.5% | Medium | |
-| 0381 | Insert Delete GetRandom O(1) - Duplicates allowed | | 34.1% | Hard | |
-| 0382 | Linked List Random Node | | 52.1% | Medium | |
-| 0383 | Ransom Note | | 53.1% | Easy | |
-| 0384 | Shuffle an Array | | 52.8% | Medium | |
-| 0385 | Mini Parser | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0385.Mini-Parser) | 33.8% | Medium | |
-| 0386 | Lexicographical Numbers | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0386.Lexicographical-Numbers) | 51.6% | Medium | |
-| 0387 | First Unique Character in a String | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0387.First-Unique-Character-in-a-String) | 53.3% | Easy | |
-| 0388 | Longest Absolute File Path | | 41.7% | Medium | |
-| 0389 | Find the Difference | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0389.Find-the-Difference) | 55.3% | Easy | |
-| 0390 | Elimination Game | | 44.5% | Medium | |
-| 0391 | Perfect Rectangle | | 30.4% | Hard | |
-| 0392 | Is Subsequence | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0392.Is-Subsequence) | 49.2% | Easy | |
-| 0393 | UTF-8 Validation | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0393.UTF-8-Validation) | 37.5% | Medium | |
-| 0394 | Decode String | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0394.Decode-String) | 49.9% | Medium | |
-| 0395 | Longest Substring with At Least K Repeating Characters | | 41.4% | Medium | |
-| 0396 | Rotate Function | | 36.3% | Medium | |
-| 0397 | Integer Replacement | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0397.Integer-Replacement) | 32.9% | Medium | |
-| 0398 | Random Pick Index | | 55.9% | Medium | |
-| 0399 | Evaluate Division | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0399.Evaluate-Division) | 51.6% | Medium | |
-| 0400 | Nth Digit | | 31.7% | Medium | |
-| 0401 | Binary Watch | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0401.Binary-Watch) | 47.5% | Easy | |
-| 0402 | Remove K Digits | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0402.Remove-K-Digits) | 28.4% | Medium | |
-| 0403 | Frog Jump | | 39.7% | Hard | |
-| 0404 | Sum of Left Leaves | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0404.Sum-of-Left-Leaves) | 50.9% | Easy | |
-| 0405 | Convert a Number to Hexadecimal | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0405.Convert-a-Number-to-Hexadecimal) | 43.9% | Easy | |
-| 0406 | Queue Reconstruction by Height | | 66.8% | Medium | |
-| 0407 | Trapping Rain Water II | | 42.4% | Hard | |
-| 0408 | Valid Word Abbreviation | | 30.6% | Easy | |
-| 0409 | Longest Palindrome | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0409.Longest-Palindrome) | 50.3% | Easy | |
-| 0410 | Split Array Largest Sum | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0410.Split-Array-Largest-Sum) | 44.5% | Hard | |
-| 0411 | Minimum Unique Word Abbreviation | | 36.3% | Hard | |
-| 0412 | Fizz Buzz | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0412.Fizz-Buzz) | 62.3% | Easy | |
-| 0413 | Arithmetic Slices | | 57.9% | Medium | |
-| 0414 | Third Maximum Number | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0414.Third-Maximum-Number) | 30.5% | Easy | |
-| 0415 | Add Strings | | 47.5% | Easy | |
-| 0416 | Partition Equal Subset Sum | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0416.Partition-Equal-Subset-Sum) | 43.7% | Medium | |
-| 0417 | Pacific Atlantic Water Flow | | 41.1% | Medium | |
-| 0418 | Sentence Screen Fitting | | 32.6% | Medium | |
-| 0419 | Battleships in a Board | | 70.0% | Medium | |
-| 0420 | Strong Password Checker | | 14.1% | Hard | |
-| 0421 | Maximum XOR of Two Numbers in an Array | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0421.Maximum-XOR-of-Two-Numbers-in-an-Array) | 53.5% | Medium | |
-| 0422 | Valid Word Square | | 37.7% | Easy | |
-| 0423 | Reconstruct Original Digits from English | | 46.9% | Medium | |
-| 0424 | Longest Repeating Character Replacement | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0424.Longest-Repeating-Character-Replacement) | 47.0% | Medium | |
-| 0425 | Word Squares | | 47.6% | Hard | |
-| 0426 | Convert Binary Search Tree to Sorted Doubly Linked List | | 59.1% | Medium | |
-| 0427 | Construct Quad Tree | | 61.4% | Medium | |
-| 0428 | Serialize and Deserialize N-ary Tree | | 59.4% | Hard | |
-| 0429 | N-ary Tree Level Order Traversal | | 65.0% | Medium | |
-| 0430 | Flatten a Multilevel Doubly Linked List | | 55.1% | Medium | |
-| 0431 | Encode N-ary Tree to Binary Tree | | 70.8% | Hard | |
-| 0432 | All O`one Data Structure | | 32.4% | Hard | |
-| 0433 | Minimum Genetic Mutation | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0433.Minimum-Genetic-Mutation) | 41.8% | Medium | |
-| 0434 | Number of Segments in a String | | 37.7% | Easy | |
-| 0435 | Non-overlapping Intervals | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0435.Non-overlapping-Intervals) | 42.9% | Medium | |
-| 0436 | Find Right Interval | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0436.Find-Right-Interval) | 45.4% | Medium | |
-| 0437 | Path Sum III | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0437.Path-Sum-III) | 46.5% | Medium | |
-| 0438 | Find All Anagrams in a String | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0438.Find-All-Anagrams-in-a-String) | 43.3% | Medium | |
-| 0439 | Ternary Expression Parser | | 55.9% | Medium | |
-| 0440 | K-th Smallest in Lexicographical Order | | 29.1% | Hard | |
-| 0441 | Arranging Coins | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0441.Arranging-Coins) | 41.8% | Easy | |
-| 0442 | Find All Duplicates in an Array | | 67.7% | Medium | |
-| 0443 | String Compression | | 41.3% | Easy | |
-| 0444 | Sequence Reconstruction | | 22.2% | Medium | |
-| 0445 | Add Two Numbers II | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0445.Add-Two-Numbers-II) | 54.5% | Medium | |
-| 0446 | Arithmetic Slices II - Subsequence | | 32.7% | Hard | |
-| 0447 | Number of Boomerangs | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0447.Number-of-Boomerangs) | 51.8% | Easy | |
-| 0448 | Find All Numbers Disappeared in an Array | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0448.Find-All-Numbers-Disappeared-in-an-Array) | 55.9% | Easy | |
-| 0449 | Serialize and Deserialize BST | | 52.0% | Medium | |
-| 0450 | Delete Node in a BST | | 43.1% | Medium | |
-| 0451 | Sort Characters By Frequency | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0451.Sort-Characters-By-Frequency) | 63.0% | Medium | |
-| 0452 | Minimum Number of Arrows to Burst Balloons | | 49.6% | Medium | |
-| 0453 | Minimum Moves to Equal Array Elements | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0453.Minimum-Moves-to-Equal-Array-Elements) | 50.2% | Easy | |
-| 0454 | 4Sum II | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0454.4Sum-II) | 53.1% | Medium | |
-| 0455 | Assign Cookies | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0455.Assign-Cookies) | 49.9% | Easy | |
-| 0456 | 132 Pattern | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0456.132-Pattern) | 28.9% | Medium | |
-| 0457 | Circular Array Loop | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0457.Circular-Array-Loop) | 29.4% | Medium | |
-| 0458 | Poor Pigs | | 47.4% | Hard | |
-| 0459 | Repeated Substring Pattern | | 42.2% | Easy | |
-| 0460 | LFU Cache | | 34.2% | Hard | |
-| 0461 | Hamming Distance | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0461.Hamming-Distance) | 72.8% | Easy | |
-| 0462 | Minimum Moves to Equal Array Elements II | | 53.8% | Medium | |
-| 0463 | Island Perimeter | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0463.Island-Perimeter) | 65.7% | Easy | |
-| 0464 | Can I Win | | 28.8% | Medium | |
-| 0465 | Optimal Account Balancing | | 46.8% | Hard | |
-| 0466 | Count The Repetitions | | 28.2% | Hard | |
-| 0467 | Unique Substrings in Wraparound String | | 35.6% | Medium | |
-| 0468 | Validate IP Address | | 24.0% | Medium | |
-| 0469 | Convex Polygon | | 37.0% | Medium | |
-| 0470 | Implement Rand10() Using Rand7() | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0470.Implement-Rand10-Using-Rand7) | 46.3% | Medium | |
-| 0471 | Encode String with Shortest Length | | 47.1% | Hard | |
-| 0472 | Concatenated Words | | 43.6% | Hard | |
-| 0473 | Matchsticks to Square | | 37.7% | Medium | |
-| 0474 | Ones and Zeroes | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0474.Ones-and-Zeroes) | 42.8% | Medium | |
-| 0475 | Heaters | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0475.Heaters) | 33.1% | Easy | |
-| 0476 | Number Complement | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0476.Number-Complement) | 64.8% | Easy | |
-| 0477 | Total Hamming Distance | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0477.Total-Hamming-Distance) | 50.5% | Medium | |
-| 0478 | Generate Random Point in a Circle | | 38.5% | Medium | |
-| 0479 | Largest Palindrome Product | | 29.0% | Hard | |
-| 0480 | Sliding Window Median | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0480.Sliding-Window-Median) | 37.2% | Hard | |
-| 0481 | Magical String | | 47.5% | Medium | |
-| 0482 | License Key Formatting | | 43.1% | Easy | |
-| 0483 | Smallest Good Base | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0483.Smallest-Good-Base) | 35.7% | Hard | |
-| 0484 | Find Permutation | | 60.5% | Medium | |
-| 0485 | Max Consecutive Ones | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0485.Max-Consecutive-Ones) | 54.7% | Easy | |
-| 0486 | Predict the Winner | | 47.9% | Medium | |
-| 0487 | Max Consecutive Ones II | | 48.5% | Medium | |
-| 0488 | Zuma Game | | 39.8% | Hard | |
-| 0489 | Robot Room Cleaner | | 69.7% | Hard | |
-| 0490 | The Maze | | 51.4% | Medium | |
-| 0491 | Increasing Subsequences | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0491.Increasing-Subsequences) | 46.1% | Medium | |
-| 0492 | Construct the Rectangle | | 49.6% | Easy | |
-| 0493 | Reverse Pairs | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0493.Reverse-Pairs) | 25.2% | Hard | |
-| 0494 | Target Sum | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0494.Target-Sum) | 46.3% | Medium | |
-| 0495 | Teemo Attacking | | 53.6% | Medium | |
-| 0496 | Next Greater Element I | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0496.Next-Greater-Element-I) | 63.8% | Easy | |
-| 0497 | Random Point in Non-overlapping Rectangles | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0497.Random-Point-in-Non-overlapping-Rectangles) | 37.8% | Medium | |
-| 0498 | Diagonal Traverse | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0498.Diagonal-Traverse) | 48.2% | Medium | |
-| 0499 | The Maze III | | 41.0% | Hard | |
-| 0500 | Keyboard Row | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0500.Keyboard-Row) | 64.7% | Easy | |
-| 0501 | Find Mode in Binary Search Tree | | 42.3% | Easy | |
-| 0502 | IPO | | 40.4% | Hard | |
-| 0503 | Next Greater Element II | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0503.Next-Greater-Element-II) | 56.5% | Medium | |
-| 0504 | Base 7 | | 46.2% | Easy | |
-| 0505 | The Maze II | | 47.7% | Medium | |
-| 0506 | Relative Ranks | | 50.5% | Easy | |
-| 0507 | Perfect Number | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0507.Perfect-Number) | 35.5% | Easy | |
-| 0508 | Most Frequent Subtree Sum | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0508.Most-Frequent-Subtree-Sum) | 57.9% | Medium | |
-| 0509 | Fibonacci Number | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0509.Fibonacci-Number) | 67.2% | Easy | |
-| 0510 | Inorder Successor in BST II | | 58.0% | Medium | |
-| 0511 | Game Play Analysis I | | 80.8% | Easy | |
-| 0512 | Game Play Analysis II | | 55.5% | Easy | |
-| 0513 | Find Bottom Left Tree Value | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0513.Find-Bottom-Left-Tree-Value) | 61.5% | Medium | |
-| 0514 | Freedom Trail | | 43.0% | Hard | |
-| 0515 | Find Largest Value in Each Tree Row | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0515.Find-Largest-Value-in-Each-Tree-Row) | 61.1% | Medium | |
-| 0516 | Longest Palindromic Subsequence | | 53.2% | Medium | |
-| 0517 | Super Washing Machines | | 38.3% | Hard | |
-| 0518 | Coin Change 2 | | 50.2% | Medium | |
-| 0519 | Random Flip Matrix | | 36.7% | Medium | |
-| 0520 | Detect Capital | | 54.4% | Easy | |
-| 0521 | Longest Uncommon Subsequence I | | 57.6% | Easy | |
-| 0522 | Longest Uncommon Subsequence II | | 34.0% | Medium | |
-| 0523 | Continuous Subarray Sum | | 24.6% | Medium | |
-| 0524 | Longest Word in Dictionary through Deleting | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0524.Longest-Word-in-Dictionary-through-Deleting) | 48.4% | Medium | |
-| 0525 | Contiguous Array | | 42.8% | Medium | |
-| 0526 | Beautiful Arrangement | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0526.Beautiful-Arrangement) | 57.8% | Medium | |
-| 0527 | Word Abbreviation | | 54.2% | Hard | |
-| 0528 | Random Pick with Weight | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0528.Random-Pick-with-Weight) | 43.9% | Medium | |
-| 0529 | Minesweeper | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0529.Minesweeper) | 59.1% | Medium | |
-| 0530 | Minimum Absolute Difference in BST | | 53.7% | Easy | |
-| 0531 | Lonely Pixel I | | 59.0% | Medium | |
-| 0532 | K-diff Pairs in an Array | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0532.K-diff-Pairs-in-an-Array) | 31.5% | Easy | |
-| 0533 | Lonely Pixel II | | 47.9% | Medium | |
-| 0534 | Game Play Analysis III | | 75.9% | Medium | |
-| 0535 | Encode and Decode TinyURL | | 79.9% | Medium | |
-| 0536 | Construct Binary Tree from String | | 48.3% | Medium | |
-| 0537 | Complex Number Multiplication | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0537.Complex-Number-Multiplication) | 67.4% | Medium | |
-| 0538 | Convert BST to Greater Tree | | 55.3% | Easy | |
-| 0539 | Minimum Time Difference | | 51.5% | Medium | |
-| 0540 | Single Element in a Sorted Array | | 57.9% | Medium | |
-| 0541 | Reverse String II | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0541.Reverse-String-II) | 48.4% | Easy | |
-| 0542 | 01 Matrix | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0542.01-Matrix) | 39.8% | Medium | |
-| 0543 | Diameter of Binary Tree | | 48.4% | Easy | |
-| 0544 | Output Contest Matches | | 75.2% | Medium | |
-| 0545 | Boundary of Binary Tree | | 38.9% | Medium | |
-| 0546 | Remove Boxes | | 42.7% | Hard | |
-| 0547 | Friend Circles | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0547.Friend-Circles) | 58.5% | Medium | |
-| 0548 | Split Array with Equal Sum | | 46.4% | Medium | |
-| 0549 | Binary Tree Longest Consecutive Sequence II | | 47.0% | Medium | |
-| 0550 | Game Play Analysis IV | | 45.2% | Medium | |
-| 0551 | Student Attendance Record I | | 46.0% | Easy | |
-| 0552 | Student Attendance Record II | | 36.7% | Hard | |
-| 0553 | Optimal Division | | 56.7% | Medium | |
-| 0554 | Brick Wall | | 50.0% | Medium | |
-| 0555 | Split Concatenated Strings | | 42.2% | Medium | |
-| 0556 | Next Greater Element III | | 31.7% | Medium | |
-| 0557 | Reverse Words in a String III | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0557.Reverse-Words-in-a-String-III) | 69.8% | Easy | |
-| 0558 | Logical OR of Two Binary Grids Represented as Quad-Trees | | 44.6% | Medium | |
-| 0559 | Maximum Depth of N-ary Tree | | 68.6% | Easy | |
-| 0560 | Subarray Sum Equals K | | 43.8% | Medium | |
-| 0561 | Array Partition I | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0561.Array-Partition-I) | 72.0% | Easy | |
-| 0562 | Longest Line of Consecutive One in Matrix | | 45.8% | Medium | |
-| 0563 | Binary Tree Tilt | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0563.Binary-Tree-Tilt) | 48.7% | Easy | |
-| 0564 | Find the Closest Palindrome | | 19.7% | Hard | |
-| 0565 | Array Nesting | | 55.5% | Medium | |
-| 0566 | Reshape the Matrix | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0566.Reshape-the-Matrix) | 60.5% | Easy | |
-| 0567 | Permutation in String | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0567.Permutation-in-String) | 44.4% | Medium | |
-| 0568 | Maximum Vacation Days | | 40.8% | Hard | |
-| 0569 | Median Employee Salary | | 57.6% | Hard | |
-| 0570 | Managers with at Least 5 Direct Reports | | 66.0% | Medium | |
-| 0571 | Find Median Given Frequency of Numbers | | 44.7% | Hard | |
-| 0572 | Subtree of Another Tree | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0572.Subtree-of-Another-Tree) | 44.1% | Easy | |
-| 0573 | Squirrel Simulation | | 55.6% | Medium | |
-| 0574 | Winning Candidate | | 47.5% | Medium | |
-| 0575 | Distribute Candies | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0575.Distribute-Candies) | 61.4% | Easy | |
-| 0576 | Out of Boundary Paths | | 35.1% | Medium | |
-| 0577 | Employee Bonus | | 68.1% | Easy | |
-| 0578 | Get Highest Answer Rate Question | | 39.3% | Medium | |
-| 0579 | Find Cumulative Salary of an Employee | | 37.0% | Hard | |
-| 0580 | Count Student Number in Departments | | 48.7% | Medium | |
-| 0581 | Shortest Unsorted Continuous Subarray | | 31.1% | Easy | |
-| 0582 | Kill Process | | 60.8% | Medium | |
-| 0583 | Delete Operation for Two Strings | | 48.6% | Medium | |
-| 0584 | Find Customer Referee | | 72.2% | Easy | |
-| 0585 | Investments in 2016 | | 54.7% | Medium | |
-| 0586 | Customer Placing the Largest Number of Orders | | 72.9% | Easy | |
-| 0587 | Erect the Fence | | 35.9% | Hard | |
-| 0588 | Design In-Memory File System | | 45.9% | Hard | |
-| 0589 | N-ary Tree Preorder Traversal | | 72.0% | Easy | |
-| 0590 | N-ary Tree Postorder Traversal | | 72.1% | Easy | |
-| 0591 | Tag Validator | | 34.3% | Hard | |
-| 0592 | Fraction Addition and Subtraction | | 49.0% | Medium | |
-| 0593 | Valid Square | | 43.1% | Medium | |
-| 0594 | Longest Harmonious Subsequence | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0594.Longest-Harmonious-Subsequence) | 46.6% | Easy | |
-| 0595 | Big Countries | | 77.3% | Easy | |
-| 0596 | Classes More Than 5 Students | | 38.0% | Easy | |
-| 0597 | Friend Requests I: Overall Acceptance Rate | | 40.9% | Easy | |
-| 0598 | Range Addition II | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0598.Range-Addition-II) | 49.6% | Easy | |
-| 0599 | Minimum Index Sum of Two Lists | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0599.Minimum-Index-Sum-of-Two-Lists) | 50.7% | Easy | |
-| 0600 | Non-negative Integers without Consecutive Ones | | 34.1% | Hard | |
-| 0601 | Human Traffic of Stadium | | 41.6% | Hard | |
-| 0602 | Friend Requests II: Who Has the Most Friends | | 53.3% | Medium | |
-| 0603 | Consecutive Available Seats | | 63.9% | Easy | |
-| 0604 | Design Compressed String Iterator | | 37.5% | Easy | |
-| 0605 | Can Place Flowers | | 31.6% | Easy | |
-| 0606 | Construct String from Binary Tree | | 54.1% | Easy | |
-| 0607 | Sales Person | | 62.9% | Easy | |
-| 0608 | Tree Node | | 67.0% | Medium | |
-| 0609 | Find Duplicate File in System | | 59.5% | Medium | |
-| 0610 | Triangle Judgement | | 65.9% | Easy | |
-| 0611 | Valid Triangle Number | | 48.4% | Medium | |
-| 0612 | Shortest Distance in a Plane | | 59.5% | Medium | |
-| 0613 | Shortest Distance in a Line | | 77.5% | Easy | |
-| 0614 | Second Degree Follower | | 30.2% | Medium | |
-| 0615 | Average Salary: Departments VS Company | | 46.8% | Hard | |
-| 0616 | Add Bold Tag in String | | 43.0% | Medium | |
-| 0617 | Merge Two Binary Trees | | 74.1% | Easy | |
-| 0618 | Students Report By Geography | | 54.8% | Hard | |
-| 0619 | Biggest Single Number | | 43.1% | Easy | |
-| 0620 | Not Boring Movies | | 67.5% | Easy | |
-| 0621 | Task Scheduler | | 50.0% | Medium | |
-| 0622 | Design Circular Queue | | 43.7% | Medium | |
-| 0623 | Add One Row to Tree | | 49.7% | Medium | |
-| 0624 | Maximum Distance in Arrays | | 38.9% | Easy | |
-| 0625 | Minimum Factorization | | 32.8% | Medium | |
-| 0626 | Exchange Seats | | 62.2% | Medium | |
-| 0627 | Swap Salary | | 75.2% | Easy | |
-| 0628 | Maximum Product of Three Numbers | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0628.Maximum-Product-of-Three-Numbers) | 47.1% | Easy | |
-| 0629 | K Inverse Pairs Array | | 31.1% | Hard | |
-| 0630 | Course Schedule III | | 33.5% | Hard | |
-| 0631 | Design Excel Sum Formula | | 31.5% | Hard | |
-| 0632 | Smallest Range Covering Elements from K Lists | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0632.Smallest-Range-Covering-Elements-from-K-Lists) | 52.4% | Hard | |
-| 0633 | Sum of Square Numbers | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0633.Sum-of-Square-Numbers) | 32.2% | Easy | |
-| 0634 | Find the Derangement of An Array | | 40.1% | Medium | |
-| 0635 | Design Log Storage System | | 58.6% | Medium | |
-| 0636 | Exclusive Time of Functions | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0636.Exclusive-Time-of-Functions) | 52.0% | Medium | |
-| 0637 | Average of Levels in Binary Tree | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0637.Average-of-Levels-in-Binary-Tree) | 63.0% | Easy | |
-| 0638 | Shopping Offers | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0638.Shopping-Offers) | 51.5% | Medium | |
-| 0639 | Decode Ways II | | 26.6% | Hard | |
-| 0640 | Solve the Equation | | 42.0% | Medium | |
-| 0641 | Design Circular Deque | | 52.7% | Medium | |
-| 0642 | Design Search Autocomplete System | | 44.6% | Hard | |
-| 0643 | Maximum Average Subarray I | | 41.5% | Easy | |
-| 0644 | Maximum Average Subarray II | | 32.0% | Hard | |
-| 0645 | Set Mismatch | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0645.Set-Mismatch) | 42.1% | Easy | |
-| 0646 | Maximum Length of Pair Chain | | 51.8% | Medium | |
-| 0647 | Palindromic Substrings | | 60.6% | Medium | |
-| 0648 | Replace Words | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0648.Replace-Words) | 56.5% | Medium | |
-| 0649 | Dota2 Senate | | 39.2% | Medium | |
-| 0650 | 2 Keys Keyboard | | 49.2% | Medium | |
-| 0651 | 4 Keys Keyboard | | 52.4% | Medium | |
-| 0652 | Find Duplicate Subtrees | | 50.1% | Medium | |
-| 0653 | Two Sum IV - Input is a BST | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0653.Two-Sum-IV---Input-is-a-BST) | 55.5% | Easy | |
-| 0654 | Maximum Binary Tree | | 79.9% | Medium | |
-| 0655 | Print Binary Tree | | 55.0% | Medium | |
-| 0656 | Coin Path | | 29.0% | Hard | |
-| 0657 | Robot Return to Origin | | 73.5% | Easy | |
-| 0658 | Find K Closest Elements | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0658.Find-K-Closest-Elements) | 40.9% | Medium | |
-| 0659 | Split Array into Consecutive Subsequences | | 43.7% | Medium | |
-| 0660 | Remove 9 | | 53.3% | Hard | |
-| 0661 | Image Smoother | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0661.Image-Smoother) | 51.5% | Easy | |
-| 0662 | Maximum Width of Binary Tree | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0662.Maximum-Width-of-Binary-Tree) | 41.1% | Medium | |
-| 0663 | Equal Tree Partition | | 39.5% | Medium | |
-| 0664 | Strange Printer | | 40.2% | Hard | |
-| 0665 | Non-decreasing Array | | 19.5% | Easy | |
-| 0666 | Path Sum IV | | 54.7% | Medium | |
-| 0667 | Beautiful Arrangement II | | 54.2% | Medium | |
-| 0668 | Kth Smallest Number in Multiplication Table | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0668.Kth-Smallest-Number-in-Multiplication-Table) | 45.6% | Hard | |
-| 0669 | Trim a Binary Search Tree | | 63.0% | Easy | |
-| 0670 | Maximum Swap | | 43.6% | Medium | |
-| 0671 | Second Minimum Node In a Binary Tree | | 42.7% | Easy | |
-| 0672 | Bulb Switcher II | | 50.9% | Medium | |
-| 0673 | Number of Longest Increasing Subsequence | | 35.7% | Medium | |
-| 0674 | Longest Continuous Increasing Subsequence | | 45.9% | Easy | |
-| 0675 | Cut Off Trees for Golf Event | | 34.6% | Hard | |
-| 0676 | Implement Magic Dictionary | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0676.Implement-Magic-Dictionary) | 54.5% | Medium | |
-| 0677 | Map Sum Pairs | | 53.5% | Medium | |
-| 0678 | Valid Parenthesis String | | 31.0% | Medium | |
-| 0679 | 24 Game | | 46.4% | Hard | |
-| 0680 | Valid Palindrome II | | 36.6% | Easy | |
-| 0681 | Next Closest Time | | 45.0% | Medium | |
-| 0682 | Baseball Game | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0682.Baseball-Game) | 63.7% | Easy | |
-| 0683 | K Empty Slots | | 35.7% | Hard | |
-| 0684 | Redundant Connection | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0684.Redundant-Connection) | 57.3% | Medium | |
-| 0685 | Redundant Connection II | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0685.Redundant-Connection-II) | 32.4% | Hard | |
-| 0686 | Repeated String Match | | 32.3% | Easy | |
-| 0687 | Longest Univalue Path | | 36.2% | Easy | |
-| 0688 | Knight Probability in Chessboard | | 48.9% | Medium | |
-| 0689 | Maximum Sum of 3 Non-Overlapping Subarrays | | 46.3% | Hard | |
-| 0690 | Employee Importance | | 57.3% | Easy | |
-| 0691 | Stickers to Spell Word | | 43.0% | Hard | |
-| 0692 | Top K Frequent Words | | 51.8% | Medium | |
-| 0693 | Binary Number with Alternating Bits | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0693.Binary-Number-with-Alternating-Bits) | 59.4% | Easy | |
-| 0694 | Number of Distinct Islands | | 56.0% | Medium | |
-| 0695 | Max Area of Island | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0695.Max-Area-of-Island) | 62.7% | Medium | |
-| 0696 | Count Binary Substrings | | 56.0% | Easy | |
-| 0697 | Degree of an Array | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0697.Degree-of-an-Array) | 53.8% | Easy | |
-| 0698 | Partition to K Equal Sum Subsets | | 44.9% | Medium | |
-| 0699 | Falling Squares | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0699.Falling-Squares) | 41.8% | Hard | |
-| 0700 | Search in a Binary Search Tree | | 73.1% | Easy | |
-| 0701 | Insert into a Binary Search Tree | | 77.8% | Medium | |
-| 0702 | Search in a Sorted Array of Unknown Size | | 66.7% | Medium | |
-| 0703 | Kth Largest Element in a Stream | | 49.7% | Easy | |
-| 0704 | Binary Search | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0704.Binary-Search) | 52.1% | Easy | |
-| 0705 | Design HashSet | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0705.Design-HashSet) | 64.3% | Easy | |
-| 0706 | Design HashMap | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0706.Design-HashMap) | 61.3% | Easy | |
-| 0707 | Design Linked List | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0707.Design-Linked-List) | 24.5% | Medium | |
-| 0708 | Insert into a Sorted Circular Linked List | | 31.6% | Medium | |
-| 0709 | To Lower Case | | 79.3% | Easy | |
-| 0710 | Random Pick with Blacklist | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0710.Random-Pick-with-Blacklist) | 32.4% | Hard | |
-| 0711 | Number of Distinct Islands II | | 47.3% | Hard | |
-| 0712 | Minimum ASCII Delete Sum for Two Strings | | 58.5% | Medium | |
-| 0713 | Subarray Product Less Than K | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0713.Subarray-Product-Less-Than-K) | 39.1% | Medium | |
-| 0714 | Best Time to Buy and Sell Stock with Transaction Fee | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0714.Best-Time-to-Buy-and-Sell-Stock-with-Transaction-Fee) | 54.7% | Medium | |
-| 0715 | Range Module | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0715.Range-Module) | 38.5% | Hard | |
-| 0716 | Max Stack | | 42.6% | Easy | |
-| 0717 | 1-bit and 2-bit Characters | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0717.1-bit-and-2-bit-Characters) | 48.8% | Easy | |
-| 0718 | Maximum Length of Repeated Subarray | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0718.Maximum-Length-of-Repeated-Subarray) | 49.3% | Medium | |
-| 0719 | Find K-th Smallest Pair Distance | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0719.Find-K-th-Smallest-Pair-Distance) | 31.5% | Hard | |
-| 0720 | Longest Word in Dictionary | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0720.Longest-Word-in-Dictionary) | 48.2% | Easy | |
-| 0721 | Accounts Merge | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0721.Accounts-Merge) | 48.7% | Medium | |
-| 0722 | Remove Comments | | 34.6% | Medium | |
-| 0723 | Candy Crush | | 69.3% | Medium | |
-| 0724 | Find Pivot Index | | 44.0% | Easy | |
-| 0725 | Split Linked List in Parts | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0725.Split-Linked-List-in-Parts) | 52.1% | Medium | |
-| 0726 | Number of Atoms | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0726.Number-of-Atoms) | 48.9% | Hard | |
-| 0727 | Minimum Window Subsequence | | 41.8% | Hard | |
-| 0728 | Self Dividing Numbers | | 74.3% | Easy | |
-| 0729 | My Calendar I | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0729.My-Calendar-I) | 51.8% | Medium | |
-| 0730 | Count Different Palindromic Subsequences | | 41.7% | Hard | |
-| 0731 | My Calendar II | | 49.1% | Medium | |
-| 0732 | My Calendar III | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0732.My-Calendar-III) | 59.9% | Hard | |
-| 0733 | Flood Fill | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0733.Flood-Fill) | 55.3% | Easy | |
-| 0734 | Sentence Similarity | | 42.1% | Easy | |
-| 0735 | Asteroid Collision | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0735.Asteroid-Collision) | 41.1% | Medium | |
-| 0736 | Parse Lisp Expression | | 47.5% | Hard | |
-| 0737 | Sentence Similarity II | | 45.8% | Medium | |
-| 0738 | Monotone Increasing Digits | | 44.3% | Medium | |
-| 0739 | Daily Temperatures | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0739.Daily-Temperatures) | 63.3% | Medium | |
-| 0740 | Delete and Earn | | 48.6% | Medium | |
-| 0741 | Cherry Pickup | | 33.9% | Hard | |
-| 0742 | Closest Leaf in a Binary Tree | | 43.5% | Medium | |
-| 0743 | Network Delay Time | | 44.9% | Medium | |
-| 0744 | Find Smallest Letter Greater Than Target | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0744.Find-Smallest-Letter-Greater-Than-Target) | 45.4% | Easy | |
-| 0745 | Prefix and Suffix Search | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0745.Prefix-and-Suffix-Search) | 34.1% | Hard | |
-| 0746 | Min Cost Climbing Stairs | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0746.Min-Cost-Climbing-Stairs) | 50.3% | Easy | |
-| 0747 | Largest Number At Least Twice of Others | | 42.0% | Easy | |
-| 0748 | Shortest Completing Word | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0748.Shortest-Completing-Word) | 56.7% | Easy | |
-| 0749 | Contain Virus | | 44.5% | Hard | |
-| 0750 | Number Of Corner Rectangles | | 66.4% | Medium | |
-| 0751 | IP to CIDR | | 61.8% | Medium | |
-| 0752 | Open the Lock | | 51.8% | Medium | |
-| 0753 | Cracking the Safe | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0753.Cracking-the-Safe) | 50.5% | Hard | |
-| 0754 | Reach a Number | | 34.7% | Medium | |
-| 0755 | Pour Water | | 43.3% | Medium | |
-| 0756 | Pyramid Transition Matrix | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0756.Pyramid-Transition-Matrix) | 54.6% | Medium | |
-| 0757 | Set Intersection Size At Least Two | | 40.1% | Hard | |
-| 0758 | Bold Words in String | | 45.9% | Easy | |
-| 0759 | Employee Free Time | | 66.2% | Hard | |
-| 0760 | Find Anagram Mappings | | 81.1% | Easy | |
-| 0761 | Special Binary String | | 54.7% | Hard | |
-| 0762 | Prime Number of Set Bits in Binary Representation | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0762.Prime-Number-of-Set-Bits-in-Binary-Representation) | 63.2% | Easy | |
-| 0763 | Partition Labels | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0763.Partition-Labels) | 76.0% | Medium | |
-| 0764 | Largest Plus Sign | | 46.0% | Medium | |
-| 0765 | Couples Holding Hands | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0765.Couples-Holding-Hands) | 54.3% | Hard | |
-| 0766 | Toeplitz Matrix | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0766.Toeplitz-Matrix) | 65.0% | Easy | |
-| 0767 | Reorganize String | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0767.Reorganize-String) | 48.7% | Medium | |
-| 0768 | Max Chunks To Make Sorted II | | 48.7% | Hard | |
-| 0769 | Max Chunks To Make Sorted | | 54.7% | Medium | |
-| 0770 | Basic Calculator IV | | 47.9% | Hard | |
-| 0771 | Jewels and Stones | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0771.Jewels-and-Stones) | 86.3% | Easy | |
-| 0772 | Basic Calculator III | | 41.2% | Hard | |
-| 0773 | Sliding Puzzle | | 59.3% | Hard | |
-| 0774 | Minimize Max Distance to Gas Station | | 46.9% | Hard | |
-| 0775 | Global and Local Inversions | | 42.1% | Medium | |
-| 0776 | Split BST | | 55.8% | Medium | |
-| 0777 | Swap Adjacent in LR String | | 34.8% | Medium | |
-| 0778 | Swim in Rising Water | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0778.Swim-in-Rising-Water) | 53.0% | Hard | |
-| 0779 | K-th Symbol in Grammar | | 37.2% | Medium | |
-| 0780 | Reaching Points | | 29.3% | Hard | |
-| 0781 | Rabbits in Forest | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0781.Rabbits-in-Forest) | 54.5% | Medium | |
-| 0782 | Transform to Chessboard | | 42.8% | Hard | |
-| 0783 | Minimum Distance Between BST Nodes | | 52.6% | Easy | |
-| 0784 | Letter Case Permutation | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0784.Letter-Case-Permutation) | 64.6% | Medium | |
-| 0785 | Is Graph Bipartite? | | 47.5% | Medium | |
-| 0786 | K-th Smallest Prime Fraction | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0786.K-th-Smallest-Prime-Fraction) | 41.0% | Hard | |
-| 0787 | Cheapest Flights Within K Stops | | 39.3% | Medium | |
-| 0788 | Rotated Digits | | 57.1% | Easy | |
-| 0789 | Escape The Ghosts | | 57.4% | Medium | |
-| 0790 | Domino and Tromino Tiling | | 39.2% | Medium | |
-| 0791 | Custom Sort String | | 65.7% | Medium | |
-| 0792 | Number of Matching Subsequences | | 47.4% | Medium | |
-| 0793 | Preimage Size of Factorial Zeroes Function | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0793.Preimage-Size-of-Factorial-Zeroes-Function) | 40.2% | Hard | |
-| 0794 | Valid Tic-Tac-Toe State | | 32.6% | Medium | |
-| 0795 | Number of Subarrays with Bounded Maximum | | 46.3% | Medium | |
-| 0796 | Rotate String | | 49.6% | Easy | |
-| 0797 | All Paths From Source to Target | | 77.9% | Medium | |
-| 0798 | Smallest Rotation with Highest Score | | 44.1% | Hard | |
-| 0799 | Champagne Tower | | 35.7% | Medium | |
-| 0800 | Similar RGB Color | | 61.4% | Easy | |
-| 0801 | Minimum Swaps To Make Sequences Increasing | | 38.9% | Medium | |
-| 0802 | Find Eventual Safe States | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0802.Find-Eventual-Safe-States) | 48.9% | Medium | |
-| 0803 | Bricks Falling When Hit | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0803.Bricks-Falling-When-Hit) | 30.8% | Hard | |
-| 0804 | Unique Morse Code Words | | 77.0% | Easy | |
-| 0805 | Split Array With Same Average | | 26.3% | Hard | |
-| 0806 | Number of Lines To Write String | | 64.9% | Easy | |
-| 0807 | Max Increase to Keep City Skyline | | 83.7% | Medium | |
-| 0808 | Soup Servings | | 39.9% | Medium | |
-| 0809 | Expressive Words | | 47.0% | Medium | |
-| 0810 | Chalkboard XOR Game | | 48.2% | Hard | |
-| 0811 | Subdomain Visit Count | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0811.Subdomain-Visit-Count) | 69.8% | Easy | |
-| 0812 | Largest Triangle Area | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0812.Largest-Triangle-Area) | 58.3% | Easy | |
-| 0813 | Largest Sum of Averages | | 49.9% | Medium | |
-| 0814 | Binary Tree Pruning | | 74.5% | Medium | |
-| 0815 | Bus Routes | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0815.Bus-Routes) | 42.6% | Hard | |
-| 0816 | Ambiguous Coordinates | | 47.2% | Medium | |
-| 0817 | Linked List Components | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0817.Linked-List-Components) | 57.3% | Medium | |
-| 0818 | Race Car | | 39.0% | Hard | |
-| 0819 | Most Common Word | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0819.Most-Common-Word) | 44.8% | Easy | |
-| 0820 | Short Encoding of Words | | 50.7% | Medium | |
-| 0821 | Shortest Distance to a Character | | 66.9% | Easy | |
-| 0822 | Card Flipping Game | | 42.9% | Medium | |
-| 0823 | Binary Trees With Factors | | 35.8% | Medium | |
-| 0824 | Goat Latin | | 63.3% | Easy | |
-| 0825 | Friends Of Appropriate Ages | | 42.6% | Medium | |
-| 0826 | Most Profit Assigning Work | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0826.Most-Profit-Assigning-Work) | 38.5% | Medium | |
-| 0827 | Making A Large Island | | 45.6% | Hard | |
-| 0828 | Count Unique Characters of All Substrings of a Given String | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0828.COPYRIGHT-PROBLEM-XXX) | 45.1% | Hard | |
-| 0829 | Consecutive Numbers Sum | | 37.4% | Hard | |
-| 0830 | Positions of Large Groups | | 49.6% | Easy | |
-| 0831 | Masking Personal Information | | 44.1% | Medium | |
-| 0832 | Flipping an Image | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0832.Flipping-an-Image) | 76.2% | Easy | |
-| 0833 | Find And Replace in String | | 50.4% | Medium | |
-| 0834 | Sum of Distances in Tree | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0834.Sum-of-Distances-in-Tree) | 43.7% | Hard | |
-| 0835 | Image Overlap | | 58.5% | Medium | |
-| 0836 | Rectangle Overlap | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0836.Rectangle-Overlap) | 48.6% | Easy | |
-| 0837 | New 21 Game | | 34.6% | Medium | |
-| 0838 | Push Dominoes | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0838.Push-Dominoes) | 48.4% | Medium | |
-| 0839 | Similar String Groups | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0839.Similar-String-Groups) | 38.6% | Hard | |
-| 0840 | Magic Squares In Grid | | 37.3% | Easy | |
-| 0841 | Keys and Rooms | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0841.Keys-and-Rooms) | 64.3% | Medium | |
-| 0842 | Split Array into Fibonacci Sequence | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0842.Split-Array-into-Fibonacci-Sequence) | 36.3% | Medium | |
-| 0843 | Guess the Word | | 46.1% | Hard | |
-| 0844 | Backspace String Compare | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0844.Backspace-String-Compare) | 46.4% | Easy | |
-| 0845 | Longest Mountain in Array | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0845.Longest-Mountain-in-Array) | 37.2% | Medium | |
-| 0846 | Hand of Straights | | 54.2% | Medium | |
-| 0847 | Shortest Path Visiting All Nodes | | 52.0% | Hard | |
-| 0848 | Shifting Letters | | 44.6% | Medium | |
-| 0849 | Maximize Distance to Closest Person | | 42.6% | Easy | |
-| 0850 | Rectangle Area II | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0850.Rectangle-Area-II) | 47.5% | Hard | |
-| 0851 | Loud and Rich | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0851.Loud-and-Rich) | 51.6% | Medium | |
-| 0852 | Peak Index in a Mountain Array | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0852.Peak-Index-in-a-Mountain-Array) | 71.6% | Easy | |
-| 0853 | Car Fleet | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0853.Car-Fleet) | 42.4% | Medium | |
-| 0854 | K-Similar Strings | | 38.2% | Hard | |
-| 0855 | Exam Room | | 43.1% | Medium | |
-| 0856 | Score of Parentheses | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0856.Score-of-Parentheses) | 60.5% | Medium | |
-| 0857 | Minimum Cost to Hire K Workers | | 49.6% | Hard | |
-| 0858 | Mirror Reflection | | 53.7% | Medium | |
-| 0859 | Buddy Strings | | 27.4% | Easy | |
-| 0860 | Lemonade Change | | 51.6% | Easy | |
-| 0861 | Score After Flipping Matrix | | 72.8% | Medium | |
-| 0862 | Shortest Subarray with Sum at Least K | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0862.Shortest-Subarray-with-Sum-at-Least-K) | 24.6% | Hard | |
-| 0863 | All Nodes Distance K in Binary Tree | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0863.All-Nodes-Distance-K-in-Binary-Tree) | 55.3% | Medium | |
-| 0864 | Shortest Path to Get All Keys | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0864.Shortest-Path-to-Get-All-Keys) | 40.1% | Hard | |
-| 0865 | Smallest Subtree with all the Deepest Nodes | | 60.8% | Medium | |
-| 0866 | Prime Palindrome | | 24.9% | Medium | |
-| 0867 | Transpose Matrix | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0867.Transpose-Matrix) | 62.8% | Easy | |
-| 0868 | Binary Gap | | 60.6% | Easy | |
-| 0869 | Reordered Power of 2 | | 53.3% | Medium | |
-| 0870 | Advantage Shuffle | | 45.6% | Medium | |
-| 0871 | Minimum Number of Refueling Stops | | 31.4% | Hard | |
-| 0872 | Leaf-Similar Trees | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0872.Leaf-Similar-Trees) | 64.5% | Easy | |
-| 0873 | Length of Longest Fibonacci Subsequence | | 48.0% | Medium | |
-| 0874 | Walking Robot Simulation | | 35.3% | Easy | |
-| 0875 | Koko Eating Bananas | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0875.Koko-Eating-Bananas) | 52.1% | Medium | |
-| 0876 | Middle of the Linked List | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0876.Middle-of-the-Linked-List) | 68.4% | Easy | |
-| 0877 | Stone Game | | 64.8% | Medium | |
-| 0878 | Nth Magical Number | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0878.Nth-Magical-Number) | 28.4% | Hard | |
-| 0879 | Profitable Schemes | | 39.7% | Hard | |
-| 0880 | Decoded String at Index | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0880.Decoded-String-at-Index) | 24.3% | Medium | |
-| 0881 | Boats to Save People | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0881.Boats-to-Save-People) | 46.8% | Medium | |
-| 0882 | Reachable Nodes In Subdivided Graph | | 41.3% | Hard | |
-| 0883 | Projection Area of 3D Shapes | | 67.7% | Easy | |
-| 0884 | Uncommon Words from Two Sentences | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0884.Uncommon-Words-from-Two-Sentences) | 63.3% | Easy | |
-| 0885 | Spiral Matrix III | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0885.Spiral-Matrix-III) | 69.3% | Medium | |
-| 0886 | Possible Bipartition | | 44.1% | Medium | |
-| 0887 | Super Egg Drop | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0887.Super-Egg-Drop) | 27.0% | Hard | |
-| 0888 | Fair Candy Swap | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0888.Fair-Candy-Swap) | 58.3% | Easy | |
-| 0889 | Construct Binary Tree from Preorder and Postorder Traversal | | 66.1% | Medium | |
-| 0890 | Find and Replace Pattern | | 73.4% | Medium | |
-| 0891 | Sum of Subsequence Widths | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0891.Sum-of-Subsequence-Widths) | 31.9% | Hard | |
-| 0892 | Surface Area of 3D Shapes | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0892.Surface-Area-of-3D-Shapes) | 58.9% | Easy | |
-| 0893 | Groups of Special-Equivalent Strings | | 66.5% | Easy | |
-| 0894 | All Possible Full Binary Trees | | 75.2% | Medium | |
-| 0895 | Maximum Frequency Stack | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0895.Maximum-Frequency-Stack) | 60.6% | Hard | |
-| 0896 | Monotonic Array | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0896.Monotonic-Array) | 57.9% | Easy | |
-| 0897 | Increasing Order Search Tree | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0897.Increasing-Order-Search-Tree) | 70.7% | Easy | |
-| 0898 | Bitwise ORs of Subarrays | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0898.Bitwise-ORs-of-Subarrays) | 34.8% | Medium | |
-| 0899 | Orderly Queue | | 52.2% | Hard | |
-| 0900 | RLE Iterator | | 53.5% | Medium | |
-| 0901 | Online Stock Span | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0901.Online-Stock-Span) | 60.1% | Medium | |
-| 0902 | Numbers At Most N Given Digit Set | | 31.5% | Hard | |
-| 0903 | Valid Permutations for DI Sequence | | 49.6% | Hard | |
-| 0904 | Fruit Into Baskets | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0904.Fruit-Into-Baskets) | 42.5% | Medium | |
-| 0905 | Sort Array By Parity | | 74.0% | Easy | |
-| 0906 | Super Palindromes | | 32.7% | Hard | |
-| 0907 | Sum of Subarray Minimums | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0907.Sum-of-Subarray-Minimums) | 32.3% | Medium | |
-| 0908 | Smallest Range I | | 65.8% | Easy | |
-| 0909 | Snakes and Ladders | | 38.4% | Medium | |
-| 0910 | Smallest Range II | | 26.6% | Medium | |
-| 0911 | Online Election | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0911.Online-Election) | 50.4% | Medium | |
-| 0912 | Sort an Array | | 63.8% | Medium | |
-| 0913 | Cat and Mouse | | 31.3% | Hard | |
-| 0914 | X of a Kind in a Deck of Cards | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0914.X-of-a-Kind-in-a-Deck-of-Cards) | 34.9% | Easy | |
-| 0915 | Partition Array into Disjoint Intervals | | 45.3% | Medium | |
-| 0916 | Word Subsets | | 47.8% | Medium | |
-| 0917 | Reverse Only Letters | | 57.9% | Easy | |
-| 0918 | Maximum Sum Circular Subarray | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0918.Maximum-Sum-Circular-Subarray) | 33.6% | Medium | |
-| 0919 | Complete Binary Tree Inserter | | 57.3% | Medium | |
-| 0920 | Number of Music Playlists | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0920.Number-of-Music-Playlists) | 46.5% | Hard | |
-| 0921 | Minimum Add to Make Parentheses Valid | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0921.Minimum-Add-to-Make-Parentheses-Valid) | 73.6% | Medium | |
-| 0922 | Sort Array By Parity II | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0922.Sort-Array-By-Parity-II) | 69.2% | Easy | |
-| 0923 | 3Sum With Multiplicity | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0923.3Sum-With-Multiplicity) | 35.7% | Medium | |
-| 0924 | Minimize Malware Spread | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0924.Minimize-Malware-Spread) | 42.0% | Hard | |
-| 0925 | Long Pressed Name | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0925.Long-Pressed-Name) | 40.6% | Easy | |
-| 0926 | Flip String to Monotone Increasing | | 52.3% | Medium | |
-| 0927 | Three Equal Parts | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0927.Three-Equal-Parts) | 33.6% | Hard | |
-| 0928 | Minimize Malware Spread II | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0928.Minimize-Malware-Spread-II) | 40.5% | Hard | |
-| 0929 | Unique Email Addresses | | 67.4% | Easy | |
-| 0930 | Binary Subarrays With Sum | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0930.Binary-Subarrays-With-Sum) | 43.0% | Medium | |
-| 0931 | Minimum Falling Path Sum | | 62.4% | Medium | |
-| 0932 | Beautiful Array | | 58.3% | Medium | |
-| 0933 | Number of Recent Calls | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0933.Number-of-Recent-Calls) | 71.9% | Easy | |
-| 0934 | Shortest Bridge | | 48.1% | Medium | |
-| 0935 | Knight Dialer | | 45.1% | Medium | |
-| 0936 | Stamping The Sequence | | 42.8% | Hard | |
-| 0937 | Reorder Data in Log Files | | 54.4% | Easy | |
-| 0938 | Range Sum of BST | | 81.3% | Easy | |
-| 0939 | Minimum Area Rectangle | | 51.8% | Medium | |
-| 0940 | Distinct Subsequences II | | 41.4% | Hard | |
-| 0941 | Valid Mountain Array | | 33.3% | Easy | |
-| 0942 | DI String Match | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0942.DI-String-Match) | 72.6% | Easy | |
-| 0943 | Find the Shortest Superstring | | 42.8% | Hard | |
-| 0944 | Delete Columns to Make Sorted | | 70.3% | Easy | |
-| 0945 | Minimum Increment to Make Array Unique | | 46.3% | Medium | |
-| 0946 | Validate Stack Sequences | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0946.Validate-Stack-Sequences) | 61.8% | Medium | |
-| 0947 | Most Stones Removed with Same Row or Column | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0947.Most-Stones-Removed-with-Same-Row-or-Column) | 55.3% | Medium | |
-| 0948 | Bag of Tokens | | 40.8% | Medium | |
-| 0949 | Largest Time for Given Digits | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0949.Largest-Time-for-Given-Digits) | 35.9% | Easy | |
-| 0950 | Reveal Cards In Increasing Order | | 74.6% | Medium | |
-| 0951 | Flip Equivalent Binary Trees | | 65.7% | Medium | |
-| 0952 | Largest Component Size by Common Factor | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0952.Largest-Component-Size-by-Common-Factor) | 30.3% | Hard | |
-| 0953 | Verifying an Alien Dictionary | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0953.Verifying-an-Alien-Dictionary) | 54.1% | Easy | |
-| 0954 | Array of Doubled Pairs | | 35.6% | Medium | |
-| 0955 | Delete Columns to Make Sorted II | | 33.2% | Medium | |
-| 0956 | Tallest Billboard | | 39.7% | Hard | |
-| 0957 | Prison Cells After N Days | | 40.7% | Medium | |
-| 0958 | Check Completeness of a Binary Tree | | 52.0% | Medium | |
-| 0959 | Regions Cut By Slashes | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0959.Regions-Cut-By-Slashes) | 66.1% | Medium | |
-| 0960 | Delete Columns to Make Sorted III | | 53.6% | Hard | |
-| 0961 | N-Repeated Element in Size 2N Array | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0961.N-Repeated-Element-in-Size-2N-Array) | 73.7% | Easy | |
-| 0962 | Maximum Width Ramp | | 45.3% | Medium | |
-| 0963 | Minimum Area Rectangle II | | 50.8% | Medium | |
-| 0964 | Least Operators to Express Number | | 43.7% | Hard | |
-| 0965 | Univalued Binary Tree | | 67.7% | Easy | |
-| 0966 | Vowel Spellchecker | | 47.2% | Medium | |
-| 0967 | Numbers With Same Consecutive Differences | | 39.4% | Medium | |
-| 0968 | Binary Tree Cameras | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0968.Binary-Tree-Cameras) | 37.5% | Hard | |
-| 0969 | Pancake Sorting | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0969.Pancake-Sorting) | 67.5% | Medium | |
-| 0970 | Powerful Integers | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0970.Powerful-Integers) | 39.8% | Easy | |
-| 0971 | Flip Binary Tree To Match Preorder Traversal | | 45.6% | Medium | |
-| 0972 | Equal Rational Numbers | | 41.6% | Hard | |
-| 0973 | K Closest Points to Origin | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0973.K-Closest-Points-to-Origin) | 63.8% | Medium | |
-| 0974 | Subarray Sums Divisible by K | | 48.9% | Medium | |
-| 0975 | Odd Even Jump | | 42.3% | Hard | |
-| 0976 | Largest Perimeter Triangle | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0976.Largest-Perimeter-Triangle) | 57.6% | Easy | |
-| 0977 | Squares of a Sorted Array | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0977.Squares-of-a-Sorted-Array) | 72.2% | Easy | |
-| 0978 | Longest Turbulent Subarray | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0978.Longest-Turbulent-Subarray) | 46.6% | Medium | |
-| 0979 | Distribute Coins in Binary Tree | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0979.Distribute-Coins-in-Binary-Tree) | 68.8% | Medium | |
-| 0980 | Unique Paths III | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0980.Unique-Paths-III) | 73.3% | Hard | |
-| 0981 | Time Based Key-Value Store | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0981.Time-Based-Key-Value-Store) | 53.1% | Medium | |
-| 0982 | Triples with Bitwise AND Equal To Zero | | 55.5% | Hard | |
-| 0983 | Minimum Cost For Tickets | | 60.5% | Medium | |
-| 0984 | String Without AAA or BBB | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0984.String-Without-AAA-or-BBB) | 37.7% | Medium | |
-| 0985 | Sum of Even Numbers After Queries | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0985.Sum-of-Even-Numbers-After-Queries) | 61.3% | Easy | |
-| 0986 | Interval List Intersections | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0986.Interval-List-Intersections) | 67.3% | Medium | |
-| 0987 | Vertical Order Traversal of a Binary Tree | | 36.6% | Medium | |
-| 0988 | Smallest String Starting From Leaf | | 46.0% | Medium | |
-| 0989 | Add to Array-Form of Integer | | 44.2% | Easy | |
-| 0990 | Satisfiability of Equality Equations | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0990.Satisfiability-of-Equality-Equations) | 44.9% | Medium | |
-| 0991 | Broken Calculator | | 45.5% | Medium | |
-| 0992 | Subarrays with K Different Integers | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0992.Subarrays-with-K-Different-Integers) | 48.6% | Hard | |
-| 0993 | Cousins in Binary Tree | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0993.Cousins-in-Binary-Tree) | 52.0% | Easy | |
-| 0994 | Rotting Oranges | | 47.8% | Medium | |
-| 0995 | Minimum Number of K Consecutive Bit Flips | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0995.Minimum-Number-of-K-Consecutive-Bit-Flips) | 46.8% | Hard | |
-| 0996 | Number of Squareful Arrays | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0996.Number-of-Squareful-Arrays) | 47.9% | Hard | |
-| 0997 | Find the Town Judge | | 50.1% | Easy | |
-| 0998 | Maximum Binary Tree II | | 62.9% | Medium | |
-| 0999 | Available Captures for Rook | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0999.Available-Captures-for-Rook) | 66.7% | Easy | |
-| 1000 | Minimum Cost to Merge Stones | | 39.6% | Hard | |
-| 1001 | Grid Illumination | | 35.9% | Hard | |
-| 1002 | Find Common Characters | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1002.Find-Common-Characters) | 67.7% | Easy | |
-| 1003 | Check If Word Is Valid After Substitutions | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1003.Check-If-Word-Is-Valid-After-Substitutions) | 55.3% | Medium | |
-| 1004 | Max Consecutive Ones III | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1004.Max-Consecutive-Ones-III) | 59.1% | Medium | |
-| 1005 | Maximize Sum Of Array After K Negations | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1005.Maximize-Sum-Of-Array-After-K-Negations) | 51.3% | Easy | |
-| 1006 | Clumsy Factorial | | 53.3% | Medium | |
-| 1007 | Minimum Domino Rotations For Equal Row | | 50.0% | Medium | |
-| 1008 | Construct Binary Search Tree from Preorder Traversal | | 78.4% | Medium | |
-| 1009 | Complement of Base 10 Integer | | 59.6% | Easy | |
-| 1010 | Pairs of Songs With Total Durations Divisible by 60 | | 47.4% | Easy | |
-| 1011 | Capacity To Ship Packages Within D Days | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1011.Capacity-To-Ship-Packages-Within-D-Days) | 58.1% | Medium | |
-| 1012 | Numbers With Repeated Digits | | 37.5% | Hard | |
-| 1013 | Partition Array Into Three Parts With Equal Sum | | 51.8% | Easy | |
-| 1014 | Best Sightseeing Pair | | 52.5% | Medium | |
-| 1015 | Smallest Integer Divisible by K | | 32.1% | Medium | |
-| 1016 | Binary String With Substrings Representing 1 To N | | 58.9% | Medium | |
-| 1017 | Convert to Base -2 | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1017.Convert-to-Base--2) | 59.0% | Medium | |
-| 1018 | Binary Prefix Divisible By 5 | | 47.7% | Easy | |
-| 1019 | Next Greater Node In Linked List | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1019.Next-Greater-Node-In-Linked-List) | 57.4% | Medium | |
-| 1020 | Number of Enclaves | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1020.Number-of-Enclaves) | 57.7% | Medium | |
-| 1021 | Remove Outermost Parentheses | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1021.Remove-Outermost-Parentheses) | 77.9% | Easy | |
-| 1022 | Sum of Root To Leaf Binary Numbers | | 67.2% | Easy | |
-| 1023 | Camelcase Matching | | 57.0% | Medium | |
-| 1024 | Video Stitching | | 49.2% | Medium | |
-| 1025 | Divisor Game | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1025.Divisor-Game) | 66.3% | Easy | |
-| 1026 | Maximum Difference Between Node and Ancestor | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1026.Maximum-Difference-Between-Node-and-Ancestor) | 65.9% | Medium | |
-| 1027 | Longest Arithmetic Sequence | | 53.5% | Medium | |
-| 1028 | Recover a Tree From Preorder Traversal | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1028.Recover-a-Tree-From-Preorder-Traversal) | 69.9% | Hard | |
-| 1029 | Two City Scheduling | | 56.1% | Easy | |
-| 1030 | Matrix Cells in Distance Order | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1030.Matrix-Cells-in-Distance-Order) | 65.7% | Easy | |
-| 1031 | Maximum Sum of Two Non-Overlapping Subarrays | | 57.8% | Medium | |
-| 1032 | Stream of Characters | | 48.3% | Hard | |
-| 1033 | Moving Stones Until Consecutive | | 41.7% | Easy | |
-| 1034 | Coloring A Border | | 44.7% | Medium | |
-| 1035 | Uncrossed Lines | | 56.1% | Medium | |
-| 1036 | Escape a Large Maze | | 35.4% | Hard | |
-| 1037 | Valid Boomerang | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1037.Valid-Boomerang) | 37.9% | Easy | |
-| 1038 | Binary Search Tree to Greater Sum Tree | | 80.8% | Medium | |
-| 1039 | Minimum Score Triangulation of Polygon | | 49.1% | Medium | |
-| 1040 | Moving Stones Until Consecutive II | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1040.Moving-Stones-Until-Consecutive-II) | 52.9% | Medium | |
-| 1041 | Robot Bounded In Circle | | 49.5% | Medium | |
-| 1042 | Flower Planting With No Adjacent | | 48.5% | Easy | |
-| 1043 | Partition Array for Maximum Sum | | 65.1% | Medium | |
-| 1044 | Longest Duplicate Substring | | 32.0% | Hard | |
-| 1045 | Customers Who Bought All Products | | 67.8% | Medium | |
-| 1046 | Last Stone Weight | | 62.2% | Easy | |
-| 1047 | Remove All Adjacent Duplicates In String | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1047.Remove-All-Adjacent-Duplicates-In-String) | 68.5% | Easy | |
-| 1048 | Longest String Chain | | 54.7% | Medium | |
-| 1049 | Last Stone Weight II | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1049.Last-Stone-Weight-II) | 44.1% | Medium | |
-| 1050 | Actors and Directors Who Cooperated At Least Three Times | | 71.7% | Easy | |
-| 1051 | Height Checker | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1051.Height-Checker) | 71.1% | Easy | |
-| 1052 | Grumpy Bookstore Owner | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1052.Grumpy-Bookstore-Owner) | 55.4% | Medium | |
-| 1053 | Previous Permutation With One Swap | | 48.5% | Medium | |
-| 1054 | Distant Barcodes | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1054.Distant-Barcodes) | 43.2% | Medium | |
-| 1055 | Shortest Way to Form String | | 56.9% | Medium | |
-| 1056 | Confusing Number | | 48.7% | Easy | |
-| 1057 | Campus Bikes | | 57.7% | Medium | |
-| 1058 | Minimize Rounding Error to Meet Target | | 41.7% | Medium | |
-| 1059 | All Paths from Source Lead to Destination | | 44.7% | Medium | |
-| 1060 | Missing Element in Sorted Array | | 54.5% | Medium | |
-| 1061 | Lexicographically Smallest Equivalent String | | 65.2% | Medium | |
-| 1062 | Longest Repeating Substring | | 57.2% | Medium | |
-| 1063 | Number of Valid Subarrays | | 71.1% | Hard | |
-| 1064 | Fixed Point | | 66.5% | Easy | |
-| 1065 | Index Pairs of a String | | 60.6% | Easy | |
-| 1066 | Campus Bikes II | | 54.2% | Medium | |
-| 1067 | Digit Count in Range | | 40.0% | Hard | |
-| 1068 | Product Sales Analysis I | | 83.1% | Easy | |
-| 1069 | Product Sales Analysis II | | 82.9% | Easy | |
-| 1070 | Product Sales Analysis III | | 48.9% | Medium | |
-| 1071 | Greatest Common Divisor of Strings | | 53.0% | Easy | |
-| 1072 | Flip Columns For Maximum Number of Equal Rows | | 60.8% | Medium | |
-| 1073 | Adding Two Negabinary Numbers | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1073.Adding-Two-Negabinary-Numbers) | 34.0% | Medium | |
-| 1074 | Number of Submatrices That Sum to Target | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1074.Number-of-Submatrices-That-Sum-to-Target) | 59.3% | Hard | |
-| 1075 | Project Employees I | | 64.9% | Easy | |
-| 1076 | Project Employees II | | 53.7% | Easy | |
-| 1077 | Project Employees III | | 75.4% | Medium | |
-| 1078 | Occurrences After Bigram | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1078.Occurrences-After-Bigram) | 64.7% | Easy | |
-| 1079 | Letter Tile Possibilities | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1079.Letter-Tile-Possibilities) | 75.4% | Medium | |
-| 1080 | Insufficient Nodes in Root to Leaf Paths | | 49.3% | Medium | |
-| 1081 | Smallest Subsequence of Distinct Characters | | 50.4% | Medium | |
-| 1082 | Sales Analysis I | | 71.7% | Easy | |
-| 1083 | Sales Analysis II | | 50.6% | Easy | |
-| 1084 | Sales Analysis III | | 54.2% | Easy | |
-| 1085 | Sum of Digits in the Minimum Number | | 74.6% | Easy | |
-| 1086 | High Five | | 79.6% | Easy | |
-| 1087 | Brace Expansion | | 62.7% | Medium | |
-| 1088 | Confusing Number II | | 43.9% | Hard | |
-| 1089 | Duplicate Zeros | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1089.Duplicate-Zeros) | 53.0% | Easy | |
-| 1090 | Largest Values From Labels | | 58.9% | Medium | |
-| 1091 | Shortest Path in Binary Matrix | | 38.2% | Medium | |
-| 1092 | Shortest Common Supersequence | | 51.6% | Hard | |
-| 1093 | Statistics from a Large Sample | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1093.Statistics-from-a-Large-Sample) | 48.2% | Medium | |
-| 1094 | Car Pooling | | 56.7% | Medium | |
-| 1095 | Find in Mountain Array | | 35.7% | Hard | |
-| 1096 | Brace Expansion II | | 62.1% | Hard | |
-| 1097 | Game Play Analysis V | | 54.4% | Hard | |
-| 1098 | Unpopular Books | | 44.4% | Medium | |
-| 1099 | Two Sum Less Than K | | 60.6% | Easy | |
-| 1100 | Find K-Length Substrings With No Repeated Characters | | 72.7% | Medium | |
-| 1101 | The Earliest Moment When Everyone Become Friends | | 66.2% | Medium | |
-| 1102 | Path With Maximum Minimum Value | | 49.2% | Medium | |
-| 1103 | Distribute Candies to People | | 60.5% | Easy | |
-| 1104 | Path In Zigzag Labelled Binary Tree | | 72.0% | Medium | |
-| 1105 | Filling Bookcase Shelves | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1105.Filling-Bookcase-Shelves) | 58.1% | Medium | |
-| 1106 | Parsing A Boolean Expression | | 58.5% | Hard | |
-| 1107 | New Users Daily Count | | 45.1% | Medium | |
-| 1108 | Defanging an IP Address | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1108.Defanging-an-IP-Address) | 87.5% | Easy | |
-| 1109 | Corporate Flight Bookings | | 52.8% | Medium | |
-| 1110 | Delete Nodes And Return Forest | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1110.Delete-Nodes-And-Return-Forest) | 67.0% | Medium | |
-| 1111 | Maximum Nesting Depth of Two Valid Parentheses Strings | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1111.Maximum-Nesting-Depth-of-Two-Valid-Parentheses-Strings) | 70.4% | Medium | |
-| 1112 | Highest Grade For Each Student | | 69.4% | Medium | |
-| 1113 | Reported Posts | | 64.1% | Easy | |
-| 1114 | Print in Order | | 65.7% | Easy | |
-| 1115 | Print FooBar Alternately | | 58.5% | Medium | |
-| 1116 | Print Zero Even Odd | | 56.0% | Medium | |
-| 1117 | Building H2O | | 52.6% | Medium | |
-| 1118 | Number of Days in a Month | | 57.4% | Easy | |
-| 1119 | Remove Vowels from a String | | 89.9% | Easy | |
-| 1120 | Maximum Average Subtree | | 62.0% | Medium | |
-| 1121 | Divide Array Into Increasing Sequences | | 56.8% | Hard | |
-| 1122 | Relative Sort Array | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1122.Relative-Sort-Array) | 67.7% | Easy | |
-| 1123 | Lowest Common Ancestor of Deepest Leaves | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1123.Lowest-Common-Ancestor-of-Deepest-Leaves) | 66.8% | Medium | |
-| 1124 | Longest Well-Performing Interval | | 32.7% | Medium | |
-| 1125 | Smallest Sufficient Team | | 46.5% | Hard | |
-| 1126 | Active Businesses | | 68.5% | Medium | |
-| 1127 | User Purchase Platform | | 48.9% | Hard | |
-| 1128 | Number of Equivalent Domino Pairs | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1128.Number-of-Equivalent-Domino-Pairs) | 47.3% | Easy | |
-| 1129 | Shortest Path with Alternating Colors | | 38.9% | Medium | |
-| 1130 | Minimum Cost Tree From Leaf Values | | 66.1% | Medium | |
-| 1131 | Maximum of Absolute Value Expression | | 53.1% | Medium | |
-| 1132 | Reported Posts II | | 34.4% | Medium | |
-| 1133 | Largest Unique Number | | 66.9% | Easy | |
-| 1134 | Armstrong Number | | 78.3% | Easy | |
-| 1135 | Connecting Cities With Minimum Cost | | 57.5% | Medium | |
-| 1136 | Parallel Courses | | 61.1% | Hard | |
-| 1137 | N-th Tribonacci Number | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1137.N-th-Tribonacci-Number) | 55.9% | Easy | |
-| 1138 | Alphabet Board Path | | 48.4% | Medium | |
-| 1139 | Largest 1-Bordered Square | | 47.5% | Medium | |
-| 1140 | Stone Game II | | 63.3% | Medium | |
-| 1141 | User Activity for the Past 30 Days I | | 54.1% | Easy | |
-| 1142 | User Activity for the Past 30 Days II | | 34.5% | Easy | |
-| 1143 | Longest Common Subsequence | | 58.4% | Medium | |
-| 1144 | Decrease Elements To Make Array Zigzag | | 45.4% | Medium | |
-| 1145 | Binary Tree Coloring Game | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1145.Binary-Tree-Coloring-Game) | 51.3% | Medium | |
-| 1146 | Snapshot Array | | 37.1% | Medium | |
-| 1147 | Longest Chunked Palindrome Decomposition | | 58.6% | Hard | |
-| 1148 | Article Views I | | 75.8% | Easy | |
-| 1149 | Article Views II | | 48.1% | Medium | |
-| 1150 | Check If a Number Is Majority Element in a Sorted Array | | 59.2% | Easy | |
-| 1151 | Minimum Swaps to Group All 1's Together | | 59.3% | Medium | |
-| 1152 | Analyze User Website Visit Pattern | | 43.5% | Medium | |
-| 1153 | String Transforms Into Another String | | 35.8% | Hard | |
-| 1154 | Day of the Year | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1154.Day-of-the-Year) | 49.3% | Easy | |
-| 1155 | Number of Dice Rolls With Target Sum | | 49.1% | Medium | |
-| 1156 | Swap For Longest Repeated Character Substring | | 48.9% | Medium | |
-| 1157 | Online Majority Element In Subarray | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1157.Online-Majority-Element-In-Subarray) | 38.9% | Hard | |
-| 1158 | Market Analysis I | | 61.7% | Medium | |
-| 1159 | Market Analysis II | | 52.9% | Hard | |
-| 1160 | Find Words That Can Be Formed by Characters | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1160.Find-Words-That-Can-Be-Formed-by-Characters) | 67.4% | Easy | |
-| 1161 | Maximum Level Sum of a Binary Tree | | 72.2% | Medium | |
-| 1162 | As Far from Land as Possible | | 43.4% | Medium | |
-| 1163 | Last Substring in Lexicographical Order | | 33.8% | Hard | |
-| 1164 | Product Price at a Given Date | | 65.8% | Medium | |
-| 1165 | Single-Row Keyboard | | 84.8% | Easy | |
-| 1166 | Design File System | | 56.8% | Medium | |
-| 1167 | Minimum Cost to Connect Sticks | | 62.7% | Medium | |
-| 1168 | Optimize Water Distribution in a Village | | 60.9% | Hard | |
-| 1169 | Invalid Transactions | | 31.2% | Medium | |
-| 1170 | Compare Strings by Frequency of the Smallest Character | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1170.Compare-Strings-by-Frequency-of-the-Smallest-Character) | 58.6% | Easy | |
-| 1171 | Remove Zero Sum Consecutive Nodes from Linked List | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1171.Remove-Zero-Sum-Consecutive-Nodes-from-Linked-List) | 41.4% | Medium | |
-| 1172 | Dinner Plate Stacks | | 38.2% | Hard | |
-| 1173 | Immediate Food Delivery I | | 80.4% | Easy | |
-| 1174 | Immediate Food Delivery II | | 58.4% | Medium | |
-| 1175 | Prime Arrangements | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1175.Prime-Arrangements) | 51.0% | Easy | |
-| 1176 | Diet Plan Performance | | 53.9% | Easy | |
-| 1177 | Can Make Palindrome from Substring | | 34.6% | Medium | |
-| 1178 | Number of Valid Words for Each Puzzle | | 37.9% | Hard | |
-| 1179 | Reformat Department Table | | 80.5% | Easy | |
-| 1180 | Count Substrings with Only One Distinct Letter | | 77.0% | Easy | |
-| 1181 | Before and After Puzzle | | 44.4% | Medium | |
-| 1182 | Shortest Distance to Target Color | | 52.8% | Medium | |
-| 1183 | Maximum Number of Ones | | 54.4% | Hard | |
-| 1184 | Distance Between Bus Stops | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1184.Distance-Between-Bus-Stops) | 54.4% | Easy | |
-| 1185 | Day of the Week | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1185.Day-of-the-Week) | 64.0% | Easy | |
-| 1186 | Maximum Subarray Sum with One Deletion | | 37.4% | Medium | |
-| 1187 | Make Array Strictly Increasing | | 41.8% | Hard | |
-| 1188 | Design Bounded Blocking Queue | | 70.5% | Medium | |
-| 1189 | Maximum Number of Balloons | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1189.Maximum-Number-of-Balloons) | 61.2% | Easy | |
-| 1190 | Reverse Substrings Between Each Pair of Parentheses | | 61.5% | Medium | |
-| 1191 | K-Concatenation Maximum Sum | | 25.9% | Medium | |
-| 1192 | Critical Connections in a Network | | 48.6% | Hard | |
-| 1193 | Monthly Transactions I | | 68.2% | Medium | |
-| 1194 | Tournament Winners | | 52.8% | Hard | |
-| 1195 | Fizz Buzz Multithreaded | | 68.3% | Medium | |
-| 1196 | How Many Apples Can You Put into the Basket | | 68.1% | Easy | |
-| 1197 | Minimum Knight Moves | | 36.1% | Medium | |
-| 1198 | Find Smallest Common Element in All Rows | | 74.9% | Medium | |
-| 1199 | Minimum Time to Build Blocks | | 37.3% | Hard | |
-| 1200 | Minimum Absolute Difference | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1200.Minimum-Absolute-Difference) | 66.6% | Easy | |
-| 1201 | Ugly Number III | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1201.Ugly-Number-III) | 25.9% | Medium | |
-| 1202 | Smallest String With Swaps | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1202.Smallest-String-With-Swaps) | 46.5% | Medium | |
-| 1203 | Sort Items by Groups Respecting Dependencies | | 47.6% | Hard | |
-| 1204 | Last Person to Fit in the Elevator | | 69.7% | Medium | |
-| 1205 | Monthly Transactions II | | 45.1% | Medium | |
-| 1206 | Design Skiplist | | 57.4% | Hard | |
-| 1207 | Unique Number of Occurrences | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1207.Unique-Number-of-Occurrences) | 71.6% | Easy | |
-| 1208 | Get Equal Substrings Within Budget | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1208.Get-Equal-Substrings-Within-Budget) | 41.9% | Medium | |
-| 1209 | Remove All Adjacent Duplicates in String II | | 56.8% | Medium | |
-| 1210 | Minimum Moves to Reach Target with Rotations | | 45.2% | Hard | |
-| 1211 | Queries Quality and Percentage | | 68.3% | Easy | |
-| 1212 | Team Scores in Football Tournament | | 55.7% | Medium | |
-| 1213 | Intersection of Three Sorted Arrays | | 78.9% | Easy | |
-| 1214 | Two Sum BSTs | | 67.6% | Medium | |
-| 1215 | Stepping Numbers | | 41.6% | Medium | |
-| 1216 | Valid Palindrome III | | 47.7% | Hard | |
-| 1217 | Play with Chips | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1217.Play-with-Chips) | 64.3% | Easy | |
-| 1218 | Longest Arithmetic Subsequence of Given Difference | | 44.5% | Medium | |
-| 1219 | Path with Maximum Gold | | 65.1% | Medium | |
-| 1220 | Count Vowels Permutation | | 53.9% | Hard | |
-| 1221 | Split a String in Balanced Strings | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1221.Split-a-String-in-Balanced-Strings) | 83.2% | Easy | |
-| 1222 | Queens That Can Attack the King | | 68.7% | Medium | |
-| 1223 | Dice Roll Simulation | | 45.6% | Medium | |
-| 1224 | Maximum Equal Frequency | | 33.5% | Hard | |
-| 1225 | Report Contiguous Dates | | 61.2% | Hard | |
-| 1226 | The Dining Philosophers | | 55.7% | Medium | |
-| 1227 | Airplane Seat Assignment Probability | | 61.0% | Medium | |
-| 1228 | Missing Number In Arithmetic Progression | | 52.6% | Easy | |
-| 1229 | Meeting Scheduler | | 52.6% | Medium | |
-| 1230 | Toss Strange Coins | | 48.7% | Medium | |
-| 1231 | Divide Chocolate | | 52.3% | Hard | |
-| 1232 | Check If It Is a Straight Line | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1232.Check-If-It-Is-a-Straight-Line) | 45.3% | Easy | |
-| 1233 | Remove Sub-Folders from the Filesystem | | 59.5% | Medium | |
-| 1234 | Replace the Substring for Balanced String | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1234.Replace-the-Substring-for-Balanced-String) | 33.3% | Medium | |
-| 1235 | Maximum Profit in Job Scheduling | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1235.Maximum-Profit-in-Job-Scheduling) | 44.1% | Hard | |
-| 1236 | Web Crawler | | 64.3% | Medium | |
-| 1237 | Find Positive Integer Solution for a Given Equation | | 69.6% | Easy | |
-| 1238 | Circular Permutation in Binary Representation | | 64.9% | Medium | |
-| 1239 | Maximum Length of a Concatenated String with Unique Characters | | 47.8% | Medium | |
-| 1240 | Tiling a Rectangle with the Fewest Squares | | 50.1% | Hard | |
-| 1241 | Number of Comments per Post | | 67.0% | Easy | |
-| 1242 | Web Crawler Multithreaded | | 45.9% | Medium | |
-| 1243 | Array Transformation | | 51.0% | Easy | |
-| 1244 | Design A Leaderboard | | 60.7% | Medium | |
-| 1245 | Tree Diameter | | 60.0% | Medium | |
-| 1246 | Palindrome Removal | | 46.0% | Hard | |
-| 1247 | Minimum Swaps to Make Strings Equal | | 60.0% | Medium | |
-| 1248 | Count Number of Nice Subarrays | | 56.4% | Medium | |
-| 1249 | Minimum Remove to Make Valid Parentheses | | 62.5% | Medium | |
-| 1250 | Check If It Is a Good Array | | 55.7% | Hard | |
-| 1251 | Average Selling Price | | 81.4% | Easy | |
-| 1252 | Cells with Odd Values in a Matrix | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1252.Cells-with-Odd-Values-in-a-Matrix) | 78.1% | Easy | |
-| 1253 | Reconstruct a 2-Row Binary Matrix | | 40.4% | Medium | |
-| 1254 | Number of Closed Islands | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1254.Number-of-Closed-Islands) | 60.3% | Medium | |
-| 1255 | Maximum Score Words Formed by Letters | | 69.3% | Hard | |
-| 1256 | Encode Number | | 66.0% | Medium | |
-| 1257 | Smallest Common Region | | 58.8% | Medium | |
-| 1258 | Synonymous Sentences | | 64.4% | Medium | |
-| 1259 | Handshakes That Don't Cross | | 53.5% | Hard | |
-| 1260 | Shift 2D Grid | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1260.Shift-2D-Grid) | 61.3% | Easy | |
-| 1261 | Find Elements in a Contaminated Binary Tree | | 74.3% | Medium | |
-| 1262 | Greatest Sum Divisible by Three | | 47.6% | Medium | |
-| 1263 | Minimum Moves to Move a Box to Their Target Location | | 41.4% | Hard | |
-| 1264 | Page Recommendations | | 67.5% | Medium | |
-| 1265 | Print Immutable Linked List in Reverse | | 94.6% | Medium | |
-| 1266 | Minimum Time Visiting All Points | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1266.Minimum-Time-Visiting-All-Points) | 79.6% | Easy | |
-| 1267 | Count Servers that Communicate | | 57.9% | Medium | |
-| 1268 | Search Suggestions System | | 63.3% | Medium | |
-| 1269 | Number of Ways to Stay in the Same Place After Some Steps | | 43.2% | Hard | |
-| 1270 | All People Report to the Given Manager | | 87.0% | Medium | |
-| 1271 | Hexspeak | | 54.2% | Easy | |
-| 1272 | Remove Interval | | 58.6% | Medium | |
-| 1273 | Delete Tree Nodes | | 63.5% | Medium | |
-| 1274 | Number of Ships in a Rectangle | | 66.5% | Hard | |
-| 1275 | Find Winner on a Tic Tac Toe Game | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1275.Find-Winner-on-a-Tic-Tac-Toe-Game) | 52.9% | Easy | |
-| 1276 | Number of Burgers with No Waste of Ingredients | | 49.6% | Medium | |
-| 1277 | Count Square Submatrices with All Ones | | 73.2% | Medium | |
-| 1278 | Palindrome Partitioning III | | 59.9% | Hard | |
-| 1279 | Traffic Light Controlled Intersection | | 74.3% | Easy | |
-| 1280 | Students and Examinations | | 72.1% | Easy | |
-| 1281 | Subtract the Product and Sum of Digits of an Integer | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1281.Subtract-the-Product-and-Sum-of-Digits-of-an-Integer) | 85.2% | Easy | |
-| 1282 | Group the People Given the Group Size They Belong To | | 83.9% | Medium | |
-| 1283 | Find the Smallest Divisor Given a Threshold | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1283.Find-the-Smallest-Divisor-Given-a-Threshold) | 47.6% | Medium | |
-| 1284 | Minimum Number of Flips to Convert Binary Matrix to Zero Matrix | | 69.5% | Hard | |
-| 1285 | Find the Start and End Number of Continuous Ranges | | 83.7% | Medium | |
-| 1286 | Iterator for Combination | | 68.1% | Medium | |
-| 1287 | Element Appearing More Than 25% In Sorted Array | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1287.Element-Appearing-More-Than-In-Sorted-Array) | 60.2% | Easy | |
-| 1288 | Remove Covered Intervals | | 58.0% | Medium | |
-| 1289 | Minimum Falling Path Sum II | | 61.0% | Hard | |
-| 1290 | Convert Binary Number in a Linked List to Integer | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1290.Convert-Binary-Number-in-a-Linked-List-to-Integer) | 80.2% | Easy | |
-| 1291 | Sequential Digits | | 53.4% | Medium | |
-| 1292 | Maximum Side Length of a Square with Sum Less than or Equal to Threshold | | 48.5% | Medium | |
-| 1293 | Shortest Path in a Grid with Obstacles Elimination | | 42.7% | Hard | |
-| 1294 | Weather Type in Each Country | | 63.1% | Easy | |
-| 1295 | Find Numbers with Even Number of Digits | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1295.Find-Numbers-with-Even-Number-of-Digits) | 81.6% | Easy | |
-| 1296 | Divide Array in Sets of K Consecutive Numbers | | 53.7% | Medium | |
-| 1297 | Maximum Number of Occurrences of a Substring | | 47.3% | Medium | |
-| 1298 | Maximum Candies You Can Get from Boxes | | 58.9% | Hard | |
-| 1299 | Replace Elements with Greatest Element on Right Side | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1299.Replace-Elements-with-Greatest-Element-on-Right-Side) | 75.4% | Easy | |
-| 1300 | Sum of Mutated Array Closest to Target | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1300.Sum-of-Mutated-Array-Closest-to-Target) | 44.2% | Medium | |
-| 1301 | Number of Paths with Max Score | | 37.2% | Hard | |
-| 1302 | Deepest Leaves Sum | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1302.Deepest-Leaves-Sum) | 83.6% | Medium | |
-| 1303 | Find the Team Size | | 87.8% | Easy | |
-| 1304 | Find N Unique Integers Sum up to Zero | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1304.Find-N-Unique-Integers-Sum-up-to-Zero) | 76.3% | Easy | |
-| 1305 | All Elements in Two Binary Search Trees | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1305.All-Elements-in-Two-Binary-Search-Trees) | 76.1% | Medium | |
-| 1306 | Jump Game III | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1306.Jump-Game-III) | 60.5% | Medium | |
-| 1307 | Verbal Arithmetic Puzzle | | 37.6% | Hard | |
-| 1308 | Running Total for Different Genders | | 84.0% | Medium | |
-| 1309 | Decrypt String from Alphabet to Integer Mapping | | 76.7% | Easy | |
-| 1310 | XOR Queries of a Subarray | | 68.6% | Medium | |
-| 1311 | Get Watched Videos by Your Friends | | 43.1% | Medium | |
-| 1312 | Minimum Insertion Steps to Make a String Palindrome | | 58.1% | Hard | |
-| 1313 | Decompress Run-Length Encoded List | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1313.Decompress-Run-Length-Encoded-List) | 85.1% | Easy | |
-| 1314 | Matrix Block Sum | | 73.7% | Medium | |
-| 1315 | Sum of Nodes with Even-Valued Grandparent | | 83.5% | Medium | |
-| 1316 | Distinct Echo Substrings | | 46.4% | Hard | |
-| 1317 | Convert Integer to the Sum of Two No-Zero Integers | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1317.Convert-Integer-to-the-Sum-of-Two-No-Zero-Integers) | 56.7% | Easy | |
-| 1318 | Minimum Flips to Make a OR b Equal to c | | 62.8% | Medium | |
-| 1319 | Number of Operations to Make Network Connected | | 53.1% | Medium | |
-| 1320 | Minimum Distance to Type a Word Using Two Fingers | | 62.3% | Hard | |
-| 1321 | Restaurant Growth | | 67.7% | Medium | |
-| 1322 | Ads Performance | | 57.8% | Easy | |
-| 1323 | Maximum 69 Number | | 77.9% | Easy | |
-| 1324 | Print Words Vertically | | 58.0% | Medium | |
-| 1325 | Delete Leaves With a Given Value | | 72.9% | Medium | |
-| 1326 | Minimum Number of Taps to Open to Water a Garden | | 43.5% | Hard | |
-| 1327 | List the Products Ordered in a Period | | 76.3% | Easy | |
-| 1328 | Break a Palindrome | | 43.3% | Medium | |
-| 1329 | Sort the Matrix Diagonally | | 78.4% | Medium | |
-| 1330 | Reverse Subarray To Maximize Array Value | | 35.1% | Hard | |
-| 1331 | Rank Transform of an Array | | 58.1% | Easy | |
-| 1332 | Remove Palindromic Subsequences | | 60.0% | Easy | |
-| 1333 | Filter Restaurants by Vegan-Friendly, Price and Distance | | 54.6% | Medium | |
-| 1334 | Find the City With the Smallest Number of Neighbors at a Threshold Distance | | 44.5% | Medium | |
-| 1335 | Minimum Difficulty of a Job Schedule | | 57.5% | Hard | |
-| 1336 | Number of Transactions per Visit | | 43.5% | Hard | |
-| 1337 | The K Weakest Rows in a Matrix | | 68.7% | Easy | |
-| 1338 | Reduce Array Size to The Half | | 66.6% | Medium | |
-| 1339 | Maximum Product of Splitted Binary Tree | | 37.2% | Medium | |
-| 1340 | Jump Game V | | 57.5% | Hard | |
-| 1341 | Movie Rating | | 56.6% | Medium | |
-| 1342 | Number of Steps to Reduce a Number to Zero | | 86.3% | Easy | |
-| 1343 | Number of Sub-arrays of Size K and Average Greater than or Equal to Threshold | | 64.2% | Medium | |
-| 1344 | Angle Between Hands of a Clock | | 61.4% | Medium | |
-| 1345 | Jump Game IV | | 38.1% | Hard | |
-| 1346 | Check If N and Its Double Exist | | 38.0% | Easy | |
-| 1347 | Minimum Number of Steps to Make Two Strings Anagram | | 74.6% | Medium | |
-| 1348 | Tweet Counts Per Frequency | | 29.0% | Medium | |
-| 1349 | Maximum Students Taking Exam | | 41.9% | Hard | |
-| 1350 | Students With Invalid Departments | | 89.4% | Easy | |
-| 1351 | Count Negative Numbers in a Sorted Matrix | | 76.6% | Easy | |
-| 1352 | Product of the Last K Numbers | | 43.6% | Medium | |
-| 1353 | Maximum Number of Events That Can Be Attended | | 30.5% | Medium | |
-| 1354 | Construct Target Array With Multiple Sums | | 31.9% | Hard | |
-| 1355 | Activity Participants | | 69.2% | Medium | |
-| 1356 | Sort Integers by The Number of 1 Bits | | 68.6% | Easy | |
-| 1357 | Apply Discount Every n Orders | | 66.0% | Medium | |
-| 1358 | Number of Substrings Containing All Three Characters | | 58.0% | Medium | |
-| 1359 | Count All Valid Pickup and Delivery Options | | 57.9% | Hard | |
-| 1360 | Number of Days Between Two Dates | | 48.8% | Easy | |
-| 1361 | Validate Binary Tree Nodes | | 48.6% | Medium | |
-| 1362 | Closest Divisors | | 56.7% | Medium | |
-| 1363 | Largest Multiple of Three | | 33.5% | Hard | |
-| 1364 | Number of Trusted Contacts of a Customer | | 75.3% | Medium | |
-| 1365 | How Many Numbers Are Smaller Than the Current Number | | 85.6% | Easy | |
-| 1366 | Rank Teams by Votes | | 52.4% | Medium | |
-| 1367 | Linked List in Binary Tree | | 39.7% | Medium | |
-| 1368 | Minimum Cost to Make at Least One Valid Path in a Grid | | 54.4% | Hard | |
-| 1369 | Get the Second Most Recent Activity | | 64.7% | Hard | |
-| 1370 | Increasing Decreasing String | | 75.6% | Easy | |
-| 1371 | Find the Longest Substring Containing Vowels in Even Counts | | 57.3% | Medium | |
-| 1372 | Longest ZigZag Path in a Binary Tree | | 54.0% | Medium | |
-| 1373 | Maximum Sum BST in Binary Tree | | 40.2% | Hard | |
-| 1374 | Generate a String With Characters That Have Odd Counts | | 75.4% | Easy | |
-| 1375 | Bulb Switcher III | | 62.5% | Medium | |
-| 1376 | Time Needed to Inform All Employees | | 55.5% | Medium | |
-| 1377 | Frog Position After T Seconds | | 33.6% | Hard | |
-| 1378 | Replace Employee ID With The Unique Identifier | | 87.4% | Easy | |
-| 1379 | Find a Corresponding Node of a Binary Tree in a Clone of That Tree | | 83.8% | Medium | |
-| 1380 | Lucky Numbers in a Matrix | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1380.Lucky-Numbers-in-a-Matrix) | 71.4% | Easy | |
-| 1381 | Design a Stack With Increment Operation | | 74.7% | Medium | |
-| 1382 | Balance a Binary Search Tree | | 74.8% | Medium | |
-| 1383 | Maximum Performance of a Team | | 31.8% | Hard | |
-| 1384 | Total Sales Amount by Year | | 62.8% | Hard | |
-| 1385 | Find the Distance Value Between Two Arrays | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1385.Find-the-Distance-Value-Between-Two-Arrays) | 67.1% | Easy | |
-| 1386 | Cinema Seat Allocation | | 34.8% | Medium | |
-| 1387 | Sort Integers by The Power Value | | 70.1% | Medium | |
-| 1388 | Pizza With 3n Slices | | 44.7% | Hard | |
-| 1389 | Create Target Array in the Given Order | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1389.Create-Target-Array-in-the-Given-Order) | 84.1% | Easy | |
-| 1390 | Four Divisors | | 38.1% | Medium | |
-| 1391 | Check if There is a Valid Path in a Grid | | 44.5% | Medium | |
-| 1392 | Longest Happy Prefix | | 40.0% | Hard | |
-| 1393 | Capital Gain/Loss | | 89.2% | Medium | |
-| 1394 | Find Lucky Integer in an Array | | 64.5% | Easy | |
-| 1395 | Count Number of Teams | | 81.9% | Medium | |
-| 1396 | Design Underground System | | 64.7% | Medium | |
-| 1397 | Find All Good Strings | | 37.2% | Hard | |
-| 1398 | Customers Who Bought Products A and B but Not C | | 80.6% | Medium | |
-| 1399 | Count Largest Group | | 65.0% | Easy | |
-| 1400 | Construct K Palindrome Strings | | 60.4% | Medium | |
-| 1401 | Circle and Rectangle Overlapping | | 41.8% | Medium | |
-| 1402 | Reducing Dishes | | 72.8% | Hard | |
-| 1403 | Minimum Subsequence in Non-Increasing Order | | 70.8% | Easy | |
-| 1404 | Number of Steps to Reduce a Number in Binary Representation to One | | 50.3% | Medium | |
-| 1405 | Longest Happy String | | 49.0% | Medium | |
-| 1406 | Stone Game III | | 56.0% | Hard | |
-| 1407 | Top Travellers | | 82.1% | Easy | |
-| 1408 | String Matching in an Array | | 61.4% | Easy | |
-| 1409 | Queries on a Permutation With Key | | 81.6% | Medium | |
-| 1410 | HTML Entity Parser | | 53.9% | Medium | |
-| 1411 | Number of Ways to Paint N × 3 Grid | | 61.2% | Hard | |
-| 1412 | Find the Quiet Students in All Exams | | 66.6% | Hard | |
-| 1413 | Minimum Value to Get Positive Step by Step Sum | | 65.2% | Easy | |
-| 1414 | Find the Minimum Number of Fibonacci Numbers Whose Sum Is K | | 62.4% | Medium | |
-| 1415 | The k-th Lexicographical String of All Happy Strings of Length n | | 70.4% | Medium | |
-| 1416 | Restore The Array | | 36.7% | Hard | |
-| 1417 | Reformat The String | | 55.0% | Easy | |
-| 1418 | Display Table of Food Orders in a Restaurant | | 65.6% | Medium | |
-| 1419 | Minimum Number of Frogs Croaking | | 46.3% | Medium | |
-| 1420 | Build Array Where You Can Find The Maximum Exactly K Comparisons | | 65.2% | Hard | |
-| 1421 | NPV Queries | | 80.5% | Medium | |
-| 1422 | Maximum Score After Splitting a String | | 54.7% | Easy | |
-| 1423 | Maximum Points You Can Obtain from Cards | | 42.5% | Medium | |
-| 1424 | Diagonal Traverse II | | 42.3% | Medium | |
-| 1425 | Constrained Subsequence Sum | | 44.1% | Hard | |
-| 1426 | Counting Elements | | 58.7% | Easy | |
-| 1427 | Perform String Shifts | | 53.0% | Easy | |
-| 1428 | Leftmost Column with at Least a One | | 46.8% | Medium | |
-| 1429 | First Unique Number | | 47.0% | Medium | |
-| 1430 | Check If a String Is a Valid Sequence from Root to Leaves Path in a Binary Tree | | 44.8% | Medium | |
-| 1431 | Kids With the Greatest Number of Candies | | 88.9% | Easy | |
-| 1432 | Max Difference You Can Get From Changing an Integer | | 42.8% | Medium | |
-| 1433 | Check If a String Can Break Another String | | 65.7% | Medium | |
-| 1434 | Number of Ways to Wear Different Hats to Each Other | | 38.0% | Hard | |
-| 1435 | Create a Session Bar Chart | | 76.7% | Easy | |
-| 1436 | Destination City | | 77.3% | Easy | |
-| 1437 | Check If All 1's Are at Least Length K Places Away | | 63.3% | Medium | |
-| 1438 | Longest Continuous Subarray With Absolute Diff Less Than or Equal to Limit | | 41.9% | Medium | |
-| 1439 | Find the Kth Smallest Sum of a Matrix With Sorted Rows | | 59.4% | Hard | |
-| 1440 | Evaluate Boolean Expression | | 70.1% | Medium | |
-| 1441 | Build an Array With Stack Operations | | 68.8% | Easy | |
-| 1442 | Count Triplets That Can Form Two Arrays of Equal XOR | | 69.4% | Medium | |
-| 1443 | Minimum Time to Collect All Apples in a Tree | | 55.5% | Medium | |
-| 1444 | Number of Ways of Cutting a Pizza | | 52.7% | Hard | |
-| 1445 | Apples & Oranges | | 87.2% | Medium | |
-| 1446 | Consecutive Characters | | 60.4% | Easy | |
-| 1447 | Simplified Fractions | | 61.0% | Medium | |
-| 1448 | Count Good Nodes in Binary Tree | | 70.6% | Medium | |
-| 1449 | Form Largest Integer With Digits That Add up to Target | | 41.8% | Hard | |
-| 1450 | Number of Students Doing Homework at a Given Time | | 78.1% | Easy | |
-| 1451 | Rearrange Words in a Sentence | | 54.8% | Medium | |
-| 1452 | People Whose List of Favorite Companies Is Not a Subset of Another List | | 53.3% | Medium | |
-| 1453 | Maximum Number of Darts Inside of a Circular Dartboard | | 33.7% | Hard | |
-| 1454 | Active Users | | 37.5% | Medium | |
-| 1455 | Check If a Word Occurs As a Prefix of Any Word in a Sentence | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1455.Check-If-a-Word-Occurs-As-a-Prefix-of-Any-Word-in-a-Sentence) | 64.7% | Easy | |
-| 1456 | Maximum Number of Vowels in a Substring of Given Length | | 52.4% | Medium | |
-| 1457 | Pseudo-Palindromic Paths in a Binary Tree | | 67.2% | Medium | |
-| 1458 | Max Dot Product of Two Subsequences | | 41.7% | Hard | |
-| 1459 | Rectangles Area | | 61.5% | Medium | |
-| 1460 | Make Two Arrays Equal by Reversing Sub-arrays | | 74.0% | Easy | |
-| 1461 | Check If a String Contains All Binary Codes of Size K | | 44.6% | Medium | |
-| 1462 | Course Schedule IV | | 41.7% | Medium | |
-| 1463 | Cherry Pickup II | | 65.5% | Hard | |
-| 1464 | Maximum Product of Two Elements in an Array | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1464.Maximum-Product-of-Two-Elements-in-an-Array) | 78.1% | Easy | |
-| 1465 | Maximum Area of a Piece of Cake After Horizontal and Vertical Cuts | | 30.8% | Medium | |
-| 1466 | Reorder Routes to Make All Paths Lead to the City Zero | | 63.6% | Medium | |
-| 1467 | Probability of a Two Boxes Having The Same Number of Distinct Balls | | 61.1% | Hard | |
-| 1468 | Calculate Salaries | | 78.0% | Medium | |
-| 1469 | Find All The Lonely Nodes | | 81.5% | Easy | |
-| 1470 | Shuffle the Array | [Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1470.Shuffle-the-Array) | 89.0% | Easy | |
-| 1471 | The k Strongest Values in an Array | | 57.0% | Medium | |
-| 1472 | Design Browser History | | 64.5% | Medium | |
-| 1473 | Paint House III | | 48.1% | Hard | |
-| 1474 | Delete N Nodes After M Nodes of a Linked List | | 74.2% | Easy | |
-| 1475 | Final Prices With a Special Discount in a Shop | | 75.7% | Easy | |
-| 1476 | Subrectangle Queries | | 90.5% | Medium | |
-| 1477 | Find Two Non-overlapping Sub-arrays Each With Target Sum | | 29.8% | Medium | |
-| 1478 | Allocate Mailboxes | | 55.0% | Hard | |
-| 1479 | Sales by Day of the Week | | 83.4% | Hard | |
-| 1480 | Running Sum of 1d Array | | 90.6% | Easy | |
-| 1481 | Least Number of Unique Integers after K Removals | | 53.7% | Medium | |
-| 1482 | Minimum Number of Days to Make m Bouquets | | 45.7% | Medium | |
-| 1483 | Kth Ancestor of a Tree Node | | 27.6% | Hard | |
-| 1484 | Group Sold Products By The Date | | 86.0% | Easy | |
-| 1485 | Clone Binary Tree With Random Pointer | | 81.4% | Medium | |
-| 1486 | XOR Operation in an Array | | 85.1% | Easy | |
-| 1487 | Making File Names Unique | | 29.2% | Medium | |
-| 1488 | Avoid Flood in The City | | 25.3% | Medium | |
-| 1489 | Find Critical and Pseudo-Critical Edges in Minimum Spanning Tree | | 50.5% | Hard | |
-| 1490 | Clone N-ary Tree | | 84.7% | Medium | |
-| 1491 | Average Salary Excluding the Minimum and Maximum Salary | | 70.2% | Easy | |
-| 1492 | The kth Factor of n | | 68.0% | Medium | |
-| 1493 | Longest Subarray of 1's After Deleting One Element | | 58.4% | Medium | |
-| 1494 | Parallel Courses II | | 32.2% | Hard | |
-| 1495 | Friendly Movies Streamed Last Month | | 52.9% | Easy | |
-| 1496 | Path Crossing | | 55.9% | Easy | |
-| 1497 | Check If Array Pairs Are Divisible by k | | 41.2% | Medium | |
-| 1498 | Number of Subsequences That Satisfy the Given Sum Condition | | 36.7% | Medium | |
-| 1499 | Max Value of Equation | | 44.6% | Hard | |
-| 1500 | Design a File Sharing System | | 46.4% | Medium | |
-| 1501 | Countries You Can Safely Invest In | | 63.8% | Medium | |
-| 1502 | Can Make Arithmetic Progression From Sequence | | 73.4% | Easy | |
-| 1503 | Last Moment Before All Ants Fall Out of a Plank | | 51.5% | Medium | |
-| 1504 | Count Submatrices With All Ones | | 61.6% | Medium | |
-| 1505 | Minimum Possible Integer After at Most K Adjacent Swaps On Digits | | 36.1% | Hard | |
-| 1506 | Find Root of N-Ary Tree | | 79.8% | Medium | |
-| 1507 | Reformat Date | | 60.5% | Easy | |
-| 1508 | Range Sum of Sorted Subarray Sums | | 68.6% | Medium | |
-| 1509 | Minimum Difference Between Largest and Smallest Value in Three Moves | | 50.9% | Medium | |
-| 1510 | Stone Game IV | | 50.2% | Hard | |
-| 1511 | Customer Order Frequency | | 77.0% | Easy | |
-| 1512 | Number of Good Pairs | | 88.7% | Easy | |
-| 1513 | Number of Substrings With Only 1s | | 40.4% | Medium | |
-| 1514 | Path with Maximum Probability | | 36.5% | Medium | |
-| 1515 | Best Position for a Service Centre | | 35.8% | Hard | |
-| 1516 | Move Sub-Tree of N-Ary Tree | | 60.2% | Hard | |
-| 1517 | Find Users With Valid E-Mails | | 71.2% | Easy | |
-| 1518 | Water Bottles | | 63.1% | Easy | |
-| 1519 | Number of Nodes in the Sub-Tree With the Same Label | | 35.1% | Medium | |
-| 1520 | Maximum Number of Non-Overlapping Substrings | | 32.7% | Hard | |
-| 1521 | Find a Value of a Mysterious Function Closest to Target | | 43.3% | Hard | |
-| 1522 | Diameter of N-Ary Tree | | 70.0% | Medium | |
-| 1523 | Count Odd Numbers in an Interval Range | | 55.7% | Easy | |
-| 1524 | Number of Sub-arrays With Odd Sum | | 36.3% | Medium | |
-| 1525 | Number of Good Ways to Split a String | | 70.0% | Medium | |
-| 1526 | Minimum Number of Increments on Subarrays to Form a Target Array | | 57.5% | Hard | |
-| 1527 | Patients With a Condition | | 88.4% | Easy | |
-| 1528 | Shuffle String | | 86.1% | Easy | |
-| 1529 | Bulb Switcher IV | | 70.4% | Medium | |
-| 1530 | Number of Good Leaf Nodes Pairs | | 53.4% | Medium | |
-| 1531 | String Compression II | | 28.6% | Hard | |
-| 1532 | The Most Recent Three Orders | | 75.1% | Medium | |
-| 1533 | Find the Index of the Large Integer | | 57.7% | Medium | |
-| 1534 | Count Good Triplets | | 79.4% | Easy | |
-| 1535 | Find the Winner of an Array Game | | 45.5% | Medium | |
-| 1536 | Minimum Swaps to Arrange a Binary Grid | | 41.5% | Medium | |
-| 1537 | Get the Maximum Score | | 35.7% | Hard | |
-| 1538 | Guess the Majority in a Hidden Array | | 56.9% | Medium | |
+|0001|Two Sum|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0001.Two-Sum)|49.1%|Easy||
+|0002|Add Two Numbers|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0002.Add-Two-Numbers)|39.7%|Medium||
+|0003|Longest Substring Without Repeating Characters|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0003.Longest-Substring-Without-Repeating-Characters)|33.8%|Medium||
+|0004|Median of Two Sorted Arrays|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0004.Median-of-Two-Sorted-Arrays)|35.1%|Hard||
+|0005|Longest Palindromic Substring|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0005.Longest-Palindromic-Substring)|32.4%|Medium||
+|0006|Zigzag Conversion|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0006.Zigzag-Conversion)|43.0%|Medium||
+|0007|Reverse Integer|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0007.Reverse-Integer)|27.2%|Medium||
+|0008|String to Integer (atoi)|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0008.String-to-Integer-atoi)|16.6%|Medium||
+|0009|Palindrome Number|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0009.Palindrome-Number)|52.8%|Easy||
+|0010|Regular Expression Matching||28.3%|Hard||
+|0011|Container With Most Water|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0011.Container-With-Most-Water)|54.3%|Medium||
+|0012|Integer to Roman|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0012.Integer-to-Roman)|60.5%|Medium||
+|0013|Roman to Integer|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0013.Roman-to-Integer)|58.2%|Easy||
+|0014|Longest Common Prefix|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0014.Longest-Common-Prefix)|40.7%|Easy||
+|0015|3Sum|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0015.3Sum)|32.2%|Medium||
+|0016|3Sum Closest|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0016.3Sum-Closest)|46.2%|Medium||
+|0017|Letter Combinations of a Phone Number|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0017.Letter-Combinations-of-a-Phone-Number)|55.5%|Medium||
+|0018|4Sum|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0018.4Sum)|36.5%|Medium||
+|0019|Remove Nth Node From End of List|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0019.Remove-Nth-Node-From-End-of-List)|39.9%|Medium||
+|0020|Valid Parentheses|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0020.Valid-Parentheses)|40.7%|Easy||
+|0021|Merge Two Sorted Lists|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0021.Merge-Two-Sorted-Lists)|61.8%|Easy||
+|0022|Generate Parentheses|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0022.Generate-Parentheses)|71.7%|Medium||
+|0023|Merge k Sorted Lists|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0023.Merge-k-Sorted-Lists)|48.3%|Hard||
+|0024|Swap Nodes in Pairs|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0024.Swap-Nodes-in-Pairs)|60.3%|Medium||
+|0025|Reverse Nodes in k-Group|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0025.Reverse-Nodes-in-k-Group)|53.4%|Hard||
+|0026|Remove Duplicates from Sorted Array|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0026.Remove-Duplicates-from-Sorted-Array)|50.3%|Easy||
+|0027|Remove Element|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0027.Remove-Element)|52.0%|Easy||
+|0028|Find the Index of the First Occurrence in a String|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0028.Find-the-Index-of-the-First-Occurrence-in-a-String)|37.4%|Medium||
+|0029|Divide Two Integers|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0029.Divide-Two-Integers)|17.4%|Medium||
+|0030|Substring with Concatenation of All Words|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0030.Substring-with-Concatenation-of-All-Words)|30.9%|Hard||
+|0031|Next Permutation|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0031.Next-Permutation)|37.1%|Medium||
+|0032|Longest Valid Parentheses|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0032.Longest-Valid-Parentheses)|32.7%|Hard||
+|0033|Search in Rotated Sorted Array|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0033.Search-in-Rotated-Sorted-Array)|38.6%|Medium||
+|0034|Find First and Last Position of Element in Sorted Array|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0034.Find-First-and-Last-Position-of-Element-in-Sorted-Array)|41.5%|Medium||
+|0035|Search Insert Position|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0035.Search-Insert-Position)|42.0%|Easy||
+|0036|Valid Sudoku|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0036.Valid-Sudoku)|56.7%|Medium||
+|0037|Sudoku Solver|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0037.Sudoku-Solver)|56.6%|Hard||
+|0038|Count and Say||51.1%|Medium||
+|0039|Combination Sum|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0039.Combination-Sum)|67.5%|Medium||
+|0040|Combination Sum II|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0040.Combination-Sum-II)|53.3%|Medium||
+|0041|First Missing Positive|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0041.First-Missing-Positive)|36.5%|Hard||
+|0042|Trapping Rain Water|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0042.Trapping-Rain-Water)|58.7%|Hard||
+|0043|Multiply Strings|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0043.Multiply-Strings)|38.7%|Medium||
+|0044|Wildcard Matching||26.8%|Hard||
+|0045|Jump Game II|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0045.Jump-Game-II)|38.5%|Medium||
+|0046|Permutations|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0046.Permutations)|74.6%|Medium||
+|0047|Permutations II|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0047.Permutations-II)|56.6%|Medium||
+|0048|Rotate Image|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0048.Rotate-Image)|69.8%|Medium||
+|0049|Group Anagrams|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0049.Group-Anagrams)|65.9%|Medium||
+|0050|Pow(x, n)|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0050.Powx-n)|32.8%|Medium||
+|0051|N-Queens|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0051.N-Queens)|62.8%|Hard||
+|0052|N-Queens II|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0052.N-Queens-II)|70.8%|Hard||
+|0053|Maximum Subarray|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0053.Maximum-Subarray)|50.0%|Medium||
+|0054|Spiral Matrix|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0054.Spiral-Matrix)|43.6%|Medium||
+|0055|Jump Game|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0055.Jump-Game)|38.4%|Medium||
+|0056|Merge Intervals|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0056.Merge-Intervals)|45.9%|Medium||
+|0057|Insert Interval|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0057.Insert-Interval)|37.9%|Medium||
+|0058|Length of Last Word|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0058.Length-of-Last-Word)|40.3%|Easy||
+|0059|Spiral Matrix II|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0059.Spiral-Matrix-II)|66.5%|Medium||
+|0060|Permutation Sequence|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0060.Permutation-Sequence)|43.7%|Hard||
+|0061|Rotate List|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0061.Rotate-List)|35.7%|Medium||
+|0062|Unique Paths|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0062.Unique-Paths)|62.2%|Medium||
+|0063|Unique Paths II|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0063.Unique-Paths-II)|39.1%|Medium||
+|0064|Minimum Path Sum|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0064.Minimum-Path-Sum)|60.6%|Medium||
+|0065|Valid Number|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0065.Valid-Number)|18.6%|Hard||
+|0066|Plus One|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0066.Plus-One)|43.3%|Easy||
+|0067|Add Binary|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0067.Add-Binary)|51.3%|Easy||
+|0068|Text Justification||36.6%|Hard||
+|0069|Sqrt(x)|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0069.Sqrtx)|37.0%|Easy||
+|0070|Climbing Stairs|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0070.Climbing-Stairs)|51.7%|Easy||
+|0071|Simplify Path|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0071.Simplify-Path)|39.2%|Medium||
+|0072|Edit Distance||52.6%|Hard||
+|0073|Set Matrix Zeroes|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0073.Set-Matrix-Zeroes)|49.9%|Medium||
+|0074|Search a 2D Matrix|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0074.Search-a-2D-Matrix)|46.7%|Medium||
+|0075|Sort Colors|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0075.Sort-Colors)|57.1%|Medium||
+|0076|Minimum Window Substring|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0076.Minimum-Window-Substring)|40.0%|Hard||
+|0077|Combinations|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0077.Combinations)|66.0%|Medium||
+|0078|Subsets|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0078.Subsets)|73.7%|Medium||
+|0079|Word Search|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0079.Word-Search)|39.8%|Medium||
+|0080|Remove Duplicates from Sorted Array II|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0080.Remove-Duplicates-from-Sorted-Array-II)|51.5%|Medium||
+|0081|Search in Rotated Sorted Array II|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0081.Search-in-Rotated-Sorted-Array-II)|35.7%|Medium||
+|0082|Remove Duplicates from Sorted List II|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0082.Remove-Duplicates-from-Sorted-List-II)|45.4%|Medium||
+|0083|Remove Duplicates from Sorted List|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0083.Remove-Duplicates-from-Sorted-List)|49.8%|Easy||
+|0084|Largest Rectangle in Histogram|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0084.Largest-Rectangle-in-Histogram)|42.1%|Hard||
+|0085|Maximal Rectangle||44.1%|Hard||
+|0086|Partition List|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0086.Partition-List)|51.3%|Medium||
+|0087|Scramble String||36.1%|Hard||
+|0088|Merge Sorted Array|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0088.Merge-Sorted-Array)|45.7%|Easy||
+|0089|Gray Code|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0089.Gray-Code)|56.4%|Medium||
+|0090|Subsets II|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0090.Subsets-II)|55.2%|Medium||
+|0091|Decode Ways|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0091.Decode-Ways)|32.2%|Medium||
+|0092|Reverse Linked List II|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0092.Reverse-Linked-List-II)|45.3%|Medium||
+|0093|Restore IP Addresses|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0093.Restore-IP-Addresses)|43.3%|Medium||
+|0094|Binary Tree Inorder Traversal|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0094.Binary-Tree-Inorder-Traversal)|72.9%|Easy||
+|0095|Unique Binary Search Trees II|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0095.Unique-Binary-Search-Trees-II)|51.4%|Medium||
+|0096|Unique Binary Search Trees|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0096.Unique-Binary-Search-Trees)|59.2%|Medium||
+|0097|Interleaving String|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0097.Interleaving-String)|37.1%|Medium||
+|0098|Validate Binary Search Tree|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0098.Validate-Binary-Search-Tree)|31.7%|Medium||
+|0099|Recover Binary Search Tree|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0099.Recover-Binary-Search-Tree)|50.2%|Medium||
+|0100|Same Tree|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0100.Same-Tree)|56.3%|Easy||
+|0101|Symmetric Tree|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0101.Symmetric-Tree)|52.8%|Easy||
+|0102|Binary Tree Level Order Traversal|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0102.Binary-Tree-Level-Order-Traversal)|63.2%|Medium||
+|0103|Binary Tree Zigzag Level Order Traversal|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0103.Binary-Tree-Zigzag-Level-Order-Traversal)|55.0%|Medium||
+|0104|Maximum Depth of Binary Tree|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0104.Maximum-Depth-of-Binary-Tree)|73.0%|Easy||
+|0105|Construct Binary Tree from Preorder and Inorder Traversal|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0105.Construct-Binary-Tree-from-Preorder-and-Inorder-Traversal)|60.6%|Medium||
+|0106|Construct Binary Tree from Inorder and Postorder Traversal|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0106.Construct-Binary-Tree-from-Inorder-and-Postorder-Traversal)|57.3%|Medium||
+|0107|Binary Tree Level Order Traversal II|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0107.Binary-Tree-Level-Order-Traversal-II)|60.2%|Medium||
+|0108|Convert Sorted Array to Binary Search Tree|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0108.Convert-Sorted-Array-to-Binary-Search-Tree)|68.9%|Easy||
+|0109|Convert Sorted List to Binary Search Tree|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0109.Convert-Sorted-List-to-Binary-Search-Tree)|57.2%|Medium||
+|0110|Balanced Binary Tree|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0110.Balanced-Binary-Tree)|48.1%|Easy||
+|0111|Minimum Depth of Binary Tree|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0111.Minimum-Depth-of-Binary-Tree)|43.5%|Easy||
+|0112|Path Sum|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0112.Path-Sum)|47.6%|Easy||
+|0113|Path Sum II|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0113.Path-Sum-II)|56.5%|Medium||
+|0114|Flatten Binary Tree to Linked List|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0114.Flatten-Binary-Tree-to-Linked-List)|61.0%|Medium||
+|0115|Distinct Subsequences|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0115.Distinct-Subsequences)|43.7%|Hard||
+|0116|Populating Next Right Pointers in Each Node|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0116.Populating-Next-Right-Pointers-in-Each-Node)|59.3%|Medium||
+|0117|Populating Next Right Pointers in Each Node II||49.6%|Medium||
+|0118|Pascal's Triangle|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0118.Pascals-Triangle)|68.9%|Easy||
+|0119|Pascal's Triangle II|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0119.Pascals-Triangle-II)|59.5%|Easy||
+|0120|Triangle|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0120.Triangle)|53.8%|Medium||
+|0121|Best Time to Buy and Sell Stock|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0121.Best-Time-to-Buy-and-Sell-Stock)|54.5%|Easy||
+|0122|Best Time to Buy and Sell Stock II|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0122.Best-Time-to-Buy-and-Sell-Stock-II)|63.2%|Medium||
+|0123|Best Time to Buy and Sell Stock III||44.8%|Hard||
+|0124|Binary Tree Maximum Path Sum|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0124.Binary-Tree-Maximum-Path-Sum)|38.4%|Hard||
+|0125|Valid Palindrome|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0125.Valid-Palindrome)|43.5%|Easy||
+|0126|Word Ladder II|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0126.Word-Ladder-II)|27.6%|Hard||
+|0127|Word Ladder|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0127.Word-Ladder)|36.6%|Hard||
+|0128|Longest Consecutive Sequence|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0128.Longest-Consecutive-Sequence)|49.0%|Medium||
+|0129|Sum Root to Leaf Numbers|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0129.Sum-Root-to-Leaf-Numbers)|58.6%|Medium||
+|0130|Surrounded Regions|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0130.Surrounded-Regions)|35.8%|Medium||
+|0131|Palindrome Partitioning|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0131.Palindrome-Partitioning)|62.3%|Medium||
+|0132|Palindrome Partitioning II||33.6%|Hard||
+|0133|Clone Graph||50.5%|Medium||
+|0134|Gas Station||45.0%|Medium||
+|0135|Candy|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0135.Candy)|40.7%|Hard||
+|0136|Single Number|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0136.Single-Number)|70.0%|Easy||
+|0137|Single Number II|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0137.Single-Number-II)|57.7%|Medium||
+|0138|Copy List with Random Pointer|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0138.Copy-List-with-Random-Pointer)|50.4%|Medium||
+|0139|Word Break||45.4%|Medium||
+|0140|Word Break II||44.3%|Hard||
+|0141|Linked List Cycle|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0141.Linked-List-Cycle)|46.8%|Easy||
+|0142|Linked List Cycle II|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0142.Linked-List-Cycle-II)|46.2%|Medium||
+|0143|Reorder List|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0143.Reorder-List)|50.9%|Medium||
+|0144|Binary Tree Preorder Traversal|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0144.Binary-Tree-Preorder-Traversal)|64.5%|Easy||
+|0145|Binary Tree Postorder Traversal|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0145.Binary-Tree-Postorder-Traversal)|66.5%|Easy||
+|0146|LRU Cache|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0146.LRU-Cache)|40.5%|Medium||
+|0147|Insertion Sort List|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0147.Insertion-Sort-List)|50.1%|Medium||
+|0148|Sort List|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0148.Sort-List)|54.0%|Medium||
+|0149|Max Points on a Line||21.7%|Hard||
+|0150|Evaluate Reverse Polish Notation|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0150.Evaluate-Reverse-Polish-Notation)|44.1%|Medium||
+|0151|Reverse Words in a String|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0151.Reverse-Words-in-a-String)|30.2%|Medium||
+|0152|Maximum Product Subarray|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0152.Maximum-Product-Subarray)|34.9%|Medium||
+|0153|Find Minimum in Rotated Sorted Array|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0153.Find-Minimum-in-Rotated-Sorted-Array)|48.4%|Medium||
+|0154|Find Minimum in Rotated Sorted Array II|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0154.Find-Minimum-in-Rotated-Sorted-Array-II)|43.4%|Hard||
+|0155|Min Stack|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0155.Min-Stack)|51.7%|Medium||
+|0156|Binary Tree Upside Down||61.5%|Medium||
+|0157|Read N Characters Given Read4||40.7%|Easy||
+|0158|Read N Characters Given read4 II - Call Multiple Times||41.4%|Hard||
+|0159|Longest Substring with At Most Two Distinct Characters||53.5%|Medium||
+|0160|Intersection of Two Linked Lists|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0160.Intersection-of-Two-Linked-Lists)|53.1%|Easy||
+|0161|One Edit Distance||34.1%|Medium||
+|0162|Find Peak Element|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0162.Find-Peak-Element)|46.2%|Medium||
+|0163|Missing Ranges||31.9%|Easy||
+|0164|Maximum Gap|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0164.Maximum-Gap)|42.6%|Hard||
+|0165|Compare Version Numbers||35.3%|Medium||
+|0166|Fraction to Recurring Decimal||24.0%|Medium||
+|0167|Two Sum II - Input Array Is Sorted|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0167.Two-Sum-II-Input-Array-Is-Sorted)|60.0%|Medium||
+|0168|Excel Sheet Column Title|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0168.Excel-Sheet-Column-Title)|34.7%|Easy||
+|0169|Majority Element|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0169.Majority-Element)|63.8%|Easy||
+|0170|Two Sum III - Data structure design||37.3%|Easy||
+|0171|Excel Sheet Column Number|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0171.Excel-Sheet-Column-Number)|61.3%|Easy||
+|0172|Factorial Trailing Zeroes|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0172.Factorial-Trailing-Zeroes)|41.6%|Medium||
+|0173|Binary Search Tree Iterator|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0173.Binary-Search-Tree-Iterator)|69.0%|Medium||
+|0174|Dungeon Game|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0174.Dungeon-Game)|37.2%|Hard||
+|0175|Combine Two Tables||72.8%|Easy||
+|0176|Second Highest Salary||36.4%|Medium||
+|0177|Nth Highest Salary||37.3%|Medium||
+|0178|Rank Scores||59.7%|Medium||
+|0179|Largest Number|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0179.Largest-Number)|33.9%|Medium||
+|0180|Consecutive Numbers||46.7%|Medium||
+|0181|Employees Earning More Than Their Managers||68.4%|Easy||
+|0182|Duplicate Emails||70.5%|Easy||
+|0183|Customers Who Never Order||67.6%|Easy||
+|0184|Department Highest Salary||49.5%|Medium||
+|0185|Department Top Three Salaries||49.9%|Hard||
+|0186|Reverse Words in a String II||52.3%|Medium||
+|0187|Repeated DNA Sequences|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0187.Repeated-DNA-Sequences)|46.1%|Medium||
+|0188|Best Time to Buy and Sell Stock IV||37.8%|Hard||
+|0189|Rotate Array|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0189.Rotate-Array)|39.2%|Medium||
+|0190|Reverse Bits|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0190.Reverse-Bits)|51.9%|Easy||
+|0191|Number of 1 Bits|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0191.Number-of-1-Bits)|64.5%|Easy||
+|0192|Word Frequency||25.6%|Medium||
+|0193|Valid Phone Numbers||26.0%|Easy||
+|0194|Transpose File||25.3%|Medium||
+|0195|Tenth Line||32.9%|Easy||
+|0196|Delete Duplicate Emails||58.3%|Easy||
+|0197|Rising Temperature||44.4%|Easy||
+|0198|House Robber|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0198.House-Robber)|48.6%|Medium||
+|0199|Binary Tree Right Side View|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0199.Binary-Tree-Right-Side-View)|61.1%|Medium||
+|0200|Number of Islands|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0200.Number-of-Islands)|56.1%|Medium||
+|0201|Bitwise AND of Numbers Range|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0201.Bitwise-AND-of-Numbers-Range)|42.2%|Medium||
+|0202|Happy Number|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0202.Happy-Number)|54.3%|Easy||
+|0203|Remove Linked List Elements|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0203.Remove-Linked-List-Elements)|44.7%|Easy||
+|0204|Count Primes|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0204.Count-Primes)|33.1%|Medium||
+|0205|Isomorphic Strings|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0205.Isomorphic-Strings)|42.5%|Easy||
+|0206|Reverse Linked List|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0206.Reverse-Linked-List)|72.3%|Easy||
+|0207|Course Schedule|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0207.Course-Schedule)|45.3%|Medium||
+|0208|Implement Trie (Prefix Tree)|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0208.Implement-Trie-Prefix-Tree)|60.7%|Medium||
+|0209|Minimum Size Subarray Sum|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0209.Minimum-Size-Subarray-Sum)|44.4%|Medium||
+|0210|Course Schedule II|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0210.Course-Schedule-II)|47.9%|Medium||
+|0211|Design Add and Search Words Data Structure|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0211.Design-Add-and-Search-Words-Data-Structure)|43.2%|Medium||
+|0212|Word Search II|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0212.Word-Search-II)|37.0%|Hard||
+|0213|House Robber II|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0213.House-Robber-II)|40.6%|Medium||
+|0214|Shortest Palindrome||32.2%|Hard||
+|0215|Kth Largest Element in an Array|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0215.Kth-Largest-Element-in-an-Array)|65.7%|Medium||
+|0216|Combination Sum III|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0216.Combination-Sum-III)|67.0%|Medium||
+|0217|Contains Duplicate|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0217.Contains-Duplicate)|61.2%|Easy||
+|0218|The Skyline Problem|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0218.The-Skyline-Problem)|41.5%|Hard||
+|0219|Contains Duplicate II|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0219.Contains-Duplicate-II)|40.9%|Easy||
+|0220|Contains Duplicate III|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0220.Contains-Duplicate-III)|21.8%|Hard||
+|0221|Maximal Square||44.4%|Medium||
+|0222|Count Complete Tree Nodes|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0222.Count-Complete-Tree-Nodes)|57.4%|Medium||
+|0223|Rectangle Area|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0223.Rectangle-Area)|40.8%|Medium||
+|0224|Basic Calculator|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0224.Basic-Calculator)|41.1%|Hard||
+|0225|Implement Stack using Queues|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0225.Implement-Stack-using-Queues)|57.4%|Easy||
+|0226|Invert Binary Tree|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0226.Invert-Binary-Tree)|73.1%|Easy||
+|0227|Basic Calculator II|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0227.Basic-Calculator-II)|42.2%|Medium||
+|0228|Summary Ranges|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0228.Summary-Ranges)|46.8%|Easy||
+|0229|Majority Element II|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0229.Majority-Element-II)|44.0%|Medium||
+|0230|Kth Smallest Element in a BST|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0230.Kth-Smallest-Element-in-a-BST)|69.2%|Medium||
+|0231|Power of Two|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0231.Power-of-Two)|45.6%|Easy||
+|0232|Implement Queue using Stacks|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0232.Implement-Queue-using-Stacks)|61.0%|Easy||
+|0233|Number of Digit One||34.2%|Hard||
+|0234|Palindrome Linked List|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0234.Palindrome-Linked-List)|49.4%|Easy||
+|0235|Lowest Common Ancestor of a Binary Search Tree|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0235.Lowest-Common-Ancestor-of-a-Binary-Search-Tree)|60.1%|Medium||
+|0236|Lowest Common Ancestor of a Binary Tree|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0236.Lowest-Common-Ancestor-of-a-Binary-Tree)|57.9%|Medium||
+|0237|Delete Node in a Linked List|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0237.Delete-Node-in-a-Linked-List)|75.1%|Medium||
+|0238|Product of Array Except Self||64.7%|Medium||
+|0239|Sliding Window Maximum|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0239.Sliding-Window-Maximum)|46.6%|Hard||
+|0240|Search a 2D Matrix II|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0240.Search-a-2D-Matrix-II)|50.5%|Medium||
+|0241|Different Ways to Add Parentheses||63.1%|Medium||
+|0242|Valid Anagram|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0242.Valid-Anagram)|62.7%|Easy||
+|0243|Shortest Word Distance||64.9%|Easy||
+|0244|Shortest Word Distance II||60.7%|Medium||
+|0245|Shortest Word Distance III||57.5%|Medium||
+|0246|Strobogrammatic Number||47.6%|Easy||
+|0247|Strobogrammatic Number II||51.4%|Medium||
+|0248|Strobogrammatic Number III||41.7%|Hard||
+|0249|Group Shifted Strings||64.2%|Medium||
+|0250|Count Univalue Subtrees||55.2%|Medium||
+|0251|Flatten 2D Vector||48.9%|Medium||
+|0252|Meeting Rooms||57.0%|Easy||
+|0253|Meeting Rooms II||50.4%|Medium||
+|0254|Factor Combinations||48.8%|Medium||
+|0255|Verify Preorder Sequence in Binary Search Tree||48.0%|Medium||
+|0256|Paint House||60.5%|Medium||
+|0257|Binary Tree Paths|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0257.Binary-Tree-Paths)|60.5%|Easy||
+|0258|Add Digits|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0258.Add-Digits)|63.3%|Easy||
+|0259|3Sum Smaller||50.7%|Medium||
+|0260|Single Number III|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0260.Single-Number-III)|67.4%|Medium||
+|0261|Graph Valid Tree||46.8%|Medium||
+|0262|Trips and Users||38.4%|Hard||
+|0263|Ugly Number|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0263.Ugly-Number)|41.7%|Easy||
+|0264|Ugly Number II|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0264.Ugly-Number-II)|46.1%|Medium||
+|0265|Paint House II||52.2%|Hard||
+|0266|Palindrome Permutation||65.8%|Easy||
+|0267|Palindrome Permutation II||40.4%|Medium||
+|0268|Missing Number|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0268.Missing-Number)|61.5%|Easy||
+|0269|Alien Dictionary||35.2%|Hard||
+|0270|Closest Binary Search Tree Value||54.5%|Easy||
+|0271|Encode and Decode Strings||41.3%|Medium||
+|0272|Closest Binary Search Tree Value II||58.2%|Hard||
+|0273|Integer to English Words||29.9%|Hard||
+|0274|H-Index|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0274.H-Index)|38.1%|Medium||
+|0275|H-Index II|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0275.H-Index-II)|37.4%|Medium||
+|0276|Paint Fence||44.0%|Medium||
+|0277|Find the Celebrity||46.7%|Medium||
+|0278|First Bad Version|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0278.First-Bad-Version)|42.9%|Easy||
+|0279|Perfect Squares|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0279.Perfect-Squares)|52.2%|Medium||
+|0280|Wiggle Sort||66.3%|Medium||
+|0281|Zigzag Iterator||62.3%|Medium||
+|0282|Expression Add Operators||39.2%|Hard||
+|0283|Move Zeroes|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0283.Move-Zeroes)|61.3%|Easy||
+|0284|Peeking Iterator|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0284.Peeking-Iterator)|58.2%|Medium||
+|0285|Inorder Successor in BST||48.3%|Medium||
+|0286|Walls and Gates||60.2%|Medium||
+|0287|Find the Duplicate Number|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0287.Find-the-Duplicate-Number)|59.1%|Medium||
+|0288|Unique Word Abbreviation||25.2%|Medium||
+|0289|Game of Life||66.6%|Medium||
+|0290|Word Pattern|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0290.Word-Pattern)|40.4%|Easy||
+|0291|Word Pattern II||46.9%|Medium||
+|0292|Nim Game||55.8%|Easy||
+|0293|Flip Game||63.0%|Easy||
+|0294|Flip Game II||51.7%|Medium||
+|0295|Find Median from Data Stream||51.1%|Hard||
+|0296|Best Meeting Point||59.6%|Hard||
+|0297|Serialize and Deserialize Binary Tree|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0297.Serialize-and-Deserialize-Binary-Tree)|54.9%|Hard||
+|0298|Binary Tree Longest Consecutive Sequence||52.5%|Medium||
+|0299|Bulls and Cows|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0299.Bulls-and-Cows)|48.5%|Medium||
+|0300|Longest Increasing Subsequence|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0300.Longest-Increasing-Subsequence)|51.5%|Medium||
+|0301|Remove Invalid Parentheses|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0301.Remove-Invalid-Parentheses)|47.1%|Hard||
+|0302|Smallest Rectangle Enclosing Black Pixels||58.2%|Hard||
+|0303|Range Sum Query - Immutable|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0303.Range-Sum-Query-Immutable)|57.9%|Easy||
+|0304|Range Sum Query 2D - Immutable|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0304.Range-Sum-Query-2D-Immutable)|52.1%|Medium||
+|0305|Number of Islands II||39.5%|Hard||
+|0306|Additive Number|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0306.Additive-Number)|30.9%|Medium||
+|0307|Range Sum Query - Mutable|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0307.Range-Sum-Query-Mutable)|40.7%|Medium||
+|0308|Range Sum Query 2D - Mutable||42.2%|Hard||
+|0309|Best Time to Buy and Sell Stock with Cooldown|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0309.Best-Time-to-Buy-and-Sell-Stock-with-Cooldown)|54.4%|Medium||
+|0310|Minimum Height Trees||38.5%|Medium||
+|0311|Sparse Matrix Multiplication||67.1%|Medium||
+|0312|Burst Balloons||56.9%|Hard||
+|0313|Super Ugly Number||45.8%|Medium||
+|0314|Binary Tree Vertical Order Traversal||52.0%|Medium||
+|0315|Count of Smaller Numbers After Self|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0315.Count-of-Smaller-Numbers-After-Self)|42.8%|Hard||
+|0316|Remove Duplicate Letters||44.5%|Medium||
+|0317|Shortest Distance from All Buildings||43.0%|Hard||
+|0318|Maximum Product of Word Lengths|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0318.Maximum-Product-of-Word-Lengths)|60.1%|Medium||
+|0319|Bulb Switcher|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0319.Bulb-Switcher)|48.0%|Medium||
+|0320|Generalized Abbreviation||57.3%|Medium||
+|0321|Create Maximum Number||28.8%|Hard||
+|0322|Coin Change|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0322.Coin-Change)|41.5%|Medium||
+|0323|Number of Connected Components in an Undirected Graph||62.0%|Medium||
+|0324|Wiggle Sort II|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0324.Wiggle-Sort-II)|32.9%|Medium||
+|0325|Maximum Size Subarray Sum Equals k||49.3%|Medium||
+|0326|Power of Three|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0326.Power-of-Three)|45.2%|Easy||
+|0327|Count of Range Sum|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0327.Count-of-Range-Sum)|36.0%|Hard||
+|0328|Odd Even Linked List|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0328.Odd-Even-Linked-List)|60.2%|Medium||
+|0329|Longest Increasing Path in a Matrix|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0329.Longest-Increasing-Path-in-a-Matrix)|52.1%|Hard||
+|0330|Patching Array||40.0%|Hard||
+|0331|Verify Preorder Serialization of a Binary Tree|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0331.Verify-Preorder-Serialization-of-a-Binary-Tree)|44.2%|Medium||
+|0332|Reconstruct Itinerary||40.9%|Hard||
+|0333|Largest BST Subtree||42.3%|Medium||
+|0334|Increasing Triplet Subsequence||42.7%|Medium||
+|0335|Self Crossing||29.3%|Hard||
+|0336|Palindrome Pairs||35.2%|Hard||
+|0337|House Robber III|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0337.House-Robber-III)|53.8%|Medium||
+|0338|Counting Bits|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0338.Counting-Bits)|75.2%|Easy||
+|0339|Nested List Weight Sum||82.0%|Medium||
+|0340|Longest Substring with At Most K Distinct Characters||47.8%|Medium||
+|0341|Flatten Nested List Iterator|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0341.Flatten-Nested-List-Iterator)|61.5%|Medium||
+|0342|Power of Four|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0342.Power-of-Four)|45.6%|Easy||
+|0343|Integer Break|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0343.Integer-Break)|55.3%|Medium||
+|0344|Reverse String|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0344.Reverse-String)|76.1%|Easy||
+|0345|Reverse Vowels of a String|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0345.Reverse-Vowels-of-a-String)|47.7%|Easy||
+|0346|Moving Average from Data Stream||77.0%|Easy||
+|0347|Top K Frequent Elements|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0347.Top-K-Frequent-Elements)|64.8%|Medium||
+|0348|Design Tic-Tac-Toe||57.6%|Medium||
+|0349|Intersection of Two Arrays|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0349.Intersection-of-Two-Arrays)|70.2%|Easy||
+|0350|Intersection of Two Arrays II|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0350.Intersection-of-Two-Arrays-II)|55.5%|Easy||
+|0351|Android Unlock Patterns||51.3%|Medium||
+|0352|Data Stream as Disjoint Intervals|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0352.Data-Stream-as-Disjoint-Intervals)|51.5%|Hard||
+|0353|Design Snake Game||39.0%|Medium||
+|0354|Russian Doll Envelopes|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0354.Russian-Doll-Envelopes)|38.3%|Hard||
+|0355|Design Twitter||36.5%|Medium||
+|0356|Line Reflection||34.6%|Medium||
+|0357|Count Numbers with Unique Digits|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0357.Count-Numbers-with-Unique-Digits)|51.5%|Medium||
+|0358|Rearrange String k Distance Apart||37.5%|Hard||
+|0359|Logger Rate Limiter||75.5%|Easy||
+|0360|Sort Transformed Array||54.6%|Medium||
+|0361|Bomb Enemy||50.9%|Medium||
+|0362|Design Hit Counter||68.3%|Medium||
+|0363|Max Sum of Rectangle No Larger Than K||44.1%|Hard||
+|0364|Nested List Weight Sum II||67.3%|Medium||
+|0365|Water and Jug Problem||36.5%|Medium||
+|0366|Find Leaves of Binary Tree||80.1%|Medium||
+|0367|Valid Perfect Square|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0367.Valid-Perfect-Square)|43.3%|Easy||
+|0368|Largest Divisible Subset|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0368.Largest-Divisible-Subset)|41.2%|Medium||
+|0369|Plus One Linked List||60.9%|Medium||
+|0370|Range Addition||70.8%|Medium||
+|0371|Sum of Two Integers|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0371.Sum-of-Two-Integers)|50.7%|Medium||
+|0372|Super Pow|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0372.Super-Pow)|37.2%|Medium||
+|0373|Find K Pairs with Smallest Sums|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0373.Find-K-Pairs-with-Smallest-Sums)|38.4%|Medium||
+|0374|Guess Number Higher or Lower|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0374.Guess-Number-Higher-or-Lower)|50.4%|Easy||
+|0375|Guess Number Higher or Lower II||46.3%|Medium||
+|0376|Wiggle Subsequence|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0376.Wiggle-Subsequence)|48.2%|Medium||
+|0377|Combination Sum IV|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0377.Combination-Sum-IV)|52.1%|Medium||
+|0378|Kth Smallest Element in a Sorted Matrix|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0378.Kth-Smallest-Element-in-a-Sorted-Matrix)|61.6%|Medium||
+|0379|Design Phone Directory||50.9%|Medium||
+|0380|Insert Delete GetRandom O(1)||52.0%|Medium||
+|0381|Insert Delete GetRandom O(1) - Duplicates allowed||35.7%|Hard||
+|0382|Linked List Random Node|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0382.Linked-List-Random-Node)|59.5%|Medium||
+|0383|Ransom Note|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0383.Ransom-Note)|57.6%|Easy||
+|0384|Shuffle an Array|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0384.Shuffle-an-Array)|57.6%|Medium||
+|0385|Mini Parser|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0385.Mini-Parser)|36.5%|Medium||
+|0386|Lexicographical Numbers|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0386.Lexicographical-Numbers)|60.5%|Medium||
+|0387|First Unique Character in a String|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0387.First-Unique-Character-in-a-String)|58.8%|Easy||
+|0388|Longest Absolute File Path||46.5%|Medium||
+|0389|Find the Difference|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0389.Find-the-Difference)|60.4%|Easy||
+|0390|Elimination Game|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0390.Elimination-Game)|46.6%|Medium||
+|0391|Perfect Rectangle|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0391.Perfect-Rectangle)|32.5%|Hard||
+|0392|Is Subsequence|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0392.Is-Subsequence)|49.3%|Easy||
+|0393|UTF-8 Validation|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0393.UTF-8-Validation)|45.2%|Medium||
+|0394|Decode String|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0394.Decode-String)|57.5%|Medium||
+|0395|Longest Substring with At Least K Repeating Characters|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0395.Longest-Substring-with-At-Least-K-Repeating-Characters)|44.8%|Medium||
+|0396|Rotate Function|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0396.Rotate-Function)|40.3%|Medium||
+|0397|Integer Replacement|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0397.Integer-Replacement)|35.1%|Medium||
+|0398|Random Pick Index||62.9%|Medium||
+|0399|Evaluate Division|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0399.Evaluate-Division)|59.5%|Medium||
+|0400|Nth Digit|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0400.Nth-Digit)|34.0%|Medium||
+|0401|Binary Watch|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0401.Binary-Watch)|51.4%|Easy||
+|0402|Remove K Digits|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0402.Remove-K-Digits)|30.5%|Medium||
+|0403|Frog Jump||43.1%|Hard||
+|0404|Sum of Left Leaves|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0404.Sum-of-Left-Leaves)|56.2%|Easy||
+|0405|Convert a Number to Hexadecimal|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0405.Convert-a-Number-to-Hexadecimal)|46.1%|Easy||
+|0406|Queue Reconstruction by Height||72.8%|Medium||
+|0407|Trapping Rain Water II||47.4%|Hard||
+|0408|Valid Word Abbreviation||34.8%|Easy||
+|0409|Longest Palindrome|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0409.Longest-Palindrome)|54.6%|Easy||
+|0410|Split Array Largest Sum|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0410.Split-Array-Largest-Sum)|53.2%|Hard||
+|0411|Minimum Unique Word Abbreviation||39.2%|Hard||
+|0412|Fizz Buzz|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0412.Fizz-Buzz)|68.6%|Easy||
+|0413|Arithmetic Slices|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0413.Arithmetic-Slices)|65.0%|Medium||
+|0414|Third Maximum Number|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0414.Third-Maximum-Number)|32.5%|Easy||
+|0415|Add Strings||52.6%|Easy||
+|0416|Partition Equal Subset Sum|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0416.Partition-Equal-Subset-Sum)|46.7%|Medium||
+|0417|Pacific Atlantic Water Flow|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0417.Pacific-Atlantic-Water-Flow)|53.9%|Medium||
+|0418|Sentence Screen Fitting||35.6%|Medium||
+|0419|Battleships in a Board|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0419.Battleships-in-a-Board)|74.6%|Medium||
+|0420|Strong Password Checker||14.3%|Hard||
+|0421|Maximum XOR of Two Numbers in an Array|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0421.Maximum-XOR-of-Two-Numbers-in-an-Array)|54.6%|Medium||
+|0422|Valid Word Square||38.8%|Easy||
+|0423|Reconstruct Original Digits from English|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0423.Reconstruct-Original-Digits-from-English)|51.3%|Medium||
+|0424|Longest Repeating Character Replacement|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0424.Longest-Repeating-Character-Replacement)|51.4%|Medium||
+|0425|Word Squares||52.6%|Hard||
+|0426|Convert Binary Search Tree to Sorted Doubly Linked List||64.6%|Medium||
+|0427|Construct Quad Tree||66.3%|Medium||
+|0428|Serialize and Deserialize N-ary Tree||65.3%|Hard||
+|0429|N-ary Tree Level Order Traversal|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0429.N-ary-Tree-Level-Order-Traversal)|70.6%|Medium||
+|0430|Flatten a Multilevel Doubly Linked List||59.4%|Medium||
+|0431|Encode N-ary Tree to Binary Tree||78.6%|Hard||
+|0432|All O`one Data Structure||36.6%|Hard||
+|0433|Minimum Genetic Mutation|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0433.Minimum-Genetic-Mutation)|48.1%|Medium||
+|0434|Number of Segments in a String|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0434.Number-of-Segments-in-a-String)|37.7%|Easy||
+|0435|Non-overlapping Intervals|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0435.Non-overlapping-Intervals)|49.8%|Medium||
+|0436|Find Right Interval|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0436.Find-Right-Interval)|50.3%|Medium||
+|0437|Path Sum III|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0437.Path-Sum-III)|48.8%|Medium||
+|0438|Find All Anagrams in a String|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0438.Find-All-Anagrams-in-a-String)|48.9%|Medium||
+|0439|Ternary Expression Parser||58.2%|Medium||
+|0440|K-th Smallest in Lexicographical Order||30.7%|Hard||
+|0441|Arranging Coins|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0441.Arranging-Coins)|46.0%|Easy||
+|0442|Find All Duplicates in an Array||73.3%|Medium||
+|0443|String Compression||48.7%|Medium||
+|0444|Sequence Reconstruction||26.3%|Medium||
+|0445|Add Two Numbers II|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0445.Add-Two-Numbers-II)|59.4%|Medium||
+|0446|Arithmetic Slices II - Subsequence||39.8%|Hard||
+|0447|Number of Boomerangs|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0447.Number-of-Boomerangs)|54.6%|Medium||
+|0448|Find All Numbers Disappeared in an Array|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0448.Find-All-Numbers-Disappeared-in-an-Array)|59.6%|Easy||
+|0449|Serialize and Deserialize BST||56.7%|Medium||
+|0450|Delete Node in a BST||49.9%|Medium||
+|0451|Sort Characters By Frequency|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0451.Sort-Characters-By-Frequency)|68.5%|Medium||
+|0452|Minimum Number of Arrows to Burst Balloons||53.2%|Medium||
+|0453|Minimum Moves to Equal Array Elements|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0453.Minimum-Moves-to-Equal-Array-Elements)|55.6%|Medium||
+|0454|4Sum II|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0454.4Sum-II)|57.3%|Medium||
+|0455|Assign Cookies|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0455.Assign-Cookies)|50.6%|Easy||
+|0456|132 Pattern|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0456.132-Pattern)|32.4%|Medium||
+|0457|Circular Array Loop|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0457.Circular-Array-Loop)|32.1%|Medium||
+|0458|Poor Pigs|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0458.Poor-Pigs)|65.0%|Hard||
+|0459|Repeated Substring Pattern||43.7%|Easy||
+|0460|LFU Cache|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0460.LFU-Cache)|40.3%|Hard||
+|0461|Hamming Distance|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0461.Hamming-Distance)|74.8%|Easy||
+|0462|Minimum Moves to Equal Array Elements II|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0462.Minimum-Moves-to-Equal-Array-Elements-II)|60.1%|Medium||
+|0463|Island Perimeter|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0463.Island-Perimeter)|69.4%|Easy||
+|0464|Can I Win||29.8%|Medium||
+|0465|Optimal Account Balancing||49.3%|Hard||
+|0466|Count The Repetitions||29.2%|Hard||
+|0467|Unique Substrings in Wraparound String||38.2%|Medium||
+|0468|Validate IP Address||26.5%|Medium||
+|0469|Convex Polygon||38.5%|Medium||
+|0470|Implement Rand10() Using Rand7()|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0470.Implement-Rand10-Using-Rand7)|46.7%|Medium||
+|0471|Encode String with Shortest Length||50.7%|Hard||
+|0472|Concatenated Words||45.5%|Hard||
+|0473|Matchsticks to Square|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0473.Matchsticks-to-Square)|40.5%|Medium||
+|0474|Ones and Zeroes|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0474.Ones-and-Zeroes)|46.7%|Medium||
+|0475|Heaters|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0475.Heaters)|36.0%|Medium||
+|0476|Number Complement|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0476.Number-Complement)|67.1%|Easy||
+|0477|Total Hamming Distance|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0477.Total-Hamming-Distance)|52.2%|Medium||
+|0478|Generate Random Point in a Circle|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0478.Generate-Random-Point-in-a-Circle)|39.6%|Medium||
+|0479|Largest Palindrome Product||31.6%|Hard||
+|0480|Sliding Window Median|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0480.Sliding-Window-Median)|41.4%|Hard||
+|0481|Magical String||50.4%|Medium||
+|0482|License Key Formatting||43.2%|Easy||
+|0483|Smallest Good Base|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0483.Smallest-Good-Base)|38.4%|Hard||
+|0484|Find Permutation||67.0%|Medium||
+|0485|Max Consecutive Ones|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0485.Max-Consecutive-Ones)|56.0%|Easy||
+|0486|Predict the Winner||50.8%|Medium||
+|0487|Max Consecutive Ones II||49.2%|Medium||
+|0488|Zuma Game|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0488.Zuma-Game)|34.9%|Hard||
+|0489|Robot Room Cleaner||76.5%|Hard||
+|0490|The Maze||55.4%|Medium||
+|0491|Increasing Subsequences|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0491.Increasing-Subsequences)|52.0%|Medium||
+|0492|Construct the Rectangle|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0492.Construct-the-Rectangle)|53.6%|Easy||
+|0493|Reverse Pairs|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0493.Reverse-Pairs)|30.8%|Hard||
+|0494|Target Sum|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0494.Target-Sum)|45.6%|Medium||
+|0495|Teemo Attacking|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0495.Teemo-Attacking)|57.0%|Easy||
+|0496|Next Greater Element I|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0496.Next-Greater-Element-I)|71.3%|Easy||
+|0497|Random Point in Non-overlapping Rectangles|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0497.Random-Point-in-Non-overlapping-Rectangles)|39.3%|Medium||
+|0498|Diagonal Traverse|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0498.Diagonal-Traverse)|58.0%|Medium||
+|0499|The Maze III||46.9%|Hard||
+|0500|Keyboard Row|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0500.Keyboard-Row)|69.0%|Easy||
+|0501|Find Mode in Binary Search Tree||48.5%|Easy||
+|0502|IPO||44.9%|Hard||
+|0503|Next Greater Element II|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0503.Next-Greater-Element-II)|63.0%|Medium||
+|0504|Base 7|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0504.Base-7)|47.9%|Easy||
+|0505|The Maze II||52.4%|Medium||
+|0506|Relative Ranks|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0506.Relative-Ranks)|58.8%|Easy||
+|0507|Perfect Number|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0507.Perfect-Number)|37.7%|Easy||
+|0508|Most Frequent Subtree Sum|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0508.Most-Frequent-Subtree-Sum)|64.2%|Medium||
+|0509|Fibonacci Number|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0509.Fibonacci-Number)|69.2%|Easy||
+|0510|Inorder Successor in BST II||61.1%|Medium||
+|0511|Game Play Analysis I||78.8%|Easy||
+|0512|Game Play Analysis II||54.1%|Easy||
+|0513|Find Bottom Left Tree Value|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0513.Find-Bottom-Left-Tree-Value)|66.3%|Medium||
+|0514|Freedom Trail||46.8%|Hard||
+|0515|Find Largest Value in Each Tree Row|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0515.Find-Largest-Value-in-Each-Tree-Row)|64.6%|Medium||
+|0516|Longest Palindromic Subsequence||60.6%|Medium||
+|0517|Super Washing Machines||39.7%|Hard||
+|0518|Coin Change II|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0518.Coin-Change-II)|59.7%|Medium||
+|0519|Random Flip Matrix|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0519.Random-Flip-Matrix)|39.6%|Medium||
+|0520|Detect Capital|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0520.Detect-Capital)|55.6%|Easy||
+|0521|Longest Uncommon Subsequence I||60.3%|Easy||
+|0522|Longest Uncommon Subsequence II||40.4%|Medium||
+|0523|Continuous Subarray Sum|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0523.Continuous-Subarray-Sum)|27.7%|Medium||
+|0524|Longest Word in Dictionary through Deleting|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0524.Longest-Word-in-Dictionary-through-Deleting)|51.2%|Medium||
+|0525|Contiguous Array|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0525.Contiguous-Array)|46.8%|Medium||
+|0526|Beautiful Arrangement|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0526.Beautiful-Arrangement)|64.6%|Medium||
+|0527|Word Abbreviation||60.3%|Hard||
+|0528|Random Pick with Weight|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0528.Random-Pick-with-Weight)|46.1%|Medium||
+|0529|Minesweeper|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0529.Minesweeper)|65.5%|Medium||
+|0530|Minimum Absolute Difference in BST|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0530.Minimum-Absolute-Difference-in-BST)|56.7%|Easy||
+|0531|Lonely Pixel I||62.0%|Medium||
+|0532|K-diff Pairs in an Array|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0532.K-diff-Pairs-in-an-Array)|40.7%|Medium||
+|0533|Lonely Pixel II||48.4%|Medium||
+|0534|Game Play Analysis III||82.5%|Medium||
+|0535|Encode and Decode TinyURL|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0535.Encode-and-Decode-TinyURL)|85.7%|Medium||
+|0536|Construct Binary Tree from String||56.1%|Medium||
+|0537|Complex Number Multiplication|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0537.Complex-Number-Multiplication)|71.3%|Medium||
+|0538|Convert BST to Greater Tree|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0538.Convert-BST-to-Greater-Tree)|67.3%|Medium||
+|0539|Minimum Time Difference||56.3%|Medium||
+|0540|Single Element in a Sorted Array|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0540.Single-Element-in-a-Sorted-Array)|58.5%|Medium||
+|0541|Reverse String II|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0541.Reverse-String-II)|50.5%|Easy||
+|0542|01 Matrix|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0542.01-Matrix)|44.1%|Medium||
+|0543|Diameter of Binary Tree|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0543.Diameter-of-Binary-Tree)|55.9%|Easy||
+|0544|Output Contest Matches||76.7%|Medium||
+|0545|Boundary of Binary Tree||44.2%|Medium||
+|0546|Remove Boxes||47.6%|Hard||
+|0547|Number of Provinces|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0547.Number-of-Provinces)|63.2%|Medium||
+|0548|Split Array with Equal Sum||50.1%|Hard||
+|0549|Binary Tree Longest Consecutive Sequence II||49.5%|Medium||
+|0550|Game Play Analysis IV||44.1%|Medium||
+|0551|Student Attendance Record I|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0551.Student-Attendance-Record-I)|48.0%|Easy||
+|0552|Student Attendance Record II||41.1%|Hard||
+|0553|Optimal Division||59.7%|Medium||
+|0554|Brick Wall|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0554.Brick-Wall)|53.1%|Medium||
+|0555|Split Concatenated Strings||43.5%|Medium||
+|0556|Next Greater Element III||34.1%|Medium||
+|0557|Reverse Words in a String III|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0557.Reverse-Words-in-a-String-III)|81.5%|Easy||
+|0558|Logical OR of Two Binary Grids Represented as Quad-Trees||48.2%|Medium||
+|0559|Maximum Depth of N-ary Tree|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0559.Maximum-Depth-of-N-ary-Tree)|71.6%|Easy||
+|0560|Subarray Sum Equals K|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0560.Subarray-Sum-Equals-K)|44.0%|Medium||
+|0561|Array Partition|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0561.Array-Partition)|76.5%|Easy||
+|0562|Longest Line of Consecutive One in Matrix||50.0%|Medium||
+|0563|Binary Tree Tilt|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0563.Binary-Tree-Tilt)|59.3%|Easy||
+|0564|Find the Closest Palindrome||21.9%|Hard||
+|0565|Array Nesting||56.5%|Medium||
+|0566|Reshape the Matrix|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0566.Reshape-the-Matrix)|62.7%|Easy||
+|0567|Permutation in String|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0567.Permutation-in-String)|43.8%|Medium||
+|0568|Maximum Vacation Days||44.8%|Hard||
+|0569|Median Employee Salary||68.3%|Hard||
+|0570|Managers with at Least 5 Direct Reports||67.1%|Medium||
+|0571|Find Median Given Frequency of Numbers||44.7%|Hard||
+|0572|Subtree of Another Tree|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0572.Subtree-of-Another-Tree)|45.9%|Easy||
+|0573|Squirrel Simulation||55.0%|Medium||
+|0574|Winning Candidate||59.7%|Medium||
+|0575|Distribute Candies|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0575.Distribute-Candies)|66.1%|Easy||
+|0576|Out of Boundary Paths|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0576.Out-of-Boundary-Paths)|44.3%|Medium||
+|0577|Employee Bonus||75.3%|Easy||
+|0578|Get Highest Answer Rate Question||41.7%|Medium||
+|0579|Find Cumulative Salary of an Employee||45.0%|Hard||
+|0580|Count Student Number in Departments||58.2%|Medium||
+|0581|Shortest Unsorted Continuous Subarray|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0581.Shortest-Unsorted-Continuous-Subarray)|36.2%|Medium||
+|0582|Kill Process||68.4%|Medium||
+|0583|Delete Operation for Two Strings|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0583.Delete-Operation-for-Two-Strings)|59.2%|Medium||
+|0584|Find Customer Referee||76.0%|Easy||
+|0585|Investments in 2016||53.5%|Medium||
+|0586|Customer Placing the Largest Number of Orders||72.5%|Easy||
+|0587|Erect the Fence||43.2%|Hard||
+|0588|Design In-Memory File System||48.8%|Hard||
+|0589|N-ary Tree Preorder Traversal|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0589.N-ary-Tree-Preorder-Traversal)|76.3%|Easy||
+|0590|N-ary Tree Postorder Traversal||77.1%|Easy||
+|0591|Tag Validator||37.0%|Hard||
+|0592|Fraction Addition and Subtraction||52.1%|Medium||
+|0593|Valid Square||44.1%|Medium||
+|0594|Longest Harmonious Subsequence|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0594.Longest-Harmonious-Subsequence)|53.1%|Easy||
+|0595|Big Countries||73.8%|Easy||
+|0596|Classes More Than 5 Students||46.5%|Easy||
+|0597|Friend Requests I: Overall Acceptance Rate||42.9%|Easy||
+|0598|Range Addition II|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0598.Range-Addition-II)|55.0%|Easy||
+|0599|Minimum Index Sum of Two Lists|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0599.Minimum-Index-Sum-of-Two-Lists)|52.7%|Easy||
+|0600|Non-negative Integers without Consecutive Ones||39.0%|Hard||
+|0601|Human Traffic of Stadium||50.6%|Hard||
+|0602|Friend Requests II: Who Has the Most Friends||61.3%|Medium||
+|0603|Consecutive Available Seats||68.2%|Easy||
+|0604|Design Compressed String Iterator||39.4%|Easy||
+|0605|Can Place Flowers|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0605.Can-Place-Flowers)|33.0%|Easy||
+|0606|Construct String from Binary Tree||63.5%|Easy||
+|0607|Sales Person||72.1%|Easy||
+|0608|Tree Node||74.9%|Medium||
+|0609|Find Duplicate File in System|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0609.Find-Duplicate-File-in-System)|67.8%|Medium||
+|0610|Triangle Judgement||71.1%|Easy||
+|0611|Valid Triangle Number|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0611.Valid-Triangle-Number)|50.3%|Medium||
+|0612|Shortest Distance in a Plane||63.5%|Medium||
+|0613|Shortest Distance in a Line||81.5%|Easy||
+|0614|Second Degree Follower||36.9%|Medium||
+|0615|Average Salary: Departments VS Company||57.3%|Hard||
+|0616|Add Bold Tag in String||48.6%|Medium||
+|0617|Merge Two Binary Trees|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0617.Merge-Two-Binary-Trees)|78.5%|Easy||
+|0618|Students Report By Geography||64.2%|Hard||
+|0619|Biggest Single Number||48.7%|Easy||
+|0620|Not Boring Movies||73.3%|Easy||
+|0621|Task Scheduler||55.6%|Medium||
+|0622|Design Circular Queue|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0622.Design-Circular-Queue)|51.8%|Medium||
+|0623|Add One Row to Tree|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0623.Add-One-Row-to-Tree)|59.4%|Medium||
+|0624|Maximum Distance in Arrays||41.7%|Medium||
+|0625|Minimum Factorization||33.4%|Medium||
+|0626|Exchange Seats||70.6%|Medium||
+|0627|Swap Salary||82.8%|Easy||
+|0628|Maximum Product of Three Numbers|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0628.Maximum-Product-of-Three-Numbers)|46.4%|Easy||
+|0629|K Inverse Pairs Array||43.0%|Hard||
+|0630|Course Schedule III|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0630.Course-Schedule-III)|40.2%|Hard||
+|0631|Design Excel Sum Formula||43.3%|Hard||
+|0632|Smallest Range Covering Elements from K Lists|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0632.Smallest-Range-Covering-Elements-from-K-Lists)|60.4%|Hard||
+|0633|Sum of Square Numbers|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0633.Sum-of-Square-Numbers)|34.7%|Medium||
+|0634|Find the Derangement of An Array||41.8%|Medium||
+|0635|Design Log Storage System||62.7%|Medium||
+|0636|Exclusive Time of Functions|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0636.Exclusive-Time-of-Functions)|61.0%|Medium||
+|0637|Average of Levels in Binary Tree|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0637.Average-of-Levels-in-Binary-Tree)|71.6%|Easy||
+|0638|Shopping Offers|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0638.Shopping-Offers)|54.3%|Medium||
+|0639|Decode Ways II||30.4%|Hard||
+|0640|Solve the Equation||43.3%|Medium||
+|0641|Design Circular Deque||57.6%|Medium||
+|0642|Design Search Autocomplete System||48.7%|Hard||
+|0643|Maximum Average Subarray I|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0643.Maximum-Average-Subarray-I)|43.8%|Easy||
+|0644|Maximum Average Subarray II||35.7%|Hard||
+|0645|Set Mismatch|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0645.Set-Mismatch)|41.4%|Easy||
+|0646|Maximum Length of Pair Chain||56.4%|Medium||
+|0647|Palindromic Substrings|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0647.Palindromic-Substrings)|66.3%|Medium||
+|0648|Replace Words|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0648.Replace-Words)|62.7%|Medium||
+|0649|Dota2 Senate||40.4%|Medium||
+|0650|2 Keys Keyboard||53.1%|Medium||
+|0651|4 Keys Keyboard||54.5%|Medium||
+|0652|Find Duplicate Subtrees||56.5%|Medium||
+|0653|Two Sum IV - Input is a BST|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0653.Two-Sum-IV-Input-is-a-BST)|60.9%|Easy||
+|0654|Maximum Binary Tree||84.4%|Medium||
+|0655|Print Binary Tree||61.3%|Medium||
+|0656|Coin Path||31.6%|Hard||
+|0657|Robot Return to Origin||75.3%|Easy||
+|0658|Find K Closest Elements|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0658.Find-K-Closest-Elements)|46.7%|Medium||
+|0659|Split Array into Consecutive Subsequences||50.6%|Medium||
+|0660|Remove 9||56.8%|Hard||
+|0661|Image Smoother|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0661.Image-Smoother)|55.0%|Easy||
+|0662|Maximum Width of Binary Tree|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0662.Maximum-Width-of-Binary-Tree)|40.6%|Medium||
+|0663|Equal Tree Partition||41.4%|Medium||
+|0664|Strange Printer||46.8%|Hard||
+|0665|Non-decreasing Array|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0665.Non-decreasing-Array)|24.1%|Medium||
+|0666|Path Sum IV||59.1%|Medium||
+|0667|Beautiful Arrangement II|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0667.Beautiful-Arrangement-II)|59.7%|Medium||
+|0668|Kth Smallest Number in Multiplication Table|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0668.Kth-Smallest-Number-in-Multiplication-Table)|51.5%|Hard||
+|0669|Trim a Binary Search Tree|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0669.Trim-a-Binary-Search-Tree)|66.3%|Medium||
+|0670|Maximum Swap||47.8%|Medium||
+|0671|Second Minimum Node In a Binary Tree||44.0%|Easy||
+|0672|Bulb Switcher II||50.9%|Medium||
+|0673|Number of Longest Increasing Subsequence||42.1%|Medium||
+|0674|Longest Continuous Increasing Subsequence|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0674.Longest-Continuous-Increasing-Subsequence)|49.0%|Easy||
+|0675|Cut Off Trees for Golf Event||34.3%|Hard||
+|0676|Implement Magic Dictionary|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0676.Implement-Magic-Dictionary)|56.9%|Medium||
+|0677|Map Sum Pairs|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0677.Map-Sum-Pairs)|57.0%|Medium||
+|0678|Valid Parenthesis String||33.9%|Medium||
+|0679|24 Game||49.1%|Hard||
+|0680|Valid Palindrome II||39.3%|Easy||
+|0681|Next Closest Time||46.4%|Medium||
+|0682|Baseball Game|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0682.Baseball-Game)|73.6%|Easy||
+|0683|K Empty Slots||36.9%|Hard||
+|0684|Redundant Connection|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0684.Redundant-Connection)|62.0%|Medium||
+|0685|Redundant Connection II|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0685.Redundant-Connection-II)|34.1%|Hard||
+|0686|Repeated String Match||34.0%|Medium||
+|0687|Longest Univalue Path||40.1%|Medium||
+|0688|Knight Probability in Chessboard||52.0%|Medium||
+|0689|Maximum Sum of 3 Non-Overlapping Subarrays||48.8%|Hard||
+|0690|Employee Importance|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0690.Employee-Importance)|65.1%|Medium||
+|0691|Stickers to Spell Word||46.3%|Hard||
+|0692|Top K Frequent Words|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0692.Top-K-Frequent-Words)|55.2%|Medium||
+|0693|Binary Number with Alternating Bits|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0693.Binary-Number-with-Alternating-Bits)|61.2%|Easy||
+|0694|Number of Distinct Islands||60.6%|Medium||
+|0695|Max Area of Island|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0695.Max-Area-of-Island)|71.6%|Medium||
+|0696|Count Binary Substrings|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0696.Count-Binary-Substrings)|65.5%|Easy||
+|0697|Degree of an Array|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0697.Degree-of-an-Array)|55.8%|Easy||
+|0698|Partition to K Equal Sum Subsets||41.1%|Medium||
+|0699|Falling Squares|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0699.Falling-Squares)|44.4%|Hard||
+|0700|Search in a Binary Search Tree|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0700.Search-in-a-Binary-Search-Tree)|77.1%|Easy||
+|0701|Insert into a Binary Search Tree|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0701.Insert-into-a-Binary-Search-Tree)|74.6%|Medium||
+|0702|Search in a Sorted Array of Unknown Size||71.4%|Medium||
+|0703|Kth Largest Element in a Stream|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0703.Kth-Largest-Element-in-a-Stream)|55.5%|Easy||
+|0704|Binary Search|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0704.Binary-Search)|55.1%|Easy||
+|0705|Design HashSet|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0705.Design-HashSet)|66.0%|Easy||
+|0706|Design HashMap|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0706.Design-HashMap)|65.1%|Easy||
+|0707|Design Linked List|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0707.Design-Linked-List)|27.5%|Medium||
+|0708|Insert into a Sorted Circular Linked List||34.5%|Medium||
+|0709|To Lower Case|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0709.To-Lower-Case)|81.9%|Easy||
+|0710|Random Pick with Blacklist|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0710.Random-Pick-with-Blacklist)|33.6%|Hard||
+|0711|Number of Distinct Islands II||51.8%|Hard||
+|0712|Minimum ASCII Delete Sum for Two Strings||62.2%|Medium||
+|0713|Subarray Product Less Than K|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0713.Subarray-Product-Less-Than-K)|45.0%|Medium||
+|0714|Best Time to Buy and Sell Stock with Transaction Fee|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0714.Best-Time-to-Buy-and-Sell-Stock-with-Transaction-Fee)|64.2%|Medium||
+|0715|Range Module|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0715.Range-Module)|44.6%|Hard||
+|0716|Max Stack||45.3%|Hard||
+|0717|1-bit and 2-bit Characters|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0717.1-bit-and-2-bit-Characters)|46.0%|Easy||
+|0718|Maximum Length of Repeated Subarray|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0718.Maximum-Length-of-Repeated-Subarray)|51.6%|Medium||
+|0719|Find K-th Smallest Pair Distance|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0719.Find-K-th-Smallest-Pair-Distance)|36.3%|Hard||
+|0720|Longest Word in Dictionary|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0720.Longest-Word-in-Dictionary)|51.8%|Medium||
+|0721|Accounts Merge|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0721.Accounts-Merge)|56.3%|Medium||
+|0722|Remove Comments||38.0%|Medium||
+|0723|Candy Crush||76.3%|Medium||
+|0724|Find Pivot Index|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0724.Find-Pivot-Index)|53.3%|Easy||
+|0725|Split Linked List in Parts|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0725.Split-Linked-List-in-Parts)|57.2%|Medium||
+|0726|Number of Atoms|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0726.Number-of-Atoms)|52.2%|Hard||
+|0727|Minimum Window Subsequence||42.8%|Hard||
+|0728|Self Dividing Numbers|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0728.Self-Dividing-Numbers)|77.5%|Easy||
+|0729|My Calendar I|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0729.My-Calendar-I)|57.2%|Medium||
+|0730|Count Different Palindromic Subsequences||44.4%|Hard||
+|0731|My Calendar II||54.7%|Medium||
+|0732|My Calendar III|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0732.My-Calendar-III)|71.6%|Hard||
+|0733|Flood Fill|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0733.Flood-Fill)|60.3%|Easy||
+|0734|Sentence Similarity||43.1%|Easy||
+|0735|Asteroid Collision|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0735.Asteroid-Collision)|44.4%|Medium||
+|0736|Parse Lisp Expression||51.6%|Hard||
+|0737|Sentence Similarity II||48.7%|Medium||
+|0738|Monotone Increasing Digits||47.0%|Medium||
+|0739|Daily Temperatures|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0739.Daily-Temperatures)|66.5%|Medium||
+|0740|Delete and Earn||57.4%|Medium||
+|0741|Cherry Pickup||36.3%|Hard||
+|0742|Closest Leaf in a Binary Tree||45.8%|Medium||
+|0743|Network Delay Time||51.4%|Medium||
+|0744|Find Smallest Letter Greater Than Target|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0744.Find-Smallest-Letter-Greater-Than-Target)|44.6%|Easy||
+|0745|Prefix and Suffix Search|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0745.Prefix-and-Suffix-Search)|41.3%|Hard||
+|0746|Min Cost Climbing Stairs|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0746.Min-Cost-Climbing-Stairs)|62.3%|Easy||
+|0747|Largest Number At Least Twice of Others|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0747.Largest-Number-At-Least-Twice-of-Others)|46.3%|Easy||
+|0748|Shortest Completing Word|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0748.Shortest-Completing-Word)|59.1%|Easy||
+|0749|Contain Virus||50.8%|Hard||
+|0750|Number Of Corner Rectangles||67.5%|Medium||
+|0751|IP to CIDR||54.7%|Medium||
+|0752|Open the Lock|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0752.Open-the-Lock)|55.5%|Medium||
+|0753|Cracking the Safe|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0753.Cracking-the-Safe)|55.4%|Hard||
+|0754|Reach a Number||42.5%|Medium||
+|0755|Pour Water||46.1%|Medium||
+|0756|Pyramid Transition Matrix|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0756.Pyramid-Transition-Matrix)|53.3%|Medium||
+|0757|Set Intersection Size At Least Two||43.8%|Hard||
+|0758|Bold Words in String||50.6%|Medium||
+|0759|Employee Free Time||71.7%|Hard||
+|0760|Find Anagram Mappings||82.8%|Easy||
+|0761|Special Binary String||60.3%|Hard||
+|0762|Prime Number of Set Bits in Binary Representation|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0762.Prime-Number-of-Set-Bits-in-Binary-Representation)|67.6%|Easy||
+|0763|Partition Labels|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0763.Partition-Labels)|79.8%|Medium||
+|0764|Largest Plus Sign||48.4%|Medium||
+|0765|Couples Holding Hands|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0765.Couples-Holding-Hands)|56.9%|Hard||
+|0766|Toeplitz Matrix|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0766.Toeplitz-Matrix)|68.1%|Easy||
+|0767|Reorganize String|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0767.Reorganize-String)|52.7%|Medium||
+|0768|Max Chunks To Make Sorted II||52.7%|Hard||
+|0769|Max Chunks To Make Sorted||58.2%|Medium||
+|0770|Basic Calculator IV||56.0%|Hard||
+|0771|Jewels and Stones|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0771.Jewels-and-Stones)|88.0%|Easy||
+|0772|Basic Calculator III||48.4%|Hard||
+|0773|Sliding Puzzle||63.7%|Hard||
+|0774|Minimize Max Distance to Gas Station||51.4%|Hard||
+|0775|Global and Local Inversions|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0775.Global-and-Local-Inversions)|43.8%|Medium||
+|0776|Split BST||58.7%|Medium||
+|0777|Swap Adjacent in LR String||37.1%|Medium||
+|0778|Swim in Rising Water|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0778.Swim-in-Rising-Water)|59.6%|Hard||
+|0779|K-th Symbol in Grammar||40.7%|Medium||
+|0780|Reaching Points||32.3%|Hard||
+|0781|Rabbits in Forest|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0781.Rabbits-in-Forest)|55.3%|Medium||
+|0782|Transform to Chessboard||51.9%|Hard||
+|0783|Minimum Distance Between BST Nodes|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0783.Minimum-Distance-Between-BST-Nodes)|56.8%|Easy||
+|0784|Letter Case Permutation|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0784.Letter-Case-Permutation)|73.4%|Medium||
+|0785|Is Graph Bipartite?|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0785.Is-Graph-Bipartite)|52.6%|Medium||
+|0786|K-th Smallest Prime Fraction|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0786.K-th-Smallest-Prime-Fraction)|50.6%|Medium||
+|0787|Cheapest Flights Within K Stops||35.9%|Medium||
+|0788|Rotated Digits||56.9%|Medium||
+|0789|Escape The Ghosts||60.6%|Medium||
+|0790|Domino and Tromino Tiling||48.4%|Medium||
+|0791|Custom Sort String|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0791.Custom-Sort-String)|69.4%|Medium||
+|0792|Number of Matching Subsequences|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0792.Number-of-Matching-Subsequences)|51.9%|Medium||
+|0793|Preimage Size of Factorial Zeroes Function|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0793.Preimage-Size-of-Factorial-Zeroes-Function)|42.7%|Hard||
+|0794|Valid Tic-Tac-Toe State|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0794.Valid-Tic-Tac-Toe-State)|35.2%|Medium||
+|0795|Number of Subarrays with Bounded Maximum|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0795.Number-of-Subarrays-with-Bounded-Maximum)|52.7%|Medium||
+|0796|Rotate String||54.0%|Easy||
+|0797|All Paths From Source to Target||81.4%|Medium||
+|0798|Smallest Rotation with Highest Score||49.6%|Hard||
+|0799|Champagne Tower||51.2%|Medium||
+|0800|Similar RGB Color||66.4%|Easy||
+|0801|Minimum Swaps To Make Sequences Increasing||39.2%|Hard||
+|0802|Find Eventual Safe States|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0802.Find-Eventual-Safe-States)|54.9%|Medium||
+|0803|Bricks Falling When Hit|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0803.Bricks-Falling-When-Hit)|34.3%|Hard||
+|0804|Unique Morse Code Words||82.6%|Easy||
+|0805|Split Array With Same Average||25.9%|Hard||
+|0806|Number of Lines To Write String||66.1%|Easy||
+|0807|Max Increase to Keep City Skyline|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0807.Max-Increase-to-Keep-City-Skyline)|85.9%|Medium||
+|0808|Soup Servings||43.1%|Medium||
+|0809|Expressive Words||46.3%|Medium||
+|0810|Chalkboard XOR Game|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0810.Chalkboard-XOR-Game)|55.1%|Hard||
+|0811|Subdomain Visit Count|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0811.Subdomain-Visit-Count)|75.1%|Medium||
+|0812|Largest Triangle Area|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0812.Largest-Triangle-Area)|60.1%|Easy||
+|0813|Largest Sum of Averages||52.9%|Medium||
+|0814|Binary Tree Pruning||72.6%|Medium||
+|0815|Bus Routes|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0815.Bus-Routes)|45.7%|Hard||
+|0816|Ambiguous Coordinates|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0816.Ambiguous-Coordinates)|56.0%|Medium||
+|0817|Linked List Components|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0817.Linked-List-Components)|58.1%|Medium||
+|0818|Race Car||43.6%|Hard||
+|0819|Most Common Word|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0819.Most-Common-Word)|45.0%|Easy||
+|0820|Short Encoding of Words|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0820.Short-Encoding-of-Words)|60.7%|Medium||
+|0821|Shortest Distance to a Character|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0821.Shortest-Distance-to-a-Character)|71.3%|Easy||
+|0822|Card Flipping Game||45.4%|Medium||
+|0823|Binary Trees With Factors|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0823.Binary-Trees-With-Factors)|50.0%|Medium||
+|0824|Goat Latin||67.8%|Easy||
+|0825|Friends Of Appropriate Ages|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0825.Friends-Of-Appropriate-Ages)|46.3%|Medium||
+|0826|Most Profit Assigning Work|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0826.Most-Profit-Assigning-Work)|44.3%|Medium||
+|0827|Making A Large Island||44.7%|Hard||
+|0828|Count Unique Characters of All Substrings of a Given String|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0828.Count-Unique-Characters-of-All-Substrings-of-a-Given-String)|51.5%|Hard||
+|0829|Consecutive Numbers Sum||41.5%|Hard||
+|0830|Positions of Large Groups|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0830.Positions-of-Large-Groups)|51.7%|Easy||
+|0831|Masking Personal Information||46.8%|Medium||
+|0832|Flipping an Image|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0832.Flipping-an-Image)|80.3%|Easy||
+|0833|Find And Replace in String||54.1%|Medium||
+|0834|Sum of Distances in Tree|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0834.Sum-of-Distances-in-Tree)|54.1%|Hard||
+|0835|Image Overlap||61.0%|Medium||
+|0836|Rectangle Overlap|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0836.Rectangle-Overlap)|43.3%|Easy||
+|0837|New 21 Game||36.2%|Medium||
+|0838|Push Dominoes|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0838.Push-Dominoes)|57.0%|Medium||
+|0839|Similar String Groups|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0839.Similar-String-Groups)|47.5%|Hard||
+|0840|Magic Squares In Grid||38.5%|Medium||
+|0841|Keys and Rooms|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0841.Keys-and-Rooms)|70.1%|Medium||
+|0842|Split Array into Fibonacci Sequence|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0842.Split-Array-into-Fibonacci-Sequence)|38.2%|Medium||
+|0843|Guess the Word||42.0%|Hard||
+|0844|Backspace String Compare|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0844.Backspace-String-Compare)|48.0%|Easy||
+|0845|Longest Mountain in Array|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0845.Longest-Mountain-in-Array)|40.1%|Medium||
+|0846|Hand of Straights|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0846.Hand-of-Straights)|56.5%|Medium||
+|0847|Shortest Path Visiting All Nodes||61.3%|Hard||
+|0848|Shifting Letters||45.4%|Medium||
+|0849|Maximize Distance to Closest Person||47.6%|Medium||
+|0850|Rectangle Area II|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0850.Rectangle-Area-II)|53.7%|Hard||
+|0851|Loud and Rich|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0851.Loud-and-Rich)|58.1%|Medium||
+|0852|Peak Index in a Mountain Array|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0852.Peak-Index-in-a-Mountain-Array)|69.5%|Medium||
+|0853|Car Fleet|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0853.Car-Fleet)|50.0%|Medium||
+|0854|K-Similar Strings||40.0%|Hard||
+|0855|Exam Room||43.5%|Medium||
+|0856|Score of Parentheses|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0856.Score-of-Parentheses)|65.1%|Medium||
+|0857|Minimum Cost to Hire K Workers||52.0%|Hard||
+|0858|Mirror Reflection||63.3%|Medium||
+|0859|Buddy Strings|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0859.Buddy-Strings)|29.0%|Easy||
+|0860|Lemonade Change||52.8%|Easy||
+|0861|Score After Flipping Matrix||75.1%|Medium||
+|0862|Shortest Subarray with Sum at Least K|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0862.Shortest-Subarray-with-Sum-at-Least-K)|26.1%|Hard||
+|0863|All Nodes Distance K in Binary Tree|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0863.All-Nodes-Distance-K-in-Binary-Tree)|62.1%|Medium||
+|0864|Shortest Path to Get All Keys|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0864.Shortest-Path-to-Get-All-Keys)|45.3%|Hard||
+|0865|Smallest Subtree with all the Deepest Nodes||68.5%|Medium||
+|0866|Prime Palindrome||25.8%|Medium||
+|0867|Transpose Matrix|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0867.Transpose-Matrix)|63.4%|Easy||
+|0868|Binary Gap||61.9%|Easy||
+|0869|Reordered Power of 2|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0869.Reordered-Power-of-2)|64.1%|Medium||
+|0870|Advantage Shuffle|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0870.Advantage-Shuffle)|51.6%|Medium||
+|0871|Minimum Number of Refueling Stops||39.9%|Hard||
+|0872|Leaf-Similar Trees|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0872.Leaf-Similar-Trees)|65.2%|Easy||
+|0873|Length of Longest Fibonacci Subsequence||48.6%|Medium||
+|0874|Walking Robot Simulation|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0874.Walking-Robot-Simulation)|38.3%|Medium||
+|0875|Koko Eating Bananas|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0875.Koko-Eating-Bananas)|52.4%|Medium||
+|0876|Middle of the Linked List|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0876.Middle-of-the-Linked-List)|73.7%|Easy||
+|0877|Stone Game|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0877.Stone-Game)|69.7%|Medium||
+|0878|Nth Magical Number|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0878.Nth-Magical-Number)|35.7%|Hard||
+|0879|Profitable Schemes||40.5%|Hard||
+|0880|Decoded String at Index|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0880.Decoded-String-at-Index)|28.3%|Medium||
+|0881|Boats to Save People|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0881.Boats-to-Save-People)|52.7%|Medium||
+|0882|Reachable Nodes In Subdivided Graph||50.3%|Hard||
+|0883|Projection Area of 3D Shapes||70.7%|Easy||
+|0884|Uncommon Words from Two Sentences|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0884.Uncommon-Words-from-Two-Sentences)|65.9%|Easy||
+|0885|Spiral Matrix III|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0885.Spiral-Matrix-III)|73.0%|Medium||
+|0886|Possible Bipartition||48.4%|Medium||
+|0887|Super Egg Drop|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0887.Super-Egg-Drop)|27.2%|Hard||
+|0888|Fair Candy Swap|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0888.Fair-Candy-Swap)|60.5%|Easy||
+|0889|Construct Binary Tree from Preorder and Postorder Traversal||70.8%|Medium||
+|0890|Find and Replace Pattern|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0890.Find-and-Replace-Pattern)|77.9%|Medium||
+|0891|Sum of Subsequence Widths|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0891.Sum-of-Subsequence-Widths)|36.4%|Hard||
+|0892|Surface Area of 3D Shapes|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0892.Surface-Area-of-3D-Shapes)|63.0%|Easy||
+|0893|Groups of Special-Equivalent Strings||70.8%|Medium||
+|0894|All Possible Full Binary Trees||80.0%|Medium||
+|0895|Maximum Frequency Stack|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0895.Maximum-Frequency-Stack)|66.8%|Hard||
+|0896|Monotonic Array|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0896.Monotonic-Array)|58.2%|Easy||
+|0897|Increasing Order Search Tree|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0897.Increasing-Order-Search-Tree)|78.4%|Easy||
+|0898|Bitwise ORs of Subarrays|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0898.Bitwise-ORs-of-Subarrays)|36.8%|Medium||
+|0899|Orderly Queue||59.0%|Hard||
+|0900|RLE Iterator||59.5%|Medium||
+|0901|Online Stock Span|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0901.Online-Stock-Span)|63.9%|Medium||
+|0902|Numbers At Most N Given Digit Set||41.4%|Hard||
+|0903|Valid Permutations for DI Sequence||57.7%|Hard||
+|0904|Fruit Into Baskets|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0904.Fruit-Into-Baskets)|42.6%|Medium||
+|0905|Sort Array By Parity||75.7%|Easy||
+|0906|Super Palindromes||39.2%|Hard||
+|0907|Sum of Subarray Minimums|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0907.Sum-of-Subarray-Minimums)|34.3%|Medium||
+|0908|Smallest Range I||67.6%|Easy||
+|0909|Snakes and Ladders|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0909.Snakes-and-Ladders)|40.8%|Medium||
+|0910|Smallest Range II|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0910.Smallest-Range-II)|34.4%|Medium||
+|0911|Online Election|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0911.Online-Election)|52.1%|Medium||
+|0912|Sort an Array||60.0%|Medium||
+|0913|Cat and Mouse||35.3%|Hard||
+|0914|X of a Kind in a Deck of Cards|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0914.X-of-a-Kind-in-a-Deck-of-Cards)|32.2%|Easy||
+|0915|Partition Array into Disjoint Intervals||48.6%|Medium||
+|0916|Word Subsets|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0916.Word-Subsets)|54.1%|Medium||
+|0917|Reverse Only Letters||61.4%|Easy||
+|0918|Maximum Sum Circular Subarray|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0918.Maximum-Sum-Circular-Subarray)|38.1%|Medium||
+|0919|Complete Binary Tree Inserter||64.9%|Medium||
+|0920|Number of Music Playlists|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0920.Number-of-Music-Playlists)|50.6%|Hard||
+|0921|Minimum Add to Make Parentheses Valid|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0921.Minimum-Add-to-Make-Parentheses-Valid)|76.4%|Medium||
+|0922|Sort Array By Parity II|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0922.Sort-Array-By-Parity-II)|70.7%|Easy||
+|0923|3Sum With Multiplicity|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0923.3Sum-With-Multiplicity)|45.4%|Medium||
+|0924|Minimize Malware Spread|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0924.Minimize-Malware-Spread)|42.1%|Hard||
+|0925|Long Pressed Name|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0925.Long-Pressed-Name)|33.8%|Easy||
+|0926|Flip String to Monotone Increasing||59.6%|Medium||
+|0927|Three Equal Parts|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0927.Three-Equal-Parts)|39.6%|Hard||
+|0928|Minimize Malware Spread II|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0928.Minimize-Malware-Spread-II)|42.6%|Hard||
+|0929|Unique Email Addresses||67.2%|Easy||
+|0930|Binary Subarrays With Sum|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0930.Binary-Subarrays-With-Sum)|50.9%|Medium||
+|0931|Minimum Falling Path Sum||68.4%|Medium||
+|0932|Beautiful Array||65.1%|Medium||
+|0933|Number of Recent Calls|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0933.Number-of-Recent-Calls)|73.2%|Easy||
+|0934|Shortest Bridge||53.9%|Medium||
+|0935|Knight Dialer||49.9%|Medium||
+|0936|Stamping The Sequence||63.3%|Hard||
+|0937|Reorder Data in Log Files||56.4%|Medium||
+|0938|Range Sum of BST|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0938.Range-Sum-of-BST)|85.3%|Easy||
+|0939|Minimum Area Rectangle||53.2%|Medium||
+|0940|Distinct Subsequences II||44.4%|Hard||
+|0941|Valid Mountain Array||33.5%|Easy||
+|0942|DI String Match|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0942.DI-String-Match)|76.6%|Easy||
+|0943|Find the Shortest Superstring||45.0%|Hard||
+|0944|Delete Columns to Make Sorted||69.7%|Easy||
+|0945|Minimum Increment to Make Array Unique||49.8%|Medium||
+|0946|Validate Stack Sequences|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0946.Validate-Stack-Sequences)|67.6%|Medium||
+|0947|Most Stones Removed with Same Row or Column|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0947.Most-Stones-Removed-with-Same-Row-or-Column)|57.0%|Medium||
+|0948|Bag of Tokens||52.0%|Medium||
+|0949|Largest Time for Given Digits|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0949.Largest-Time-for-Given-Digits)|35.2%|Medium||
+|0950|Reveal Cards In Increasing Order||77.6%|Medium||
+|0951|Flip Equivalent Binary Trees||66.8%|Medium||
+|0952|Largest Component Size by Common Factor|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0952.Largest-Component-Size-by-Common-Factor)|40.3%|Hard||
+|0953|Verifying an Alien Dictionary|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0953.Verifying-an-Alien-Dictionary)|52.7%|Easy||
+|0954|Array of Doubled Pairs||39.1%|Medium||
+|0955|Delete Columns to Make Sorted II||34.6%|Medium||
+|0956|Tallest Billboard||40.0%|Hard||
+|0957|Prison Cells After N Days||39.2%|Medium||
+|0958|Check Completeness of a Binary Tree|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0958.Check-Completeness-of-a-Binary-Tree)|53.8%|Medium||
+|0959|Regions Cut By Slashes|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0959.Regions-Cut-By-Slashes)|69.1%|Medium||
+|0960|Delete Columns to Make Sorted III||57.1%|Hard||
+|0961|N-Repeated Element in Size 2N Array|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0961.N-Repeated-Element-in-Size-2N-Array)|75.8%|Easy||
+|0962|Maximum Width Ramp||48.9%|Medium||
+|0963|Minimum Area Rectangle II||54.7%|Medium||
+|0964|Least Operators to Express Number||47.8%|Hard||
+|0965|Univalued Binary Tree||69.2%|Easy||
+|0966|Vowel Spellchecker|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0966.Vowel-Spellchecker)|51.5%|Medium||
+|0967|Numbers With Same Consecutive Differences||57.0%|Medium||
+|0968|Binary Tree Cameras|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0968.Binary-Tree-Cameras)|46.8%|Hard||
+|0969|Pancake Sorting|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0969.Pancake-Sorting)|70.0%|Medium||
+|0970|Powerful Integers|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0970.Powerful-Integers)|43.6%|Medium||
+|0971|Flip Binary Tree To Match Preorder Traversal|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0971.Flip-Binary-Tree-To-Match-Preorder-Traversal)|49.9%|Medium||
+|0972|Equal Rational Numbers||43.0%|Hard||
+|0973|K Closest Points to Origin|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0973.K-Closest-Points-to-Origin)|65.9%|Medium||
+|0974|Subarray Sums Divisible by K||53.6%|Medium||
+|0975|Odd Even Jump||38.9%|Hard||
+|0976|Largest Perimeter Triangle|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0976.Largest-Perimeter-Triangle)|54.8%|Easy||
+|0977|Squares of a Sorted Array|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0977.Squares-of-a-Sorted-Array)|71.9%|Easy||
+|0978|Longest Turbulent Subarray|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0978.Longest-Turbulent-Subarray)|47.4%|Medium||
+|0979|Distribute Coins in Binary Tree|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0979.Distribute-Coins-in-Binary-Tree)|72.0%|Medium||
+|0980|Unique Paths III|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0980.Unique-Paths-III)|79.6%|Hard||
+|0981|Time Based Key-Value Store|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0981.Time-Based-Key-Value-Store)|53.6%|Medium||
+|0982|Triples with Bitwise AND Equal To Zero||57.6%|Hard||
+|0983|Minimum Cost For Tickets||64.4%|Medium||
+|0984|String Without AAA or BBB|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0984.String-Without-AAA-or-BBB)|42.9%|Medium||
+|0985|Sum of Even Numbers After Queries|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0985.Sum-of-Even-Numbers-After-Queries)|68.3%|Medium||
+|0986|Interval List Intersections|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0986.Interval-List-Intersections)|71.4%|Medium||
+|0987|Vertical Order Traversal of a Binary Tree|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0987.Vertical-Order-Traversal-of-a-Binary-Tree)|44.6%|Hard||
+|0988|Smallest String Starting From Leaf||49.6%|Medium||
+|0989|Add to Array-Form of Integer|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0989.Add-to-Array-Form-of-Integer)|45.5%|Easy||
+|0990|Satisfiability of Equality Equations|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0990.Satisfiability-of-Equality-Equations)|50.7%|Medium||
+|0991|Broken Calculator|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0991.Broken-Calculator)|54.1%|Medium||
+|0992|Subarrays with K Different Integers|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0992.Subarrays-with-K-Different-Integers)|54.3%|Hard||
+|0993|Cousins in Binary Tree|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0993.Cousins-in-Binary-Tree)|54.1%|Easy||
+|0994|Rotting Oranges||52.4%|Medium||
+|0995|Minimum Number of K Consecutive Bit Flips|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0995.Minimum-Number-of-K-Consecutive-Bit-Flips)|51.1%|Hard||
+|0996|Number of Squareful Arrays|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0996.Number-of-Squareful-Arrays)|49.2%|Hard||
+|0997|Find the Town Judge|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0997.Find-the-Town-Judge)|49.4%|Easy||
+|0998|Maximum Binary Tree II||66.3%|Medium||
+|0999|Available Captures for Rook|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0999.Available-Captures-for-Rook)|67.8%|Easy||
+|1000|Minimum Cost to Merge Stones||42.3%|Hard||
+|1001|Grid Illumination||36.2%|Hard||
+|1002|Find Common Characters|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1002.Find-Common-Characters)|68.3%|Easy||
+|1003|Check If Word Is Valid After Substitutions|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1003.Check-If-Word-Is-Valid-After-Substitutions)|58.2%|Medium||
+|1004|Max Consecutive Ones III|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1004.Max-Consecutive-Ones-III)|63.5%|Medium||
+|1005|Maximize Sum Of Array After K Negations|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1005.Maximize-Sum-Of-Array-After-K-Negations)|51.1%|Easy||
+|1006|Clumsy Factorial|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1006.Clumsy-Factorial)|54.7%|Medium||
+|1007|Minimum Domino Rotations For Equal Row||52.4%|Medium||
+|1008|Construct Binary Search Tree from Preorder Traversal||80.9%|Medium||
+|1009|Complement of Base 10 Integer|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1009.Complement-of-Base-10-Integer)|62.0%|Easy||
+|1010|Pairs of Songs With Total Durations Divisible by 60|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1010.Pairs-of-Songs-With-Total-Durations-Divisible-by-60)|53.0%|Medium||
+|1011|Capacity To Ship Packages Within D Days|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1011.Capacity-To-Ship-Packages-Within-D-Days)|64.4%|Medium||
+|1012|Numbers With Repeated Digits||40.4%|Hard||
+|1013|Partition Array Into Three Parts With Equal Sum||43.5%|Easy||
+|1014|Best Sightseeing Pair||59.5%|Medium||
+|1015|Smallest Integer Divisible by K||47.1%|Medium||
+|1016|Binary String With Substrings Representing 1 To N||57.6%|Medium||
+|1017|Convert to Base -2|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1017.Convert-to-Base-2)|60.9%|Medium||
+|1018|Binary Prefix Divisible By 5|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1018.Binary-Prefix-Divisible-By-5)|47.4%|Easy||
+|1019|Next Greater Node In Linked List|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1019.Next-Greater-Node-In-Linked-List)|59.8%|Medium||
+|1020|Number of Enclaves|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1020.Number-of-Enclaves)|64.8%|Medium||
+|1021|Remove Outermost Parentheses|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1021.Remove-Outermost-Parentheses)|80.1%|Easy||
+|1022|Sum of Root To Leaf Binary Numbers|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1022.Sum-of-Root-To-Leaf-Binary-Numbers)|73.8%|Easy||
+|1023|Camelcase Matching||60.1%|Medium||
+|1024|Video Stitching||50.5%|Medium||
+|1025|Divisor Game|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1025.Divisor-Game)|67.1%|Easy||
+|1026|Maximum Difference Between Node and Ancestor|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1026.Maximum-Difference-Between-Node-and-Ancestor)|73.4%|Medium||
+|1027|Longest Arithmetic Subsequence||47.2%|Medium||
+|1028|Recover a Tree From Preorder Traversal|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1028.Recover-a-Tree-From-Preorder-Traversal)|72.8%|Hard||
+|1029|Two City Scheduling||64.5%|Medium||
+|1030|Matrix Cells in Distance Order|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1030.Matrix-Cells-in-Distance-Order)|69.3%|Easy||
+|1031|Maximum Sum of Two Non-Overlapping Subarrays||59.4%|Medium||
+|1032|Stream of Characters||51.5%|Hard||
+|1033|Moving Stones Until Consecutive||45.6%|Medium||
+|1034|Coloring A Border|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1034.Coloring-A-Border)|48.9%|Medium||
+|1035|Uncrossed Lines||58.7%|Medium||
+|1036|Escape a Large Maze||34.2%|Hard||
+|1037|Valid Boomerang|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1037.Valid-Boomerang)|37.5%|Easy||
+|1038|Binary Search Tree to Greater Sum Tree|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1038.Binary-Search-Tree-to-Greater-Sum-Tree)|85.3%|Medium||
+|1039|Minimum Score Triangulation of Polygon||54.5%|Medium||
+|1040|Moving Stones Until Consecutive II|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1040.Moving-Stones-Until-Consecutive-II)|55.6%|Medium||
+|1041|Robot Bounded In Circle||55.3%|Medium||
+|1042|Flower Planting With No Adjacent||50.4%|Medium||
+|1043|Partition Array for Maximum Sum||71.2%|Medium||
+|1044|Longest Duplicate Substring||30.7%|Hard||
+|1045|Customers Who Bought All Products||67.6%|Medium||
+|1046|Last Stone Weight||64.7%|Easy||
+|1047|Remove All Adjacent Duplicates In String|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1047.Remove-All-Adjacent-Duplicates-In-String)|70.5%|Easy||
+|1048|Longest String Chain|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1048.Longest-String-Chain)|59.2%|Medium||
+|1049|Last Stone Weight II|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1049.Last-Stone-Weight-II)|52.4%|Medium||
+|1050|Actors and Directors Who Cooperated At Least Three Times||72.4%|Easy||
+|1051|Height Checker|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1051.Height-Checker)|75.0%|Easy||
+|1052|Grumpy Bookstore Owner|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1052.Grumpy-Bookstore-Owner)|57.0%|Medium||
+|1053|Previous Permutation With One Swap||50.8%|Medium||
+|1054|Distant Barcodes|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1054.Distant-Barcodes)|45.7%|Medium||
+|1055|Shortest Way to Form String||59.1%|Medium||
+|1056|Confusing Number||46.1%|Easy||
+|1057|Campus Bikes||57.7%|Medium||
+|1058|Minimize Rounding Error to Meet Target||44.9%|Medium||
+|1059|All Paths from Source Lead to Destination||40.5%|Medium||
+|1060|Missing Element in Sorted Array||54.6%|Medium||
+|1061|Lexicographically Smallest Equivalent String||70.4%|Medium||
+|1062|Longest Repeating Substring||59.1%|Medium||
+|1063|Number of Valid Subarrays||74.1%|Hard||
+|1064|Fixed Point||63.6%|Easy||
+|1065|Index Pairs of a String||63.0%|Easy||
+|1066|Campus Bikes II||54.5%|Medium||
+|1067|Digit Count in Range||44.6%|Hard||
+|1068|Product Sales Analysis I||80.4%|Easy||
+|1069|Product Sales Analysis II||82.0%|Easy||
+|1070|Product Sales Analysis III||49.2%|Medium||
+|1071|Greatest Common Divisor of Strings||51.0%|Easy||
+|1072|Flip Columns For Maximum Number of Equal Rows||63.1%|Medium||
+|1073|Adding Two Negabinary Numbers|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1073.Adding-Two-Negabinary-Numbers)|36.4%|Medium||
+|1074|Number of Submatrices That Sum to Target|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1074.Number-of-Submatrices-That-Sum-to-Target)|69.8%|Hard||
+|1075|Project Employees I||67.2%|Easy||
+|1076|Project Employees II||51.0%|Easy||
+|1077|Project Employees III||78.7%|Medium||
+|1078|Occurrences After Bigram|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1078.Occurrences-After-Bigram)|63.9%|Easy||
+|1079|Letter Tile Possibilities|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1079.Letter-Tile-Possibilities)|76.1%|Medium||
+|1080|Insufficient Nodes in Root to Leaf Paths||52.8%|Medium||
+|1081|Smallest Subsequence of Distinct Characters||57.6%|Medium||
+|1082|Sales Analysis I||75.4%|Easy||
+|1083|Sales Analysis II||50.5%|Easy||
+|1084|Sales Analysis III||52.2%|Easy||
+|1085|Sum of Digits in the Minimum Number||75.9%|Easy||
+|1086|High Five||75.2%|Easy||
+|1087|Brace Expansion||66.1%|Medium||
+|1088|Confusing Number II||46.5%|Hard||
+|1089|Duplicate Zeros|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1089.Duplicate-Zeros)|51.5%|Easy||
+|1090|Largest Values From Labels||60.9%|Medium||
+|1091|Shortest Path in Binary Matrix|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1091.Shortest-Path-in-Binary-Matrix)|44.5%|Medium||
+|1092|Shortest Common Supersequence||57.8%|Hard||
+|1093|Statistics from a Large Sample|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1093.Statistics-from-a-Large-Sample)|44.7%|Medium||
+|1094|Car Pooling||57.4%|Medium||
+|1095|Find in Mountain Array||35.8%|Hard||
+|1096|Brace Expansion II||63.5%|Hard||
+|1097|Game Play Analysis V||55.2%|Hard||
+|1098|Unpopular Books||45.2%|Medium||
+|1099|Two Sum Less Than K||60.4%|Easy||
+|1100|Find K-Length Substrings With No Repeated Characters||74.7%|Medium||
+|1101|The Earliest Moment When Everyone Become Friends||65.0%|Medium||
+|1102|Path With Maximum Minimum Value||53.3%|Medium||
+|1103|Distribute Candies to People||63.9%|Easy||
+|1104|Path In Zigzag Labelled Binary Tree|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1104.Path-In-Zigzag-Labelled-Binary-Tree)|74.9%|Medium||
+|1105|Filling Bookcase Shelves|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1105.Filling-Bookcase-Shelves)|58.9%|Medium||
+|1106|Parsing A Boolean Expression||58.5%|Hard||
+|1107|New Users Daily Count||45.9%|Medium||
+|1108|Defanging an IP Address|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1108.Defanging-an-IP-Address)|89.3%|Easy||
+|1109|Corporate Flight Bookings||60.3%|Medium||
+|1110|Delete Nodes And Return Forest|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1110.Delete-Nodes-And-Return-Forest)|69.4%|Medium||
+|1111|Maximum Nesting Depth of Two Valid Parentheses Strings|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1111.Maximum-Nesting-Depth-of-Two-Valid-Parentheses-Strings)|73.3%|Medium||
+|1112|Highest Grade For Each Student||73.8%|Medium||
+|1113|Reported Posts||66.1%|Easy||
+|1114|Print in Order||68.1%|Easy||
+|1115|Print FooBar Alternately||61.7%|Medium||
+|1116|Print Zero Even Odd||60.1%|Medium||
+|1117|Building H2O||55.7%|Medium||
+|1118|Number of Days in a Month||56.7%|Easy||
+|1119|Remove Vowels from a String||90.7%|Easy||
+|1120|Maximum Average Subtree||65.5%|Medium||
+|1121|Divide Array Into Increasing Sequences||60.0%|Hard||
+|1122|Relative Sort Array|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1122.Relative-Sort-Array)|68.4%|Easy||
+|1123|Lowest Common Ancestor of Deepest Leaves|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1123.Lowest-Common-Ancestor-of-Deepest-Leaves)|70.6%|Medium||
+|1124|Longest Well-Performing Interval||34.6%|Medium||
+|1125|Smallest Sufficient Team||47.1%|Hard||
+|1126|Active Businesses||67.9%|Medium||
+|1127|User Purchase Platform||51.2%|Hard||
+|1128|Number of Equivalent Domino Pairs|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1128.Number-of-Equivalent-Domino-Pairs)|46.9%|Easy||
+|1129|Shortest Path with Alternating Colors||42.9%|Medium||
+|1130|Minimum Cost Tree From Leaf Values||68.5%|Medium||
+|1131|Maximum of Absolute Value Expression||49.5%|Medium||
+|1132|Reported Posts II||33.6%|Medium||
+|1133|Largest Unique Number||67.5%|Easy||
+|1134|Armstrong Number||78.1%|Easy||
+|1135|Connecting Cities With Minimum Cost||61.1%|Medium||
+|1136|Parallel Courses||62.0%|Medium||
+|1137|N-th Tribonacci Number|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1137.N-th-Tribonacci-Number)|63.3%|Easy||
+|1138|Alphabet Board Path||52.3%|Medium||
+|1139|Largest 1-Bordered Square||50.0%|Medium||
+|1140|Stone Game II||64.9%|Medium||
+|1141|User Activity for the Past 30 Days I||50.2%|Easy||
+|1142|User Activity for the Past 30 Days II||36.0%|Easy||
+|1143|Longest Common Subsequence|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1143.Longest-Common-Subsequence)|58.8%|Medium||
+|1144|Decrease Elements To Make Array Zigzag||47.0%|Medium||
+|1145|Binary Tree Coloring Game|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1145.Binary-Tree-Coloring-Game)|51.4%|Medium||
+|1146|Snapshot Array||37.3%|Medium||
+|1147|Longest Chunked Palindrome Decomposition||60.0%|Hard||
+|1148|Article Views I||77.0%|Easy||
+|1149|Article Views II||47.6%|Medium||
+|1150|Check If a Number Is Majority Element in a Sorted Array||56.8%|Easy||
+|1151|Minimum Swaps to Group All 1's Together||60.9%|Medium||
+|1152|Analyze User Website Visit Pattern||43.4%|Medium||
+|1153|String Transforms Into Another String||35.3%|Hard||
+|1154|Day of the Year|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1154.Day-of-the-Year)|50.3%|Easy||
+|1155|Number of Dice Rolls With Target Sum||53.6%|Medium||
+|1156|Swap For Longest Repeated Character Substring||45.5%|Medium||
+|1157|Online Majority Element In Subarray|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1157.Online-Majority-Element-In-Subarray)|42.0%|Hard||
+|1158|Market Analysis I||63.9%|Medium||
+|1159|Market Analysis II||58.7%|Hard||
+|1160|Find Words That Can Be Formed by Characters|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1160.Find-Words-That-Can-Be-Formed-by-Characters)|67.8%|Easy||
+|1161|Maximum Level Sum of a Binary Tree||66.2%|Medium||
+|1162|As Far from Land as Possible||48.5%|Medium||
+|1163|Last Substring in Lexicographical Order||35.1%|Hard||
+|1164|Product Price at a Given Date||68.4%|Medium||
+|1165|Single-Row Keyboard||85.7%|Easy||
+|1166|Design File System||61.8%|Medium||
+|1167|Minimum Cost to Connect Sticks||67.7%|Medium||
+|1168|Optimize Water Distribution in a Village||64.4%|Hard||
+|1169|Invalid Transactions||31.0%|Medium||
+|1170|Compare Strings by Frequency of the Smallest Character|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1170.Compare-Strings-by-Frequency-of-the-Smallest-Character)|61.3%|Medium||
+|1171|Remove Zero Sum Consecutive Nodes from Linked List|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1171.Remove-Zero-Sum-Consecutive-Nodes-from-Linked-List)|42.9%|Medium||
+|1172|Dinner Plate Stacks||33.7%|Hard||
+|1173|Immediate Food Delivery I||83.4%|Easy||
+|1174|Immediate Food Delivery II||63.9%|Medium||
+|1175|Prime Arrangements|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1175.Prime-Arrangements)|53.5%|Easy||
+|1176|Diet Plan Performance||52.4%|Easy||
+|1177|Can Make Palindrome from Substring||37.8%|Medium||
+|1178|Number of Valid Words for Each Puzzle|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1178.Number-of-Valid-Words-for-Each-Puzzle)|46.6%|Hard||
+|1179|Reformat Department Table||82.7%|Easy||
+|1180|Count Substrings with Only One Distinct Letter||78.9%|Easy||
+|1181|Before and After Puzzle||45.1%|Medium||
+|1182|Shortest Distance to Target Color||55.5%|Medium||
+|1183|Maximum Number of Ones||60.9%|Hard||
+|1184|Distance Between Bus Stops|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1184.Distance-Between-Bus-Stops)|54.1%|Easy||
+|1185|Day of the Week|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1185.Day-of-the-Week)|57.8%|Easy||
+|1186|Maximum Subarray Sum with One Deletion||41.2%|Medium||
+|1187|Make Array Strictly Increasing||45.3%|Hard||
+|1188|Design Bounded Blocking Queue||72.9%|Medium||
+|1189|Maximum Number of Balloons|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1189.Maximum-Number-of-Balloons)|62.2%|Easy||
+|1190|Reverse Substrings Between Each Pair of Parentheses|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1190.Reverse-Substrings-Between-Each-Pair-of-Parentheses)|65.9%|Medium||
+|1191|K-Concatenation Maximum Sum||24.0%|Medium||
+|1192|Critical Connections in a Network||54.5%|Hard||
+|1193|Monthly Transactions I||67.2%|Medium||
+|1194|Tournament Winners||51.7%|Hard||
+|1195|Fizz Buzz Multithreaded||72.5%|Medium||
+|1196|How Many Apples Can You Put into the Basket||67.0%|Easy||
+|1197|Minimum Knight Moves||39.8%|Medium||
+|1198|Find Smallest Common Element in All Rows||76.0%|Medium||
+|1199|Minimum Time to Build Blocks||40.7%|Hard||
+|1200|Minimum Absolute Difference|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1200.Minimum-Absolute-Difference)|69.8%|Easy||
+|1201|Ugly Number III|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1201.Ugly-Number-III)|28.5%|Medium||
+|1202|Smallest String With Swaps|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1202.Smallest-String-With-Swaps)|57.5%|Medium||
+|1203|Sort Items by Groups Respecting Dependencies|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1203.Sort-Items-by-Groups-Respecting-Dependencies)|50.6%|Hard||
+|1204|Last Person to Fit in the Bus||74.1%|Medium||
+|1205|Monthly Transactions II||43.8%|Medium||
+|1206|Design Skiplist||60.5%|Hard||
+|1207|Unique Number of Occurrences|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1207.Unique-Number-of-Occurrences)|70.9%|Easy||
+|1208|Get Equal Substrings Within Budget|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1208.Get-Equal-Substrings-Within-Budget)|47.6%|Medium||
+|1209|Remove All Adjacent Duplicates in String II|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1209.Remove-All-Adjacent-Duplicates-in-String-II)|56.0%|Medium||
+|1210|Minimum Moves to Reach Target with Rotations||48.9%|Hard||
+|1211|Queries Quality and Percentage||71.9%|Easy||
+|1212|Team Scores in Football Tournament||57.6%|Medium||
+|1213|Intersection of Three Sorted Arrays||80.0%|Easy||
+|1214|Two Sum BSTs||66.2%|Medium||
+|1215|Stepping Numbers||45.8%|Medium||
+|1216|Valid Palindrome III||50.1%|Hard||
+|1217|Minimum Cost to Move Chips to The Same Position|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1217.Minimum-Cost-to-Move-Chips-to-The-Same-Position)|72.2%|Easy||
+|1218|Longest Arithmetic Subsequence of Given Difference||51.8%|Medium||
+|1219|Path with Maximum Gold||64.4%|Medium||
+|1220|Count Vowels Permutation||60.7%|Hard||
+|1221|Split a String in Balanced Strings|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1221.Split-a-String-in-Balanced-Strings)|84.7%|Easy||
+|1222|Queens That Can Attack the King||71.7%|Medium||
+|1223|Dice Roll Simulation||48.4%|Hard||
+|1224|Maximum Equal Frequency||36.8%|Hard||
+|1225|Report Contiguous Dates||63.4%|Hard||
+|1226|The Dining Philosophers||56.6%|Medium||
+|1227|Airplane Seat Assignment Probability||64.9%|Medium||
+|1228|Missing Number In Arithmetic Progression||51.4%|Easy||
+|1229|Meeting Scheduler||55.4%|Medium||
+|1230|Toss Strange Coins||53.4%|Medium||
+|1231|Divide Chocolate||56.9%|Hard||
+|1232|Check If It Is a Straight Line|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1232.Check-If-It-Is-a-Straight-Line)|41.2%|Easy||
+|1233|Remove Sub-Folders from the Filesystem||65.4%|Medium||
+|1234|Replace the Substring for Balanced String|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1234.Replace-the-Substring-for-Balanced-String)|36.8%|Medium||
+|1235|Maximum Profit in Job Scheduling|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1235.Maximum-Profit-in-Job-Scheduling)|51.1%|Hard||
+|1236|Web Crawler||66.3%|Medium||
+|1237|Find Positive Integer Solution for a Given Equation||69.3%|Medium||
+|1238|Circular Permutation in Binary Representation||68.8%|Medium||
+|1239|Maximum Length of a Concatenated String with Unique Characters|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1239.Maximum-Length-of-a-Concatenated-String-with-Unique-Characters)|50.6%|Medium||
+|1240|Tiling a Rectangle with the Fewest Squares||54.0%|Hard||
+|1241|Number of Comments per Post||68.0%|Easy||
+|1242|Web Crawler Multithreaded||49.0%|Medium||
+|1243|Array Transformation||50.7%|Easy||
+|1244|Design A Leaderboard||68.8%|Medium||
+|1245|Tree Diameter||61.7%|Medium||
+|1246|Palindrome Removal||45.9%|Hard||
+|1247|Minimum Swaps to Make Strings Equal||63.7%|Medium||
+|1248|Count Number of Nice Subarrays||59.5%|Medium||
+|1249|Minimum Remove to Make Valid Parentheses|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1249.Minimum-Remove-to-Make-Valid-Parentheses)|65.6%|Medium||
+|1250|Check If It Is a Good Array||58.7%|Hard||
+|1251|Average Selling Price||83.2%|Easy||
+|1252|Cells with Odd Values in a Matrix|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1252.Cells-with-Odd-Values-in-a-Matrix)|78.6%|Easy||
+|1253|Reconstruct a 2-Row Binary Matrix||43.8%|Medium||
+|1254|Number of Closed Islands|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1254.Number-of-Closed-Islands)|64.2%|Medium||
+|1255|Maximum Score Words Formed by Letters||72.8%|Hard||
+|1256|Encode Number||69.9%|Medium||
+|1257|Smallest Common Region||64.1%|Medium||
+|1258|Synonymous Sentences||56.4%|Medium||
+|1259|Handshakes That Don't Cross||56.2%|Hard||
+|1260|Shift 2D Grid|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1260.Shift-2D-Grid)|68.0%|Easy||
+|1261|Find Elements in a Contaminated Binary Tree||76.1%|Medium||
+|1262|Greatest Sum Divisible by Three||50.9%|Medium||
+|1263|Minimum Moves to Move a Box to Their Target Location||49.0%|Hard||
+|1264|Page Recommendations||67.8%|Medium||
+|1265|Print Immutable Linked List in Reverse||94.3%|Medium||
+|1266|Minimum Time Visiting All Points|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1266.Minimum-Time-Visiting-All-Points)|79.1%|Easy||
+|1267|Count Servers that Communicate||59.1%|Medium||
+|1268|Search Suggestions System|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1268.Search-Suggestions-System)|66.7%|Medium||
+|1269|Number of Ways to Stay in the Same Place After Some Steps||43.6%|Hard||
+|1270|All People Report to the Given Manager||88.0%|Medium||
+|1271|Hexspeak||57.0%|Easy||
+|1272|Remove Interval||63.3%|Medium||
+|1273|Delete Tree Nodes||61.2%|Medium||
+|1274|Number of Ships in a Rectangle||69.3%|Hard||
+|1275|Find Winner on a Tic Tac Toe Game|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1275.Find-Winner-on-a-Tic-Tac-Toe-Game)|54.3%|Easy||
+|1276|Number of Burgers with No Waste of Ingredients||50.6%|Medium||
+|1277|Count Square Submatrices with All Ones||74.4%|Medium||
+|1278|Palindrome Partitioning III||60.8%|Hard||
+|1279|Traffic Light Controlled Intersection||74.5%|Easy||
+|1280|Students and Examinations||74.5%|Easy||
+|1281|Subtract the Product and Sum of Digits of an Integer|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1281.Subtract-the-Product-and-Sum-of-Digits-of-an-Integer)|86.7%|Easy||
+|1282|Group the People Given the Group Size They Belong To||85.7%|Medium||
+|1283|Find the Smallest Divisor Given a Threshold|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1283.Find-the-Smallest-Divisor-Given-a-Threshold)|55.3%|Medium||
+|1284|Minimum Number of Flips to Convert Binary Matrix to Zero Matrix||72.1%|Hard||
+|1285|Find the Start and End Number of Continuous Ranges||88.2%|Medium||
+|1286|Iterator for Combination||73.5%|Medium||
+|1287|Element Appearing More Than 25% In Sorted Array|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1287.Element-Appearing-More-Than-25-In-Sorted-Array)|59.5%|Easy||
+|1288|Remove Covered Intervals||57.3%|Medium||
+|1289|Minimum Falling Path Sum II||59.6%|Hard||
+|1290|Convert Binary Number in a Linked List to Integer|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1290.Convert-Binary-Number-in-a-Linked-List-to-Integer)|82.6%|Easy||
+|1291|Sequential Digits||61.2%|Medium||
+|1292|Maximum Side Length of a Square with Sum Less than or Equal to Threshold||53.1%|Medium||
+|1293|Shortest Path in a Grid with Obstacles Elimination|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1293.Shortest-Path-in-a-Grid-with-Obstacles-Elimination)|43.6%|Hard||
+|1294|Weather Type in Each Country||67.9%|Easy||
+|1295|Find Numbers with Even Number of Digits|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1295.Find-Numbers-with-Even-Number-of-Digits)|76.9%|Easy||
+|1296|Divide Array in Sets of K Consecutive Numbers|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1296.Divide-Array-in-Sets-of-K-Consecutive-Numbers)|56.6%|Medium||
+|1297|Maximum Number of Occurrences of a Substring||52.1%|Medium||
+|1298|Maximum Candies You Can Get from Boxes||61.1%|Hard||
+|1299|Replace Elements with Greatest Element on Right Side|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1299.Replace-Elements-with-Greatest-Element-on-Right-Side)|74.7%|Easy||
+|1300|Sum of Mutated Array Closest to Target|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1300.Sum-of-Mutated-Array-Closest-to-Target)|43.1%|Medium||
+|1301|Number of Paths with Max Score||38.7%|Hard||
+|1302|Deepest Leaves Sum|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1302.Deepest-Leaves-Sum)|87.0%|Medium||
+|1303|Find the Team Size||90.8%|Easy||
+|1304|Find N Unique Integers Sum up to Zero|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1304.Find-N-Unique-Integers-Sum-up-to-Zero)|77.1%|Easy||
+|1305|All Elements in Two Binary Search Trees|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1305.All-Elements-in-Two-Binary-Search-Trees)|79.8%|Medium||
+|1306|Jump Game III|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1306.Jump-Game-III)|63.0%|Medium||
+|1307|Verbal Arithmetic Puzzle||34.5%|Hard||
+|1308|Running Total for Different Genders||88.3%|Medium||
+|1309|Decrypt String from Alphabet to Integer Mapping||79.4%|Easy||
+|1310|XOR Queries of a Subarray|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1310.XOR-Queries-of-a-Subarray)|72.1%|Medium||
+|1311|Get Watched Videos by Your Friends||45.9%|Medium||
+|1312|Minimum Insertion Steps to Make a String Palindrome||65.5%|Hard||
+|1313|Decompress Run-Length Encoded List|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1313.Decompress-Run-Length-Encoded-List)|85.9%|Easy||
+|1314|Matrix Block Sum||75.4%|Medium||
+|1315|Sum of Nodes with Even-Valued Grandparent||85.6%|Medium||
+|1316|Distinct Echo Substrings||49.8%|Hard||
+|1317|Convert Integer to the Sum of Two No-Zero Integers|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1317.Convert-Integer-to-the-Sum-of-Two-No-Zero-Integers)|56.2%|Easy||
+|1318|Minimum Flips to Make a OR b Equal to c||66.0%|Medium||
+|1319|Number of Operations to Make Network Connected|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1319.Number-of-Operations-to-Make-Network-Connected)|58.3%|Medium||
+|1320|Minimum Distance to Type a Word Using Two Fingers||59.8%|Hard||
+|1321|Restaurant Growth||72.2%|Medium||
+|1322|Ads Performance||60.9%|Easy||
+|1323|Maximum 69 Number||79.1%|Easy||
+|1324|Print Words Vertically||60.0%|Medium||
+|1325|Delete Leaves With a Given Value||74.8%|Medium||
+|1326|Minimum Number of Taps to Open to Water a Garden||47.8%|Hard||
+|1327|List the Products Ordered in a Period||77.1%|Easy||
+|1328|Break a Palindrome||53.4%|Medium||
+|1329|Sort the Matrix Diagonally|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1329.Sort-the-Matrix-Diagonally)|83.6%|Medium||
+|1330|Reverse Subarray To Maximize Array Value||39.9%|Hard||
+|1331|Rank Transform of an Array||59.0%|Easy||
+|1332|Remove Palindromic Subsequences|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1332.Remove-Palindromic-Subsequences)|76.1%|Easy||
+|1333|Filter Restaurants by Vegan-Friendly, Price and Distance||59.4%|Medium||
+|1334|Find the City With the Smallest Number of Neighbors at a Threshold Distance||52.9%|Medium||
+|1335|Minimum Difficulty of a Job Schedule||58.8%|Hard||
+|1336|Number of Transactions per Visit||51.4%|Hard||
+|1337|The K Weakest Rows in a Matrix|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1337.The-K-Weakest-Rows-in-a-Matrix)|73.1%|Easy||
+|1338|Reduce Array Size to The Half||69.8%|Medium||
+|1339|Maximum Product of Splitted Binary Tree||43.3%|Medium||
+|1340|Jump Game V||62.6%|Hard||
+|1341|Movie Rating||58.6%|Medium||
+|1342|Number of Steps to Reduce a Number to Zero||85.6%|Easy||
+|1343|Number of Sub-arrays of Size K and Average Greater than or Equal to Threshold||67.7%|Medium||
+|1344|Angle Between Hands of a Clock||63.4%|Medium||
+|1345|Jump Game IV||44.1%|Hard||
+|1346|Check If N and Its Double Exist||36.1%|Easy||
+|1347|Minimum Number of Steps to Make Two Strings Anagram||77.2%|Medium||
+|1348|Tweet Counts Per Frequency||43.5%|Medium||
+|1349|Maximum Students Taking Exam||48.0%|Hard||
+|1350|Students With Invalid Departments||90.5%|Easy||
+|1351|Count Negative Numbers in a Sorted Matrix||75.3%|Easy||
+|1352|Product of the Last K Numbers||49.4%|Medium||
+|1353|Maximum Number of Events That Can Be Attended|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1353.Maximum-Number-of-Events-That-Can-Be-Attended)|32.9%|Medium||
+|1354|Construct Target Array With Multiple Sums||36.3%|Hard||
+|1355|Activity Participants||74.4%|Medium||
+|1356|Sort Integers by The Number of 1 Bits||72.0%|Easy||
+|1357|Apply Discount Every n Orders||69.9%|Medium||
+|1358|Number of Substrings Containing All Three Characters||62.9%|Medium||
+|1359|Count All Valid Pickup and Delivery Options||63.0%|Hard||
+|1360|Number of Days Between Two Dates||47.5%|Easy||
+|1361|Validate Binary Tree Nodes||40.4%|Medium||
+|1362|Closest Divisors||59.8%|Medium||
+|1363|Largest Multiple of Three||33.5%|Hard||
+|1364|Number of Trusted Contacts of a Customer||79.0%|Medium||
+|1365|How Many Numbers Are Smaller Than the Current Number||86.6%|Easy||
+|1366|Rank Teams by Votes||58.6%|Medium||
+|1367|Linked List in Binary Tree||43.4%|Medium||
+|1368|Minimum Cost to Make at Least One Valid Path in a Grid||61.3%|Hard||
+|1369|Get the Second Most Recent Activity||69.6%|Hard||
+|1370|Increasing Decreasing String||77.5%|Easy||
+|1371|Find the Longest Substring Containing Vowels in Even Counts||63.0%|Medium||
+|1372|Longest ZigZag Path in a Binary Tree||59.6%|Medium||
+|1373|Maximum Sum BST in Binary Tree||39.2%|Hard||
+|1374|Generate a String With Characters That Have Odd Counts||77.5%|Easy||
+|1375|Number of Times Binary String Is Prefix-Aligned||65.9%|Medium||
+|1376|Time Needed to Inform All Employees||58.4%|Medium||
+|1377|Frog Position After T Seconds||36.1%|Hard||
+|1378|Replace Employee ID With The Unique Identifier||91.4%|Easy||
+|1379|Find a Corresponding Node of a Binary Tree in a Clone of That Tree||87.1%|Easy||
+|1380|Lucky Numbers in a Matrix|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1380.Lucky-Numbers-in-a-Matrix)|70.5%|Easy||
+|1381|Design a Stack With Increment Operation||77.4%|Medium||
+|1382|Balance a Binary Search Tree||80.7%|Medium||
+|1383|Maximum Performance of a Team|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1383.Maximum-Performance-of-a-Team)|49.0%|Hard||
+|1384|Total Sales Amount by Year||67.6%|Hard||
+|1385|Find the Distance Value Between Two Arrays|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1385.Find-the-Distance-Value-Between-Two-Arrays)|65.3%|Easy||
+|1386|Cinema Seat Allocation||40.9%|Medium||
+|1387|Sort Integers by The Power Value||69.9%|Medium||
+|1388|Pizza With 3n Slices||50.1%|Hard||
+|1389|Create Target Array in the Given Order|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1389.Create-Target-Array-in-the-Given-Order)|85.8%|Easy||
+|1390|Four Divisors||41.2%|Medium||
+|1391|Check if There is a Valid Path in a Grid||47.0%|Medium||
+|1392|Longest Happy Prefix||45.0%|Hard||
+|1393|Capital Gain/Loss||91.1%|Medium||
+|1394|Find Lucky Integer in an Array||63.5%|Easy||
+|1395|Count Number of Teams||68.3%|Medium||
+|1396|Design Underground System|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1396.Design-Underground-System)|73.7%|Medium||
+|1397|Find All Good Strings||42.1%|Hard||
+|1398|Customers Who Bought Products A and B but Not C||77.7%|Medium||
+|1399|Count Largest Group||67.2%|Easy||
+|1400|Construct K Palindrome Strings||63.3%|Medium||
+|1401|Circle and Rectangle Overlapping||44.2%|Medium||
+|1402|Reducing Dishes||72.0%|Hard||
+|1403|Minimum Subsequence in Non-Increasing Order||72.2%|Easy||
+|1404|Number of Steps to Reduce a Number in Binary Representation to One||52.0%|Medium||
+|1405|Longest Happy String||57.4%|Medium||
+|1406|Stone Game III||59.7%|Hard||
+|1407|Top Travellers||68.7%|Easy||
+|1408|String Matching in an Array||63.9%|Easy||
+|1409|Queries on a Permutation With Key||83.3%|Medium||
+|1410|HTML Entity Parser||52.1%|Medium||
+|1411|Number of Ways to Paint N × 3 Grid||62.3%|Hard||
+|1412|Find the Quiet Students in All Exams||63.0%|Hard||
+|1413|Minimum Value to Get Positive Step by Step Sum||68.4%|Easy||
+|1414|Find the Minimum Number of Fibonacci Numbers Whose Sum Is K||65.4%|Medium||
+|1415|The k-th Lexicographical String of All Happy Strings of Length n||72.0%|Medium||
+|1416|Restore The Array||38.4%|Hard||
+|1417|Reformat The String||55.8%|Easy||
+|1418|Display Table of Food Orders in a Restaurant||73.7%|Medium||
+|1419|Minimum Number of Frogs Croaking||49.9%|Medium||
+|1420|Build Array Where You Can Find The Maximum Exactly K Comparisons||63.6%|Hard||
+|1421|NPV Queries||84.1%|Easy||
+|1422|Maximum Score After Splitting a String||57.8%|Easy||
+|1423|Maximum Points You Can Obtain from Cards|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1423.Maximum-Points-You-Can-Obtain-from-Cards)|52.3%|Medium||
+|1424|Diagonal Traverse II||50.3%|Medium||
+|1425|Constrained Subsequence Sum||47.4%|Hard||
+|1426|Counting Elements||59.5%|Easy||
+|1427|Perform String Shifts||54.2%|Easy||
+|1428|Leftmost Column with at Least a One||53.0%|Medium||
+|1429|First Unique Number||52.7%|Medium||
+|1430|Check If a String Is a Valid Sequence from Root to Leaves Path in a Binary Tree||46.1%|Medium||
+|1431|Kids With the Greatest Number of Candies||87.5%|Easy||
+|1432|Max Difference You Can Get From Changing an Integer||43.0%|Medium||
+|1433|Check If a String Can Break Another String||68.8%|Medium||
+|1434|Number of Ways to Wear Different Hats to Each Other||42.8%|Hard||
+|1435|Create a Session Bar Chart||78.3%|Easy||
+|1436|Destination City||77.6%|Easy||
+|1437|Check If All 1's Are at Least Length K Places Away|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1437.Check-If-All-1s-Are-at-Least-Length-K-Places-Away)|59.2%|Easy||
+|1438|Longest Continuous Subarray With Absolute Diff Less Than or Equal to Limit|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1438.Longest-Continuous-Subarray-With-Absolute-Diff-Less-Than-or-Equal-to-Limit)|48.0%|Medium||
+|1439|Find the Kth Smallest Sum of a Matrix With Sorted Rows|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1439.Find-the-Kth-Smallest-Sum-of-a-Matrix-With-Sorted-Rows)|61.4%|Hard||
+|1440|Evaluate Boolean Expression||76.5%|Medium||
+|1441|Build an Array With Stack Operations||71.3%|Medium||
+|1442|Count Triplets That Can Form Two Arrays of Equal XOR|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1442.Count-Triplets-That-Can-Form-Two-Arrays-of-Equal-XOR)|75.6%|Medium||
+|1443|Minimum Time to Collect All Apples in a Tree||56.0%|Medium||
+|1444|Number of Ways of Cutting a Pizza||58.6%|Hard||
+|1445|Apples & Oranges||91.3%|Medium||
+|1446|Consecutive Characters|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1446.Consecutive-Characters)|61.7%|Easy||
+|1447|Simplified Fractions||64.6%|Medium||
+|1448|Count Good Nodes in Binary Tree||74.6%|Medium||
+|1449|Form Largest Integer With Digits That Add up to Target||47.1%|Hard||
+|1450|Number of Students Doing Homework at a Given Time||75.9%|Easy||
+|1451|Rearrange Words in a Sentence||62.5%|Medium||
+|1452|People Whose List of Favorite Companies Is Not a Subset of Another List||56.8%|Medium||
+|1453|Maximum Number of Darts Inside of a Circular Dartboard||36.8%|Hard||
+|1454|Active Users||38.4%|Medium||
+|1455|Check If a Word Occurs As a Prefix of Any Word in a Sentence|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1455.Check-If-a-Word-Occurs-As-a-Prefix-of-Any-Word-in-a-Sentence)|64.2%|Easy||
+|1456|Maximum Number of Vowels in a Substring of Given Length||57.9%|Medium||
+|1457|Pseudo-Palindromic Paths in a Binary Tree||68.1%|Medium||
+|1458|Max Dot Product of Two Subsequences||46.2%|Hard||
+|1459|Rectangles Area||70.0%|Medium||
+|1460|Make Two Arrays Equal by Reversing Subarrays||72.2%|Easy||
+|1461|Check If a String Contains All Binary Codes of Size K|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1461.Check-If-a-String-Contains-All-Binary-Codes-of-Size-K)|56.8%|Medium||
+|1462|Course Schedule IV||48.9%|Medium||
+|1463|Cherry Pickup II|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1463.Cherry-Pickup-II)|70.2%|Hard||
+|1464|Maximum Product of Two Elements in an Array|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1464.Maximum-Product-of-Two-Elements-in-an-Array)|79.2%|Easy||
+|1465|Maximum Area of a Piece of Cake After Horizontal and Vertical Cuts|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1465.Maximum-Area-of-a-Piece-of-Cake-After-Horizontal-and-Vertical-Cuts)|40.8%|Medium||
+|1466|Reorder Routes to Make All Paths Lead to the City Zero||61.8%|Medium||
+|1467|Probability of a Two Boxes Having The Same Number of Distinct Balls||60.8%|Hard||
+|1468|Calculate Salaries||81.9%|Medium||
+|1469|Find All The Lonely Nodes||81.7%|Easy||
+|1470|Shuffle the Array|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1470.Shuffle-the-Array)|88.5%|Easy||
+|1471|The k Strongest Values in an Array||60.1%|Medium||
+|1472|Design Browser History||76.1%|Medium||
+|1473|Paint House III||62.0%|Hard||
+|1474|Delete N Nodes After M Nodes of a Linked List||73.8%|Easy||
+|1475|Final Prices With a Special Discount in a Shop||75.4%|Easy||
+|1476|Subrectangle Queries||88.5%|Medium||
+|1477|Find Two Non-overlapping Sub-arrays Each With Target Sum||37.0%|Medium||
+|1478|Allocate Mailboxes||55.3%|Hard||
+|1479|Sales by Day of the Week||82.4%|Hard||
+|1480|Running Sum of 1d Array|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1480.Running-Sum-of-1d-Array)|89.8%|Easy||
+|1481|Least Number of Unique Integers after K Removals||57.2%|Medium||
+|1482|Minimum Number of Days to Make m Bouquets|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1482.Minimum-Number-of-Days-to-Make-m-Bouquets)|56.7%|Medium||
+|1483|Kth Ancestor of a Tree Node||33.8%|Hard||
+|1484|Group Sold Products By The Date||84.1%|Easy||
+|1485|Clone Binary Tree With Random Pointer||79.5%|Medium||
+|1486|XOR Operation in an Array|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1486.XOR-Operation-in-an-Array)|84.2%|Easy||
+|1487|Making File Names Unique||35.6%|Medium||
+|1488|Avoid Flood in The City||26.1%|Medium||
+|1489|Find Critical and Pseudo-Critical Edges in Minimum Spanning Tree||53.4%|Hard||
+|1490|Clone N-ary Tree||83.6%|Medium||
+|1491|Average Salary Excluding the Minimum and Maximum Salary||63.1%|Easy||
+|1492|The kth Factor of n||62.3%|Medium||
+|1493|Longest Subarray of 1's After Deleting One Element||60.1%|Medium||
+|1494|Parallel Courses II||31.1%|Hard||
+|1495|Friendly Movies Streamed Last Month||49.8%|Easy||
+|1496|Path Crossing||55.8%|Easy||
+|1497|Check If Array Pairs Are Divisible by k||39.8%|Medium||
+|1498|Number of Subsequences That Satisfy the Given Sum Condition||38.4%|Medium||
+|1499|Max Value of Equation||46.5%|Hard||
+|1500|Design a File Sharing System||44.9%|Medium||
+|1501|Countries You Can Safely Invest In||58.3%|Medium||
+|1502|Can Make Arithmetic Progression From Sequence||68.3%|Easy||
+|1503|Last Moment Before All Ants Fall Out of a Plank||55.2%|Medium||
+|1504|Count Submatrices With All Ones||57.9%|Medium||
+|1505|Minimum Possible Integer After at Most K Adjacent Swaps On Digits||38.1%|Hard||
+|1506|Find Root of N-Ary Tree||78.1%|Medium||
+|1507|Reformat Date||62.4%|Easy||
+|1508|Range Sum of Sorted Subarray Sums||59.4%|Medium||
+|1509|Minimum Difference Between Largest and Smallest Value in Three Moves||54.6%|Medium||
+|1510|Stone Game IV||60.6%|Hard||
+|1511|Customer Order Frequency||73.1%|Easy||
+|1512|Number of Good Pairs|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1512.Number-of-Good-Pairs)|88.2%|Easy||
+|1513|Number of Substrings With Only 1s||45.2%|Medium||
+|1514|Path with Maximum Probability||48.3%|Medium||
+|1515|Best Position for a Service Centre||38.4%|Hard||
+|1516|Move Sub-Tree of N-Ary Tree||63.9%|Hard||
+|1517|Find Users With Valid E-Mails||57.1%|Easy||
+|1518|Water Bottles|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1518.Water-Bottles)|60.3%|Easy||
+|1519|Number of Nodes in the Sub-Tree With the Same Label||40.9%|Medium||
+|1520|Maximum Number of Non-Overlapping Substrings||37.9%|Hard||
+|1521|Find a Value of a Mysterious Function Closest to Target||43.6%|Hard||
+|1522|Diameter of N-Ary Tree||73.4%|Medium||
+|1523|Count Odd Numbers in an Interval Range||46.4%|Easy||
+|1524|Number of Sub-arrays With Odd Sum||43.6%|Medium||
+|1525|Number of Good Ways to Split a String||69.5%|Medium||
+|1526|Minimum Number of Increments on Subarrays to Form a Target Array||68.6%|Hard||
+|1527|Patients With a Condition||42.9%|Easy||
+|1528|Shuffle String||85.7%|Easy||
+|1529|Minimum Suffix Flips||72.5%|Medium||
+|1530|Number of Good Leaf Nodes Pairs||60.5%|Medium||
+|1531|String Compression II||50.2%|Hard||
+|1532|The Most Recent Three Orders||71.1%|Medium||
+|1533|Find the Index of the Large Integer||50.7%|Medium||
+|1534|Count Good Triplets||80.8%|Easy||
+|1535|Find the Winner of an Array Game||48.8%|Medium||
+|1536|Minimum Swaps to Arrange a Binary Grid||46.4%|Medium||
+|1537|Get the Maximum Score||39.3%|Hard||
+|1538|Guess the Majority in a Hidden Array||63.0%|Medium||
+|1539|Kth Missing Positive Number|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1539.Kth-Missing-Positive-Number)|55.9%|Easy||
+|1540|Can Convert String in K Moves||33.1%|Medium||
+|1541|Minimum Insertions to Balance a Parentheses String||49.9%|Medium||
+|1542|Find Longest Awesome Substring||41.6%|Hard||
+|1543|Fix Product Name Format||62.4%|Easy||
+|1544|Make The String Great||57.0%|Easy||
+|1545|Find Kth Bit in Nth Binary String||58.2%|Medium||
+|1546|Maximum Number of Non-Overlapping Subarrays With Sum Equals Target||47.2%|Medium||
+|1547|Minimum Cost to Cut a Stick||56.8%|Hard||
+|1548|The Most Similar Path in a Graph||56.9%|Hard||
+|1549|The Most Recent Orders for Each Product||67.9%|Medium||
+|1550|Three Consecutive Odds||63.7%|Easy||
+|1551|Minimum Operations to Make Array Equal|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1551.Minimum-Operations-to-Make-Array-Equal)|81.1%|Medium||
+|1552|Magnetic Force Between Two Balls||56.8%|Medium||
+|1553|Minimum Number of Days to Eat N Oranges||34.4%|Hard||
+|1554|Strings Differ by One Character||43.6%|Medium||
+|1555|Bank Account Summary||53.0%|Medium||
+|1556|Thousand Separator||55.1%|Easy||
+|1557|Minimum Number of Vertices to Reach All Nodes||79.6%|Medium||
+|1558|Minimum Numbers of Function Calls to Make Target Array||64.3%|Medium||
+|1559|Detect Cycles in 2D Grid||48.1%|Medium||
+|1560|Most Visited Sector in a Circular Track||58.4%|Easy||
+|1561|Maximum Number of Coins You Can Get||78.6%|Medium||
+|1562|Find Latest Group of Size M||42.4%|Medium||
+|1563|Stone Game V||40.6%|Hard||
+|1564|Put Boxes Into the Warehouse I||67.1%|Medium||
+|1565|Unique Orders and Customers Per Month||83.6%|Easy||
+|1566|Detect Pattern of Length M Repeated K or More Times||43.6%|Easy||
+|1567|Maximum Length of Subarray With Positive Product||43.7%|Medium||
+|1568|Minimum Number of Days to Disconnect Island||47.1%|Hard||
+|1569|Number of Ways to Reorder Array to Get Same BST||48.2%|Hard||
+|1570|Dot Product of Two Sparse Vectors||90.4%|Medium||
+|1571|Warehouse Manager||90.1%|Easy||
+|1572|Matrix Diagonal Sum|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1572.Matrix-Diagonal-Sum)|79.7%|Easy||
+|1573|Number of Ways to Split a String|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1573.Number-of-Ways-to-Split-a-String)|32.4%|Medium||
+|1574|Shortest Subarray to be Removed to Make Array Sorted||36.5%|Medium||
+|1575|Count All Possible Routes||56.9%|Hard||
+|1576|Replace All ?'s to Avoid Consecutive Repeating Characters|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1576.Replace-All-s-to-Avoid-Consecutive-Repeating-Characters)|49.2%|Easy||
+|1577|Number of Ways Where Square of Number Is Equal to Product of Two Numbers||39.9%|Medium||
+|1578|Minimum Time to Make Rope Colorful||63.7%|Medium||
+|1579|Remove Max Number of Edges to Keep Graph Fully Traversable|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1579.Remove-Max-Number-of-Edges-to-Keep-Graph-Fully-Traversable)|52.7%|Hard||
+|1580|Put Boxes Into the Warehouse II||63.5%|Medium||
+|1581|Customer Who Visited but Did Not Make Any Transactions||89.0%|Easy||
+|1582|Special Positions in a Binary Matrix||65.3%|Easy||
+|1583|Count Unhappy Friends||59.8%|Medium||
+|1584|Min Cost to Connect All Points||64.3%|Medium||
+|1585|Check If String Is Transformable With Substring Sort Operations||48.4%|Hard||
+|1586|Binary Search Tree Iterator II||70.8%|Medium||
+|1587|Bank Account Summary II||90.2%|Easy||
+|1588|Sum of All Odd Length Subarrays||83.6%|Easy||
+|1589|Maximum Sum Obtained of Any Permutation||37.0%|Medium||
+|1590|Make Sum Divisible by P||28.1%|Medium||
+|1591|Strange Printer II||58.4%|Hard||
+|1592|Rearrange Spaces Between Words||43.8%|Easy||
+|1593|Split a String Into the Max Number of Unique Substrings||55.1%|Medium||
+|1594|Maximum Non Negative Product in a Matrix||33.1%|Medium||
+|1595|Minimum Cost to Connect Two Groups of Points||46.3%|Hard||
+|1596|The Most Frequently Ordered Products for Each Customer||85.1%|Medium||
+|1597|Build Binary Expression Tree From Infix Expression||62.2%|Hard||
+|1598|Crawler Log Folder||64.3%|Easy||
+|1599|Maximum Profit of Operating a Centennial Wheel||43.7%|Medium||
+|1600|Throne Inheritance|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1600.Throne-Inheritance)|63.6%|Medium||
+|1601|Maximum Number of Achievable Transfer Requests||51.3%|Hard||
+|1602|Find Nearest Right Node in Binary Tree||75.3%|Medium||
+|1603|Design Parking System|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1603.Design-Parking-System)|88.1%|Easy||
+|1604|Alert Using Same Key-Card Three or More Times in a One Hour Period||47.4%|Medium||
+|1605|Find Valid Matrix Given Row and Column Sums||78.1%|Medium||
+|1606|Find Servers That Handled Most Number of Requests||42.8%|Hard||
+|1607|Sellers With No Sales||55.3%|Easy||
+|1608|Special Array With X Elements Greater Than or Equal X|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1608.Special-Array-With-X-Elements-Greater-Than-or-Equal-X)|60.0%|Easy||
+|1609|Even Odd Tree|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1609.Even-Odd-Tree)|53.6%|Medium||
+|1610|Maximum Number of Visible Points||37.4%|Hard||
+|1611|Minimum One Bit Operations to Make Integers Zero||63.2%|Hard||
+|1612|Check If Two Expression Trees are Equivalent||69.9%|Medium||
+|1613|Find the Missing IDs||75.9%|Medium||
+|1614|Maximum Nesting Depth of the Parentheses|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1614.Maximum-Nesting-Depth-of-the-Parentheses)|82.7%|Easy||
+|1615|Maximal Network Rank||58.1%|Medium||
+|1616|Split Two Strings to Make Palindrome||31.3%|Medium||
+|1617|Count Subtrees With Max Distance Between Cities||65.9%|Hard||
+|1618|Maximum Font to Fit a Sentence in a Screen||59.1%|Medium||
+|1619|Mean of Array After Removing Some Elements|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1619.Mean-of-Array-After-Removing-Some-Elements)|64.6%|Easy||
+|1620|Coordinate With Maximum Network Quality||37.3%|Medium||
+|1621|Number of Sets of K Non-Overlapping Line Segments||42.3%|Medium||
+|1622|Fancy Sequence||16.1%|Hard||
+|1623|All Valid Triplets That Can Represent a Country||88.0%|Easy||
+|1624|Largest Substring Between Two Equal Characters|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1624.Largest-Substring-Between-Two-Equal-Characters)|59.0%|Easy||
+|1625|Lexicographically Smallest String After Applying Operations||66.0%|Medium||
+|1626|Best Team With No Conflicts||41.1%|Medium||
+|1627|Graph Connectivity With Threshold||45.5%|Hard||
+|1628|Design an Expression Tree With Evaluate Function||82.7%|Medium||
+|1629|Slowest Key|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1629.Slowest-Key)|59.4%|Easy||
+|1630|Arithmetic Subarrays||79.9%|Medium||
+|1631|Path With Minimum Effort|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1631.Path-With-Minimum-Effort)|55.3%|Medium||
+|1632|Rank Transform of a Matrix||41.0%|Hard||
+|1633|Percentage of Users Attended a Contest||68.8%|Easy||
+|1634|Add Two Polynomials Represented as Linked Lists||53.4%|Medium||
+|1635|Hopper Company Queries I||53.0%|Hard||
+|1636|Sort Array by Increasing Frequency|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1636.Sort-Array-by-Increasing-Frequency)|68.6%|Easy||
+|1637|Widest Vertical Area Between Two Points Containing No Points||84.2%|Medium||
+|1638|Count Substrings That Differ by One Character||71.5%|Medium||
+|1639|Number of Ways to Form a Target String Given a Dictionary||42.9%|Hard||
+|1640|Check Array Formation Through Concatenation|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1640.Check-Array-Formation-Through-Concatenation)|56.1%|Easy||
+|1641|Count Sorted Vowel Strings|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1641.Count-Sorted-Vowel-Strings)|77.3%|Medium||
+|1642|Furthest Building You Can Reach|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1642.Furthest-Building-You-Can-Reach)|48.3%|Medium||
+|1643|Kth Smallest Instructions||46.3%|Hard||
+|1644|Lowest Common Ancestor of a Binary Tree II||59.3%|Medium||
+|1645|Hopper Company Queries II||38.8%|Hard||
+|1646|Get Maximum in Generated Array|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1646.Get-Maximum-in-Generated-Array)|50.2%|Easy||
+|1647|Minimum Deletions to Make Character Frequencies Unique|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1647.Minimum-Deletions-to-Make-Character-Frequencies-Unique)|59.2%|Medium||
+|1648|Sell Diminishing-Valued Colored Balls|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1648.Sell-Diminishing-Valued-Colored-Balls)|30.6%|Medium||
+|1649|Create Sorted Array through Instructions|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1649.Create-Sorted-Array-through-Instructions)|37.2%|Hard||
+|1650|Lowest Common Ancestor of a Binary Tree III||77.3%|Medium||
+|1651|Hopper Company Queries III||68.0%|Hard||
+|1652|Defuse the Bomb|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1652.Defuse-the-Bomb)|61.1%|Easy||
+|1653|Minimum Deletions to Make String Balanced|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1653.Minimum-Deletions-to-Make-String-Balanced)|58.7%|Medium||
+|1654|Minimum Jumps to Reach Home|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1654.Minimum-Jumps-to-Reach-Home)|28.6%|Medium||
+|1655|Distribute Repeating Integers|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1655.Distribute-Repeating-Integers)|39.7%|Hard||
+|1656|Design an Ordered Stream|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1656.Design-an-Ordered-Stream)|85.3%|Easy||
+|1657|Determine if Two Strings Are Close|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1657.Determine-if-Two-Strings-Are-Close)|54.2%|Medium||
+|1658|Minimum Operations to Reduce X to Zero|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1658.Minimum-Operations-to-Reduce-X-to-Zero)|37.6%|Medium||
+|1659|Maximize Grid Happiness|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1659.Maximize-Grid-Happiness)|38.4%|Hard||
+|1660|Correct a Binary Tree||72.5%|Medium||
+|1661|Average Time of Process per Machine||79.4%|Easy||
+|1662|Check If Two String Arrays are Equivalent|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1662.Check-If-Two-String-Arrays-are-Equivalent)|81.8%|Easy||
+|1663|Smallest String With A Given Numeric Value|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1663.Smallest-String-With-A-Given-Numeric-Value)|67.0%|Medium||
+|1664|Ways to Make a Fair Array|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1664.Ways-to-Make-a-Fair-Array)|63.6%|Medium||
+|1665|Minimum Initial Energy to Finish Tasks|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1665.Minimum-Initial-Energy-to-Finish-Tasks)|56.2%|Hard||
+|1666|Change the Root of a Binary Tree||69.4%|Medium||
+|1667|Fix Names in a Table||66.8%|Easy||
+|1668|Maximum Repeating Substring|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1668.Maximum-Repeating-Substring)|39.6%|Easy||
+|1669|Merge In Between Linked Lists|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1669.Merge-In-Between-Linked-Lists)|74.5%|Medium||
+|1670|Design Front Middle Back Queue|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1670.Design-Front-Middle-Back-Queue)|56.4%|Medium||
+|1671|Minimum Number of Removals to Make Mountain Array||42.6%|Hard||
+|1672|Richest Customer Wealth|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1672.Richest-Customer-Wealth)|88.4%|Easy||
+|1673|Find the Most Competitive Subsequence|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1673.Find-the-Most-Competitive-Subsequence)|49.3%|Medium||
+|1674|Minimum Moves to Make Array Complementary|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1674.Minimum-Moves-to-Make-Array-Complementary)|38.5%|Medium||
+|1675|Minimize Deviation in Array|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1675.Minimize-Deviation-in-Array)|52.1%|Hard||
+|1676|Lowest Common Ancestor of a Binary Tree IV||79.3%|Medium||
+|1677|Product's Worth Over Invoices||39.4%|Easy||
+|1678|Goal Parser Interpretation|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1678.Goal-Parser-Interpretation)|86.0%|Easy||
+|1679|Max Number of K-Sum Pairs|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1679.Max-Number-of-K-Sum-Pairs)|57.4%|Medium||
+|1680|Concatenation of Consecutive Binary Numbers|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1680.Concatenation-of-Consecutive-Binary-Numbers)|57.0%|Medium||
+|1681|Minimum Incompatibility|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1681.Minimum-Incompatibility)|37.3%|Hard||
+|1682|Longest Palindromic Subsequence II||49.7%|Medium||
+|1683|Invalid Tweets||91.0%|Easy||
+|1684|Count the Number of Consistent Strings|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1684.Count-the-Number-of-Consistent-Strings)|81.8%|Easy||
+|1685|Sum of Absolute Differences in a Sorted Array|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1685.Sum-of-Absolute-Differences-in-a-Sorted-Array)|65.3%|Medium||
+|1686|Stone Game VI||54.3%|Medium||
+|1687|Delivering Boxes from Storage to Ports||38.2%|Hard||
+|1688|Count of Matches in Tournament|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1688.Count-of-Matches-in-Tournament)|83.1%|Easy||
+|1689|Partitioning Into Minimum Number Of Deci-Binary Numbers|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1689.Partitioning-Into-Minimum-Number-Of-Deci-Binary-Numbers)|89.7%|Medium||
+|1690|Stone Game VII|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1690.Stone-Game-VII)|58.7%|Medium||
+|1691|Maximum Height by Stacking Cuboids|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1691.Maximum-Height-by-Stacking-Cuboids)|54.2%|Hard||
+|1692|Count Ways to Distribute Candies||62.0%|Hard||
+|1693|Daily Leads and Partners||90.4%|Easy||
+|1694|Reformat Phone Number|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1694.Reformat-Phone-Number)|64.7%|Easy||
+|1695|Maximum Erasure Value|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1695.Maximum-Erasure-Value)|57.7%|Medium||
+|1696|Jump Game VI|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1696.Jump-Game-VI)|46.3%|Medium||
+|1697|Checking Existence of Edge Length Limited Paths||50.5%|Hard||
+|1698|Number of Distinct Substrings in a String||63.1%|Medium||
+|1699|Number of Calls Between Two Persons||85.8%|Medium||
+|1700|Number of Students Unable to Eat Lunch|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1700.Number-of-Students-Unable-to-Eat-Lunch)|67.7%|Easy||
+|1701|Average Waiting Time||62.3%|Medium||
+|1702|Maximum Binary String After Change||46.1%|Medium||
+|1703|Minimum Adjacent Swaps for K Consecutive Ones||41.3%|Hard||
+|1704|Determine if String Halves Are Alike|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1704.Determine-if-String-Halves-Are-Alike)|77.4%|Easy||
+|1705|Maximum Number of Eaten Apples|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1705.Maximum-Number-of-Eaten-Apples)|37.9%|Medium||
+|1706|Where Will the Ball Fall||65.8%|Medium||
+|1707|Maximum XOR With an Element From Array||44.3%|Hard||
+|1708|Largest Subarray Length K||63.5%|Easy||
+|1709|Biggest Window Between Visits||77.8%|Medium||
+|1710|Maximum Units on a Truck|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1710.Maximum-Units-on-a-Truck)|74.0%|Easy||
+|1711|Count Good Meals||29.0%|Medium||
+|1712|Ways to Split Array Into Three Subarrays||32.4%|Medium||
+|1713|Minimum Operations to Make a Subsequence||49.2%|Hard||
+|1714|Sum Of Special Evenly-Spaced Elements In Array||49.8%|Hard||
+|1715|Count Apples and Oranges||77.8%|Medium||
+|1716|Calculate Money in Leetcode Bank|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1716.Calculate-Money-in-Leetcode-Bank)|65.0%|Easy||
+|1717|Maximum Score From Removing Substrings||46.0%|Medium||
+|1718|Construct the Lexicographically Largest Valid Sequence||51.7%|Medium||
+|1719|Number Of Ways To Reconstruct A Tree||42.5%|Hard||
+|1720|Decode XORed Array|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1720.Decode-XORed-Array)|86.0%|Easy||
+|1721|Swapping Nodes in a Linked List|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1721.Swapping-Nodes-in-a-Linked-List)|67.8%|Medium||
+|1722|Minimize Hamming Distance After Swap Operations||48.6%|Medium||
+|1723|Find Minimum Time to Finish All Jobs||42.7%|Hard||
+|1724|Checking Existence of Edge Length Limited Paths II||51.3%|Hard||
+|1725|Number Of Rectangles That Can Form The Largest Square|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1725.Number-Of-Rectangles-That-Can-Form-The-Largest-Square)|78.7%|Easy||
+|1726|Tuple with Same Product||60.7%|Medium||
+|1727|Largest Submatrix With Rearrangements||60.8%|Medium||
+|1728|Cat and Mouse II||40.5%|Hard||
+|1729|Find Followers Count||71.6%|Easy||
+|1730|Shortest Path to Get Food||54.0%|Medium||
+|1731|The Number of Employees Which Report to Each Employee||51.1%|Easy||
+|1732|Find the Highest Altitude|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1732.Find-the-Highest-Altitude)|78.7%|Easy||
+|1733|Minimum Number of People to Teach||41.6%|Medium||
+|1734|Decode XORed Permutation|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1734.Decode-XORed-Permutation)|62.2%|Medium||
+|1735|Count Ways to Make Array With Product||49.2%|Hard||
+|1736|Latest Time by Replacing Hidden Digits|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1736.Latest-Time-by-Replacing-Hidden-Digits)|42.2%|Easy||
+|1737|Change Minimum Characters to Satisfy One of Three Conditions||35.2%|Medium||
+|1738|Find Kth Largest XOR Coordinate Value|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1738.Find-Kth-Largest-XOR-Coordinate-Value)|61.6%|Medium||
+|1739|Building Boxes||51.7%|Hard||
+|1740|Find Distance in a Binary Tree||68.7%|Medium||
+|1741|Find Total Time Spent by Each Employee||92.0%|Easy||
+|1742|Maximum Number of Balls in a Box|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1742.Maximum-Number-of-Balls-in-a-Box)|73.9%|Easy||
+|1743|Restore the Array From Adjacent Pairs||68.7%|Medium||
+|1744|Can You Eat Your Favorite Candy on Your Favorite Day?|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1744.Can-You-Eat-Your-Favorite-Candy-on-Your-Favorite-Day)|32.8%|Medium||
+|1745|Palindrome Partitioning IV||46.3%|Hard||
+|1746|Maximum Subarray Sum After One Operation||62.2%|Medium||
+|1747|Leetflex Banned Accounts||68.2%|Medium||
+|1748|Sum of Unique Elements|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1748.Sum-of-Unique-Elements)|75.6%|Easy||
+|1749|Maximum Absolute Sum of Any Subarray||58.2%|Medium||
+|1750|Minimum Length of String After Deleting Similar Ends||43.6%|Medium||
+|1751|Maximum Number of Events That Can Be Attended II||55.8%|Hard||
+|1752|Check if Array Is Sorted and Rotated|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1752.Check-if-Array-Is-Sorted-and-Rotated)|49.2%|Easy||
+|1753|Maximum Score From Removing Stones||66.1%|Medium||
+|1754|Largest Merge Of Two Strings||45.0%|Medium||
+|1755|Closest Subsequence Sum||36.6%|Hard||
+|1756|Design Most Recently Used Queue||79.0%|Medium||
+|1757|Recyclable and Low Fat Products||93.9%|Easy||
+|1758|Minimum Changes To Make Alternating Binary String|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1758.Minimum-Changes-To-Make-Alternating-Binary-String)|58.3%|Easy||
+|1759|Count Number of Homogenous Substrings||47.8%|Medium||
+|1760|Minimum Limit of Balls in a Bag||60.3%|Medium||
+|1761|Minimum Degree of a Connected Trio in a Graph||41.7%|Hard||
+|1762|Buildings With an Ocean View||79.2%|Medium||
+|1763|Longest Nice Substring|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1763.Longest-Nice-Substring)|61.7%|Easy||
+|1764|Form Array by Concatenating Subarrays of Another Array||52.7%|Medium||
+|1765|Map of Highest Peak||60.3%|Medium||
+|1766|Tree of Coprimes||38.5%|Hard||
+|1767|Find the Subtasks That Did Not Execute||84.7%|Hard||
+|1768|Merge Strings Alternately||75.9%|Easy||
+|1769|Minimum Number of Operations to Move All Balls to Each Box||85.4%|Medium||
+|1770|Maximum Score from Performing Multiplication Operations||36.3%|Hard||
+|1771|Maximize Palindrome Length From Subsequences||35.2%|Hard||
+|1772|Sort Features by Popularity||65.1%|Medium||
+|1773|Count Items Matching a Rule||84.3%|Easy||
+|1774|Closest Dessert Cost||46.7%|Medium||
+|1775|Equal Sum Arrays With Minimum Number of Operations||52.6%|Medium||
+|1776|Car Fleet II||53.3%|Hard||
+|1777|Product's Price for Each Store||85.4%|Easy||
+|1778|Shortest Path in a Hidden Grid||39.7%|Medium||
+|1779|Find Nearest Point That Has the Same X or Y Coordinate||67.2%|Easy||
+|1780|Check if Number is a Sum of Powers of Three||65.3%|Medium||
+|1781|Sum of Beauty of All Substrings||60.4%|Medium||
+|1782|Count Pairs Of Nodes||37.9%|Hard||
+|1783|Grand Slam Titles||88.9%|Medium||
+|1784|Check if Binary String Has at Most One Segment of Ones||40.5%|Easy||
+|1785|Minimum Elements to Add to Form a Given Sum||42.4%|Medium||
+|1786|Number of Restricted Paths From First to Last Node||39.2%|Medium||
+|1787|Make the XOR of All Segments Equal to Zero||39.5%|Hard||
+|1788|Maximize the Beauty of the Garden||66.4%|Hard||
+|1789|Primary Department for Each Employee||80.0%|Easy||
+|1790|Check if One String Swap Can Make Strings Equal||45.6%|Easy||
+|1791|Find Center of Star Graph|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1791.Find-Center-of-Star-Graph)|83.6%|Easy||
+|1792|Maximum Average Pass Ratio||51.9%|Medium||
+|1793|Maximum Score of a Good Subarray||53.2%|Hard||
+|1794|Count Pairs of Equal Substrings With Minimum Difference||65.2%|Medium||
+|1795|Rearrange Products Table||90.4%|Easy||
+|1796|Second Largest Digit in a String||49.0%|Easy||
+|1797|Design Authentication Manager||56.1%|Medium||
+|1798|Maximum Number of Consecutive Values You Can Make||54.1%|Medium||
+|1799|Maximize Score After N Operations||45.7%|Hard||
+|1800|Maximum Ascending Subarray Sum||63.8%|Easy||
+|1801|Number of Orders in the Backlog||47.2%|Medium||
+|1802|Maximum Value at a Given Index in a Bounded Array||31.8%|Medium||
+|1803|Count Pairs With XOR in a Range||46.8%|Hard||
+|1804|Implement Trie II (Prefix Tree)||59.8%|Medium||
+|1805|Number of Different Integers in a String||36.1%|Easy||
+|1806|Minimum Number of Operations to Reinitialize a Permutation||71.3%|Medium||
+|1807|Evaluate the Bracket Pairs of a String||66.7%|Medium||
+|1808|Maximize Number of Nice Divisors||31.2%|Hard||
+|1809|Ad-Free Sessions||60.0%|Easy||
+|1810|Minimum Path Cost in a Hidden Grid||53.8%|Medium||
+|1811|Find Interview Candidates||65.3%|Medium||
+|1812|Determine Color of a Chessboard Square||77.4%|Easy||
+|1813|Sentence Similarity III||33.0%|Medium||
+|1814|Count Nice Pairs in an Array||41.9%|Medium||
+|1815|Maximum Number of Groups Getting Fresh Donuts||40.1%|Hard||
+|1816|Truncate Sentence|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1816.Truncate-Sentence)|81.9%|Easy||
+|1817|Finding the Users Active Minutes||80.7%|Medium||
+|1818|Minimum Absolute Sum Difference|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1818.Minimum-Absolute-Sum-Difference)|30.1%|Medium||
+|1819|Number of Different Subsequences GCDs||37.9%|Hard||
+|1820|Maximum Number of Accepted Invitations||49.7%|Medium||
+|1821|Find Customers With Positive Revenue this Year||89.4%|Easy||
+|1822|Sign of the Product of an Array||66.3%|Easy||
+|1823|Find the Winner of the Circular Game||77.7%|Medium||
+|1824|Minimum Sideway Jumps||49.8%|Medium||
+|1825|Finding MK Average||35.1%|Hard||
+|1826|Faulty Sensor||49.5%|Easy||
+|1827|Minimum Operations to Make the Array Increasing||78.2%|Easy||
+|1828|Queries on Number of Points Inside a Circle||86.5%|Medium||
+|1829|Maximum XOR for Each Query||77.0%|Medium||
+|1830|Minimum Number of Operations to Make String Sorted||49.2%|Hard||
+|1831|Maximum Transaction Each Day||84.3%|Medium||
+|1832|Check if the Sentence Is Pangram||83.9%|Easy||
+|1833|Maximum Ice Cream Bars||65.5%|Medium||
+|1834|Single-Threaded CPU||41.9%|Medium||
+|1835|Find XOR Sum of All Pairs Bitwise AND||60.0%|Hard||
+|1836|Remove Duplicates From an Unsorted Linked List||69.3%|Medium||
+|1837|Sum of Digits in Base K||76.8%|Easy||
+|1838|Frequency of the Most Frequent Element||38.3%|Medium||
+|1839|Longest Substring Of All Vowels in Order||48.5%|Medium||
+|1840|Maximum Building Height||35.3%|Hard||
+|1841|League Statistics||57.4%|Medium||
+|1842|Next Palindrome Using Same Digits||53.6%|Hard||
+|1843|Suspicious Bank Accounts||48.0%|Medium||
+|1844|Replace All Digits with Characters||79.7%|Easy||
+|1845|Seat Reservation Manager||64.2%|Medium||
+|1846|Maximum Element After Decreasing and Rearranging|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1846.Maximum-Element-After-Decreasing-and-Rearranging)|59.1%|Medium||
+|1847|Closest Room||35.1%|Hard||
+|1848|Minimum Distance to the Target Element||58.6%|Easy||
+|1849|Splitting a String Into Descending Consecutive Values||32.1%|Medium||
+|1850|Minimum Adjacent Swaps to Reach the Kth Smallest Number||72.0%|Medium||
+|1851|Minimum Interval to Include Each Query||47.7%|Hard||
+|1852|Distinct Numbers in Each Subarray||71.5%|Medium||
+|1853|Convert Date Format||88.0%|Easy||
+|1854|Maximum Population Year||59.8%|Easy||
+|1855|Maximum Distance Between a Pair of Values||52.6%|Medium||
+|1856|Maximum Subarray Min-Product||37.7%|Medium||
+|1857|Largest Color Value in a Directed Graph||40.6%|Hard||
+|1858|Longest Word With All Prefixes||66.3%|Medium||
+|1859|Sorting the Sentence||84.4%|Easy||
+|1860|Incremental Memory Leak||71.6%|Medium||
+|1861|Rotating the Box||64.7%|Medium||
+|1862|Sum of Floored Pairs||28.3%|Hard||
+|1863|Sum of All Subset XOR Totals||79.0%|Easy||
+|1864|Minimum Number of Swaps to Make the Binary String Alternating||42.0%|Medium||
+|1865|Finding Pairs With a Certain Sum||50.3%|Medium||
+|1866|Number of Ways to Rearrange Sticks With K Sticks Visible||55.4%|Hard||
+|1867|Orders With Maximum Quantity Above Average||75.9%|Medium||
+|1868|Product of Two Run-Length Encoded Arrays||57.8%|Medium||
+|1869|Longer Contiguous Segments of Ones than Zeros||60.2%|Easy||
+|1870|Minimum Speed to Arrive on Time||37.3%|Medium||
+|1871|Jump Game VII||25.1%|Medium||
+|1872|Stone Game VIII||52.4%|Hard||
+|1873|Calculate Special Bonus||64.7%|Easy||
+|1874|Minimize Product Sum of Two Arrays||90.4%|Medium||
+|1875|Group Employees of the Same Salary||75.6%|Medium||
+|1876|Substrings of Size Three with Distinct Characters||70.2%|Easy||
+|1877|Minimize Maximum Pair Sum in Array|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1877.Minimize-Maximum-Pair-Sum-in-Array)|80.4%|Medium||
+|1878|Get Biggest Three Rhombus Sums in a Grid||46.4%|Medium||
+|1879|Minimum XOR Sum of Two Arrays||44.6%|Hard||
+|1880|Check if Word Equals Summation of Two Words||73.6%|Easy||
+|1881|Maximum Value after Insertion||36.5%|Medium||
+|1882|Process Tasks Using Servers||39.5%|Medium||
+|1883|Minimum Skips to Arrive at Meeting On Time||38.5%|Hard||
+|1884|Egg Drop With 2 Eggs and N Floors||70.3%|Medium||
+|1885|Count Pairs in Two Arrays||59.2%|Medium||
+|1886|Determine Whether Matrix Can Be Obtained By Rotation||55.3%|Easy||
+|1887|Reduction Operations to Make the Array Elements Equal||62.3%|Medium||
+|1888|Minimum Number of Flips to Make the Binary String Alternating||37.8%|Medium||
+|1889|Minimum Space Wasted From Packaging||30.6%|Hard||
+|1890|The Latest Login in 2020||81.8%|Easy||
+|1891|Cutting Ribbons||48.1%|Medium||
+|1892|Page Recommendations II||44.8%|Hard||
+|1893|Check if All the Integers in a Range Are Covered||50.8%|Easy||
+|1894|Find the Student that Will Replace the Chalk||43.6%|Medium||
+|1895|Largest Magic Square||51.9%|Medium||
+|1896|Minimum Cost to Change the Final Value of Expression||54.9%|Hard||
+|1897|Redistribute Characters to Make All Strings Equal||60.0%|Easy||
+|1898|Maximum Number of Removable Characters||39.2%|Medium||
+|1899|Merge Triplets to Form Target Triplet||64.3%|Medium||
+|1900|The Earliest and Latest Rounds Where Players Compete||51.8%|Hard||
+|1901|Find a Peak Element II||53.3%|Medium||
+|1902|Depth of BST Given Insertion Order||45.0%|Medium||
+|1903|Largest Odd Number in String||55.7%|Easy||
+|1904|The Number of Full Rounds You Have Played||45.7%|Medium||
+|1905|Count Sub Islands||67.9%|Medium||
+|1906|Minimum Absolute Difference Queries||43.9%|Medium||
+|1907|Count Salary Categories||64.6%|Medium||
+|1908|Game of Nim||57.3%|Medium||
+|1909|Remove One Element to Make the Array Strictly Increasing||26.0%|Easy||
+|1910|Remove All Occurrences of a Substring||74.0%|Medium||
+|1911|Maximum Alternating Subsequence Sum||59.2%|Medium||
+|1912|Design Movie Rental System||41.2%|Hard||
+|1913|Maximum Product Difference Between Two Pairs||81.4%|Easy||
+|1914|Cyclically Rotating a Grid||48.0%|Medium||
+|1915|Number of Wonderful Substrings||44.8%|Medium||
+|1916|Count Ways to Build Rooms in an Ant Colony||48.7%|Hard||
+|1917|Leetcodify Friends Recommendations||28.9%|Hard||
+|1918|Kth Smallest Subarray Sum||52.9%|Medium||
+|1919|Leetcodify Similar Friends||43.2%|Hard||
+|1920|Build Array from Permutation||91.5%|Easy||
+|1921|Eliminate Maximum Number of Monsters||37.8%|Medium||
+|1922|Count Good Numbers||38.5%|Medium||
+|1923|Longest Common Subpath||27.6%|Hard||
+|1924|Erect the Fence II||53.9%|Hard||
+|1925|Count Square Sum Triples||67.9%|Easy||
+|1926|Nearest Exit from Entrance in Maze||43.1%|Medium||
+|1927|Sum Game||47.0%|Medium||
+|1928|Minimum Cost to Reach Destination in Time||37.6%|Hard||
+|1929|Concatenation of Array||91.5%|Easy||
+|1930|Unique Length-3 Palindromic Subsequences||51.8%|Medium||
+|1931|Painting a Grid With Three Different Colors||57.3%|Hard||
+|1932|Merge BSTs to Create Single BST||35.3%|Hard||
+|1933|Check if String Is Decomposable Into Value-Equal Substrings||50.4%|Easy||
+|1934|Confirmation Rate||77.8%|Medium||
+|1935|Maximum Number of Words You Can Type||71.0%|Easy||
+|1936|Add Minimum Number of Rungs||42.8%|Medium||
+|1937|Maximum Number of Points with Cost||36.2%|Medium||
+|1938|Maximum Genetic Difference Query||39.5%|Hard||
+|1939|Users That Actively Request Confirmation Messages||61.7%|Easy||
+|1940|Longest Common Subsequence Between Sorted Arrays||79.4%|Medium||
+|1941|Check if All Characters Have Equal Number of Occurrences||76.9%|Easy||
+|1942|The Number of the Smallest Unoccupied Chair||40.4%|Medium||
+|1943|Describe the Painting||47.8%|Medium||
+|1944|Number of Visible People in a Queue||69.9%|Hard||
+|1945|Sum of Digits of String After Convert||61.1%|Easy||
+|1946|Largest Number After Mutating Substring||34.5%|Medium||
+|1947|Maximum Compatibility Score Sum||60.9%|Medium||
+|1948|Delete Duplicate Folders in System||58.0%|Hard||
+|1949|Strong Friendship||58.7%|Medium||
+|1950|Maximum of Minimum Values in All Subarrays||50.0%|Medium||
+|1951|All the Pairs With the Maximum Number of Common Followers||72.9%|Medium||
+|1952|Three Divisors||57.0%|Easy||
+|1953|Maximum Number of Weeks for Which You Can Work||39.0%|Medium||
+|1954|Minimum Garden Perimeter to Collect Enough Apples||53.0%|Medium||
+|1955|Count Number of Special Subsequences||51.3%|Hard||
+|1956|Minimum Time For K Virus Variants to Spread||46.5%|Hard||
+|1957|Delete Characters to Make Fancy String||56.6%|Easy||
+|1958|Check if Move is Legal||44.2%|Medium||
+|1959|Minimum Total Space Wasted With K Resizing Operations||41.9%|Medium||
+|1960|Maximum Product of the Length of Two Palindromic Substrings||29.6%|Hard||
+|1961|Check If String Is a Prefix of Array||54.2%|Easy||
+|1962|Remove Stones to Minimize the Total||58.8%|Medium||
+|1963|Minimum Number of Swaps to Make the String Balanced||68.3%|Medium||
+|1964|Find the Longest Valid Obstacle Course at Each Position||46.9%|Hard||
+|1965|Employees With Missing Information||81.1%|Easy||
+|1966|Binary Searchable Numbers in an Unsorted Array||65.5%|Medium||
+|1967|Number of Strings That Appear as Substrings in Word||79.9%|Easy||
+|1968|Array With Elements Not Equal to Average of Neighbors||49.4%|Medium||
+|1969|Minimum Non-Zero Product of the Array Elements||33.7%|Medium||
+|1970|Last Day Where You Can Still Cross||49.5%|Hard||
+|1971|Find if Path Exists in Graph||50.5%|Easy||
+|1972|First and Last Call On the Same Day||54.4%|Hard||
+|1973|Count Nodes Equal to Sum of Descendants||75.3%|Medium||
+|1974|Minimum Time to Type Word Using Special Typewriter||71.5%|Easy||
+|1975|Maximum Matrix Sum||45.6%|Medium||
+|1976|Number of Ways to Arrive at Destination||32.4%|Medium||
+|1977|Number of Ways to Separate Numbers||21.2%|Hard||
+|1978|Employees Whose Manager Left the Company||50.5%|Easy||
+|1979|Find Greatest Common Divisor of Array||76.8%|Easy||
+|1980|Find Unique Binary String||64.2%|Medium||
+|1981|Minimize the Difference Between Target and Chosen Elements||32.4%|Medium||
+|1982|Find Array Given Subset Sums||48.7%|Hard||
+|1983|Widest Pair of Indices With Equal Range Sum||53.1%|Medium||
+|1984|Minimum Difference Between Highest and Lowest of K Scores|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1984.Minimum-Difference-Between-Highest-and-Lowest-of-K-Scores)|53.5%|Easy||
+|1985|Find the Kth Largest Integer in the Array||44.6%|Medium||
+|1986|Minimum Number of Work Sessions to Finish the Tasks||33.1%|Medium||
+|1987|Number of Unique Good Subsequences||52.2%|Hard||
+|1988|Find Cutoff Score for Each School||70.5%|Medium||
+|1989|Maximum Number of People That Can Be Caught in Tag||53.8%|Medium||
+|1990|Count the Number of Experiments||51.7%|Medium||
+|1991|Find the Middle Index in Array||67.3%|Easy||
+|1992|Find All Groups of Farmland||68.5%|Medium||
+|1993|Operations on Tree||43.5%|Medium||
+|1994|The Number of Good Subsets||34.1%|Hard||
+|1995|Count Special Quadruplets||59.0%|Easy||
+|1996|The Number of Weak Characters in the Game||44.0%|Medium||
+|1997|First Day Where You Have Been in All the Rooms||36.0%|Medium||
+|1998|GCD Sort of an Array||45.5%|Hard||
+|1999|Smallest Greater Multiple Made of Two Digits||50.0%|Medium||
+|2000|Reverse Prefix of Word||77.7%|Easy||
+|2001|Number of Pairs of Interchangeable Rectangles||44.6%|Medium||
+|2002|Maximum Product of the Length of Two Palindromic Subsequences||53.4%|Medium||
+|2003|Smallest Missing Genetic Value in Each Subtree||44.1%|Hard||
+|2004|The Number of Seniors and Juniors to Join the Company||38.8%|Hard||
+|2005|Subtree Removal Game with Fibonacci Tree||62.8%|Hard||
+|2006|Count Number of Pairs With Absolute Difference K||82.2%|Easy||
+|2007|Find Original Array From Doubled Array||41.0%|Medium||
+|2008|Maximum Earnings From Taxi||43.0%|Medium||
+|2009|Minimum Number of Operations to Make Array Continuous||45.5%|Hard||
+|2010|The Number of Seniors and Juniors to Join the Company II||57.8%|Hard||
+|2011|Final Value of Variable After Performing Operations||88.8%|Easy||
+|2012|Sum of Beauty in the Array||46.7%|Medium||
+|2013|Detect Squares||50.1%|Medium||
+|2014|Longest Subsequence Repeated k Times||55.7%|Hard||
+|2015|Average Height of Buildings in Each Segment||58.6%|Medium||
+|2016|Maximum Difference Between Increasing Elements||53.4%|Easy||
+|2017|Grid Game||42.7%|Medium||
+|2018|Check if Word Can Be Placed In Crossword||49.3%|Medium||
+|2019|The Score of Students Solving Math Expression||33.2%|Hard||
+|2020|Number of Accounts That Did Not Stream||73.2%|Medium||
+|2021|Brightest Position on Street|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/2021.Brightest-Position-on-Street)|62.9%|Medium||
+|2022|Convert 1D Array Into 2D Array|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/2022.Convert-1D-Array-Into-2D-Array)|58.3%|Easy||
+|2023|Number of Pairs of Strings With Concatenation Equal to Target||72.8%|Medium||
+|2024|Maximize the Confusion of an Exam||59.4%|Medium||
+|2025|Maximum Number of Ways to Partition an Array||32.0%|Hard||
+|2026|Low-Quality Problems||85.5%|Easy||
+|2027|Minimum Moves to Convert String||53.8%|Easy||
+|2028|Find Missing Observations||43.5%|Medium||
+|2029|Stone Game IX||26.1%|Medium||
+|2030|Smallest K-Length Subsequence With Occurrences of a Letter||38.9%|Hard||
+|2031|Count Subarrays With More Ones Than Zeros||53.2%|Medium||
+|2032|Two Out of Three||72.6%|Easy||
+|2033|Minimum Operations to Make a Uni-Value Grid||52.3%|Medium||
+|2034|Stock Price Fluctuation||49.3%|Medium||
+|2035|Partition Array Into Two Arrays to Minimize Sum Difference||17.9%|Hard||
+|2036|Maximum Alternating Subarray Sum||41.2%|Medium||
+|2037|Minimum Number of Moves to Seat Everyone|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/2037.Minimum-Number-of-Moves-to-Seat-Everyone)|82.2%|Easy||
+|2038|Remove Colored Pieces if Both Neighbors are the Same Color|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/2038.Remove-Colored-Pieces-if-Both-Neighbors-are-the-Same-Color)|58.1%|Medium||
+|2039|The Time When the Network Becomes Idle||50.6%|Medium||
+|2040|Kth Smallest Product of Two Sorted Arrays||29.1%|Hard||
+|2041|Accepted Candidates From the Interviews||79.4%|Medium||
+|2042|Check if Numbers Are Ascending in a Sentence||65.9%|Easy||
+|2043|Simple Bank System|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/2043.Simple-Bank-System)|65.9%|Medium||
+|2044|Count Number of Maximum Bitwise-OR Subsets||74.8%|Medium||
+|2045|Second Minimum Time to Reach Destination||38.5%|Hard||
+|2046|Sort Linked List Already Sorted Using Absolute Values||68.6%|Medium||
+|2047|Number of Valid Words in a Sentence||29.5%|Easy||
+|2048|Next Greater Numerically Balanced Number||47.1%|Medium||
+|2049|Count Nodes With the Highest Score||47.1%|Medium||
+|2050|Parallel Courses III||59.4%|Hard||
+|2051|The Category of Each Member in the Store||73.5%|Medium||
+|2052|Minimum Cost to Separate Sentence Into Rows||51.0%|Medium||
+|2053|Kth Distinct String in an Array||71.9%|Easy||
+|2054|Two Best Non-Overlapping Events||44.8%|Medium||
+|2055|Plates Between Candles||44.7%|Medium||
+|2056|Number of Valid Move Combinations On Chessboard||59.1%|Hard||
+|2057|Smallest Index With Equal Value||71.2%|Easy||
+|2058|Find the Minimum and Maximum Number of Nodes Between Critical Points||57.1%|Medium||
+|2059|Minimum Operations to Convert Number||47.2%|Medium||
+|2060|Check if an Original String Exists Given Two Encoded Strings||41.0%|Hard||
+|2061|Number of Spaces Cleaning Robot Cleaned||54.9%|Medium||
+|2062|Count Vowel Substrings of a String||65.9%|Easy||
+|2063|Vowels of All Substrings||55.0%|Medium||
+|2064|Minimized Maximum of Products Distributed to Any Store||50.0%|Medium||
+|2065|Maximum Path Quality of a Graph||57.7%|Hard||
+|2066|Account Balance||85.5%|Medium||
+|2067|Number of Equal Count Substrings||49.6%|Medium||
+|2068|Check Whether Two Strings are Almost Equivalent||64.7%|Easy||
+|2069|Walking Robot Simulation II||23.0%|Medium||
+|2070|Most Beautiful Item for Each Query||49.5%|Medium||
+|2071|Maximum Number of Tasks You Can Assign||34.8%|Hard||
+|2072|The Winner University||72.4%|Easy||
+|2073|Time Needed to Buy Tickets||62.0%|Easy||
+|2074|Reverse Nodes in Even Length Groups||51.5%|Medium||
+|2075|Decode the Slanted Ciphertext||50.2%|Medium||
+|2076|Process Restricted Friend Requests||53.4%|Hard||
+|2077|Paths in Maze That Lead to Same Room||56.8%|Medium||
+|2078|Two Furthest Houses With Different Colors||67.3%|Easy||
+|2079|Watering Plants||80.2%|Medium||
+|2080|Range Frequency Queries||38.1%|Medium||
+|2081|Sum of k-Mirror Numbers||42.1%|Hard||
+|2082|The Number of Rich Customers||80.7%|Easy||
+|2083|Substrings That Begin and End With the Same Letter||68.0%|Medium||
+|2084|Drop Type 1 Orders for Customers With Type 0 Orders||91.2%|Medium||
+|2085|Count Common Words With One Occurrence||69.6%|Easy||
+|2086|Minimum Number of Buckets Required to Collect Rainwater from Houses||45.0%|Medium||
+|2087|Minimum Cost Homecoming of a Robot in a Grid||51.4%|Medium||
+|2088|Count Fertile Pyramids in a Land||63.3%|Hard||
+|2089|Find Target Indices After Sorting Array||76.9%|Easy||
+|2090|K Radius Subarray Averages||42.4%|Medium||
+|2091|Removing Minimum and Maximum From Array||56.8%|Medium||
+|2092|Find All People With Secret||34.2%|Hard||
+|2093|Minimum Cost to Reach City With Discounts||56.3%|Medium||
+|2094|Finding 3-Digit Even Numbers||57.4%|Easy||
+|2095|Delete the Middle Node of a Linked List||60.7%|Medium||
+|2096|Step-By-Step Directions From a Binary Tree Node to Another|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/2096.Step-By-Step-Directions-From-a-Binary-Tree-Node-to-Another)|48.8%|Medium||
+|2097|Valid Arrangement of Pairs||40.9%|Hard||
+|2098|Subsequence of Size K With the Largest Even Sum||38.7%|Medium||
+|2099|Find Subsequence of Length K With the Largest Sum||42.5%|Easy||
+|2100|Find Good Days to Rob the Bank||49.1%|Medium||
+|2101|Detonate the Maximum Bombs||40.9%|Medium||
+|2102|Sequentially Ordinal Rank Tracker||66.1%|Hard||
+|2103|Rings and Rods||81.5%|Easy||
+|2104|Sum of Subarray Ranges||60.2%|Medium||
+|2105|Watering Plants II||50.2%|Medium||
+|2106|Maximum Fruits Harvested After at Most K Steps||35.1%|Hard||
+|2107|Number of Unique Flavors After Sharing K Candies||57.2%|Medium||
+|2108|Find First Palindromic String in the Array||78.6%|Easy||
+|2109|Adding Spaces to a String||56.2%|Medium||
+|2110|Number of Smooth Descent Periods of a Stock||57.4%|Medium||
+|2111|Minimum Operations to Make the Array K-Increasing||37.7%|Hard||
+|2112|The Airport With the Most Traffic||71.2%|Medium||
+|2113|Elements in Array After Removing and Replacing Elements||73.4%|Medium||
+|2114|Maximum Number of Words Found in Sentences||88.2%|Easy||
+|2115|Find All Possible Recipes from Given Supplies||48.2%|Medium||
+|2116|Check if a Parentheses String Can Be Valid||31.4%|Medium||
+|2117|Abbreviating the Product of a Range||28.1%|Hard||
+|2118|Build the Equation||57.8%|Hard||
+|2119|A Number After a Double Reversal||75.7%|Easy||
+|2120|Execution of All Suffix Instructions Staying in a Grid||83.5%|Medium||
+|2121|Intervals Between Identical Elements||43.0%|Medium||
+|2122|Recover the Original Array||38.1%|Hard||
+|2123|Minimum Operations to Remove Adjacent Ones in Matrix||41.1%|Hard||
+|2124|Check if All A's Appears Before All B's||71.5%|Easy||
+|2125|Number of Laser Beams in a Bank||82.7%|Medium||
+|2126|Destroying Asteroids||49.4%|Medium||
+|2127|Maximum Employees to Be Invited to a Meeting||32.9%|Hard||
+|2128|Remove All Ones With Row and Column Flips||76.4%|Medium||
+|2129|Capitalize the Title||60.1%|Easy||
+|2130|Maximum Twin Sum of a Linked List||81.6%|Medium||
+|2131|Longest Palindrome by Concatenating Two Letter Words||41.3%|Medium||
+|2132|Stamping the Grid||30.6%|Hard||
+|2133|Check if Every Row and Column Contains All Numbers||52.8%|Easy||
+|2134|Minimum Swaps to Group All 1's Together II||50.3%|Medium||
+|2135|Count Words Obtained After Adding a Letter||42.8%|Medium||
+|2136|Earliest Possible Day of Full Bloom||68.4%|Hard||
+|2137|Pour Water Between Buckets to Make Water Levels Equal||67.1%|Medium||
+|2138|Divide a String Into Groups of Size k||65.1%|Easy||
+|2139|Minimum Moves to Reach Target Score||48.4%|Medium||
+|2140|Solving Questions With Brainpower||45.8%|Medium||
+|2141|Maximum Running Time of N Computers||38.7%|Hard||
+|2142|The Number of Passengers in Each Bus I||51.1%|Medium||
+|2143|Choose Numbers From Two Arrays in Range||51.8%|Hard||
+|2144|Minimum Cost of Buying Candies With Discount||60.8%|Easy||
+|2145|Count the Hidden Sequences||36.3%|Medium||
+|2146|K Highest Ranked Items Within a Price Range||41.2%|Medium||
+|2147|Number of Ways to Divide a Long Corridor||39.9%|Hard||
+|2148|Count Elements With Strictly Smaller and Greater Elements||60.0%|Easy||
+|2149|Rearrange Array Elements by Sign||81.0%|Medium||
+|2150|Find All Lonely Numbers in the Array||60.7%|Medium||
+|2151|Maximum Good People Based on Statements||48.4%|Hard||
+|2152|Minimum Number of Lines to Cover Points||46.7%|Medium||
+|2153|The Number of Passengers in Each Bus II||50.4%|Hard||
+|2154|Keep Multiplying Found Values by Two||73.3%|Easy||
+|2155|All Divisions With the Highest Score of a Binary Array||63.3%|Medium||
+|2156|Find Substring With Given Hash Value||21.9%|Hard||
+|2157|Groups of Strings||25.2%|Hard||
+|2158|Amount of New Area Painted Each Day||55.7%|Hard||
+|2159|Order Two Columns Independently||63.5%|Medium||
+|2160|Minimum Sum of Four Digit Number After Splitting Digits||88.2%|Easy||
+|2161|Partition Array According to Given Pivot||84.3%|Medium||
+|2162|Minimum Cost to Set Cooking Time||39.2%|Medium||
+|2163|Minimum Difference in Sums After Removal of Elements||46.5%|Hard||
+|2164|Sort Even and Odd Indices Independently|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/2164.Sort-Even-and-Odd-Indices-Independently)|66.6%|Easy||
+|2165|Smallest Value of the Rearranged Number|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/2165.Smallest-Value-of-the-Rearranged-Number)|51.1%|Medium||
+|2166|Design Bitset|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/2166.Design-Bitset)|31.3%|Medium||
+|2167|Minimum Time to Remove All Cars Containing Illegal Goods|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/2167.Minimum-Time-to-Remove-All-Cars-Containing-Illegal-Goods)|40.1%|Hard||
+|2168|Unique Substrings With Equal Digit Frequency||60.2%|Medium||
+|2169|Count Operations to Obtain Zero|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/2169.Count-Operations-to-Obtain-Zero)|75.6%|Easy||
+|2170|Minimum Operations to Make the Array Alternating|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/2170.Minimum-Operations-to-Make-the-Array-Alternating)|33.2%|Medium||
+|2171|Removing Minimum Number of Magic Beans|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/2171.Removing-Minimum-Number-of-Magic-Beans)|42.0%|Medium||
+|2172|Maximum AND Sum of Array||46.8%|Hard||
+|2173|Longest Winning Streak||59.7%|Hard||
+|2174|Remove All Ones With Row and Column Flips II||68.8%|Medium||
+|2175|The Change in Global Rankings||68.5%|Medium||
+|2176|Count Equal and Divisible Pairs in an Array||80.3%|Easy||
+|2177|Find Three Consecutive Integers That Sum to a Given Number||63.5%|Medium||
+|2178|Maximum Split of Positive Even Integers||59.1%|Medium||
+|2179|Count Good Triplets in an Array||36.7%|Hard||
+|2180|Count Integers With Even Digit Sum|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/2180.Count-Integers-With-Even-Digit-Sum)|64.5%|Easy||
+|2181|Merge Nodes in Between Zeros|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/2181.Merge-Nodes-in-Between-Zeros)|86.9%|Medium||
+|2182|Construct String With Repeat Limit|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/2182.Construct-String-With-Repeat-Limit)|51.8%|Medium||
+|2183|Count Array Pairs Divisible by K|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/2183.Count-Array-Pairs-Divisible-by-K)|28.3%|Hard||
+|2184|Number of Ways to Build Sturdy Brick Wall||52.1%|Medium||
+|2185|Counting Words With a Given Prefix||77.1%|Easy||
+|2186|Minimum Number of Steps to Make Two Strings Anagram II||71.9%|Medium||
+|2187|Minimum Time to Complete Trips||31.8%|Medium||
+|2188|Minimum Time to Finish the Race||41.9%|Hard||
+|2189|Number of Ways to Build House of Cards||63.2%|Medium||
+|2190|Most Frequent Number Following Key In an Array||60.4%|Easy||
+|2191|Sort the Jumbled Numbers||45.1%|Medium||
+|2192|All Ancestors of a Node in a Directed Acyclic Graph||50.5%|Medium||
+|2193|Minimum Number of Moves to Make Palindrome||50.8%|Hard||
+|2194|Cells in a Range on an Excel Sheet||85.7%|Easy||
+|2195|Append K Integers With Minimal Sum||24.9%|Medium||
+|2196|Create Binary Tree From Descriptions||72.0%|Medium||
+|2197|Replace Non-Coprime Numbers in Array||38.3%|Hard||
+|2198|Number of Single Divisor Triplets||56.2%|Medium||
+|2199|Finding the Topic of Each Post||49.8%|Hard||
+|2200|Find All K-Distant Indices in an Array||64.4%|Easy||
+|2201|Count Artifacts That Can Be Extracted||54.9%|Medium||
+|2202|Maximize the Topmost Element After K Moves||22.7%|Medium||
+|2203|Minimum Weighted Subgraph With the Required Paths||35.6%|Hard||
+|2204|Distance to a Cycle in Undirected Graph||71.4%|Hard||
+|2205|The Number of Users That Are Eligible for Discount||50.4%|Easy||
+|2206|Divide Array Into Equal Pairs||74.8%|Easy||
+|2207|Maximize Number of Subsequences in a String||32.7%|Medium||
+|2208|Minimum Operations to Halve Array Sum||45.1%|Medium||
+|2209|Minimum White Tiles After Covering With Carpets||33.7%|Hard||
+|2210|Count Hills and Valleys in an Array||57.7%|Easy||
+|2211|Count Collisions on a Road||41.7%|Medium||
+|2212|Maximum Points in an Archery Competition||48.7%|Medium||
+|2213|Longest Substring of One Repeating Character||31.1%|Hard||
+|2214|Minimum Health to Beat Game||57.6%|Medium||
+|2215|Find the Difference of Two Arrays||69.1%|Easy||
+|2216|Minimum Deletions to Make Array Beautiful||46.1%|Medium||
+|2217|Find Palindrome With Fixed Length||34.4%|Medium||
+|2218|Maximum Value of K Coins From Piles||48.5%|Hard||
+|2219|Maximum Sum Score of Array||60.6%|Medium||
+|2220|Minimum Bit Flips to Convert Number||82.3%|Easy||
+|2221|Find Triangular Sum of an Array||79.1%|Medium||
+|2222|Number of Ways to Select Buildings||50.7%|Medium||
+|2223|Sum of Scores of Built Strings||36.5%|Hard||
+|2224|Minimum Number of Operations to Convert Time||65.2%|Easy||
+|2225|Find Players With Zero or One Losses||69.3%|Medium||
+|2226|Maximum Candies Allocated to K Children||35.9%|Medium||
+|2227|Encrypt and Decrypt Strings||39.0%|Hard||
+|2228|Users With Two Purchases Within Seven Days||44.8%|Medium||
+|2229|Check if an Array Is Consecutive||61.7%|Easy||
+|2230|The Users That Are Eligible for Discount||51.1%|Easy||
+|2231|Largest Number After Digit Swaps by Parity||60.2%|Easy||
+|2232|Minimize Result by Adding Parentheses to Expression||64.7%|Medium||
+|2233|Maximum Product After K Increments||41.3%|Medium||
+|2234|Maximum Total Beauty of the Gardens||28.1%|Hard||
+|2235|Add Two Integers||90.0%|Easy||
+|2236|Root Equals Sum of Children||87.6%|Easy||
+|2237|Count Positions on Street With Required Brightness||68.6%|Medium||
+|2238|Number of Times a Driver Was a Passenger||75.3%|Medium||
+|2239|Find Closest Number to Zero||45.8%|Easy||
+|2240|Number of Ways to Buy Pens and Pencils||56.8%|Medium||
+|2241|Design an ATM Machine||38.6%|Medium||
+|2242|Maximum Score of a Node Sequence||37.4%|Hard||
+|2243|Calculate Digit Sum of a String||66.9%|Easy||
+|2244|Minimum Rounds to Complete All Tasks||57.0%|Medium||
+|2245|Maximum Trailing Zeros in a Cornered Path||35.2%|Medium||
+|2246|Longest Path With Different Adjacent Characters||44.9%|Hard||
+|2247|Maximum Cost of Trip With K Highways||50.5%|Hard||
+|2248|Intersection of Multiple Arrays||69.5%|Easy||
+|2249|Count Lattice Points Inside a Circle||50.4%|Medium||
+|2250|Count Number of Rectangles Containing Each Point||33.9%|Medium||
+|2251|Number of Flowers in Full Bloom||51.9%|Hard||
+|2252|Dynamic Pivoting of a Table||55.5%|Hard||
+|2253|Dynamic Unpivoting of a Table||67.4%|Hard||
+|2254|Design Video Sharing Platform||65.8%|Hard||
+|2255|Count Prefixes of a Given String||73.3%|Easy||
+|2256|Minimum Average Difference||35.7%|Medium||
+|2257|Count Unguarded Cells in the Grid||52.2%|Medium||
+|2258|Escape the Spreading Fire||34.7%|Hard||
+|2259|Remove Digit From Number to Maximize Result||47.0%|Easy||
+|2260|Minimum Consecutive Cards to Pick Up||51.9%|Medium||
+|2261|K Divisible Elements Subarrays||47.4%|Medium||
+|2262|Total Appeal of A String||58.1%|Hard||
+|2263|Make Array Non-decreasing or Non-increasing||68.0%|Hard||
+|2264|Largest 3-Same-Digit Number in String||58.9%|Easy||
+|2265|Count Nodes Equal to Average of Subtree||85.6%|Medium||
+|2266|Count Number of Texts||47.3%|Medium||
+|2267|Check if There Is a Valid Parentheses String Path||37.9%|Hard||
+|2268|Minimum Number of Keypresses||74.4%|Medium||
+|2269|Find the K-Beauty of a Number||57.2%|Easy||
+|2270|Number of Ways to Split Array||44.2%|Medium||
+|2271|Maximum White Tiles Covered by a Carpet||32.4%|Medium||
+|2272|Substring With Largest Variance||37.1%|Hard||
+|2273|Find Resultant Array After Removing Anagrams||58.0%|Easy||
+|2274|Maximum Consecutive Floors Without Special Floors||52.2%|Medium||
+|2275|Largest Combination With Bitwise AND Greater Than Zero||72.3%|Medium||
+|2276|Count Integers in Intervals||33.9%|Hard||
+|2277|Closest Node to Path in Tree||64.1%|Hard||
+|2278|Percentage of Letter in String||74.0%|Easy||
+|2279|Maximum Bags With Full Capacity of Rocks||62.6%|Medium||
+|2280|Minimum Lines to Represent a Line Chart||23.7%|Medium||
+|2281|Sum of Total Strength of Wizards||27.9%|Hard||
+|2282|Number of People That Can Be Seen in a Grid||50.4%|Medium||
+|2283|Check if Number Has Equal Digit Count and Digit Value||73.6%|Easy||
+|2284|Sender With Largest Word Count||55.8%|Medium||
+|2285|Maximum Total Importance of Roads||60.7%|Medium||
+|2286|Booking Concert Tickets in Groups||15.7%|Hard||
+|2287|Rearrange Characters to Make Target String||57.7%|Easy||
+|2288|Apply Discount to Prices||27.3%|Medium||
+|2289|Steps to Make Array Non-decreasing||21.4%|Medium||
+|2290|Minimum Obstacle Removal to Reach Corner||49.2%|Hard||
+|2291|Maximum Profit From Trading Stocks||46.4%|Medium||
+|2292|Products With Three or More Orders in Two Consecutive Years||39.9%|Medium||
+|2293|Min Max Game||64.2%|Easy||
+|2294|Partition Array Such That Maximum Difference Is K||72.4%|Medium||
+|2295|Replace Elements in an Array||57.6%|Medium||
+|2296|Design a Text Editor||39.5%|Hard||
+|2297|Jump Game VIII||57.0%|Medium||
+|2298|Tasks Count in the Weekend||87.7%|Medium||
+|2299|Strong Password Checker II||56.8%|Easy||
+|2300|Successful Pairs of Spells and Potions||31.5%|Medium||
+|2301|Match Substring After Replacement||39.2%|Hard||
+|2302|Count Subarrays With Score Less Than K||51.9%|Hard||
+|2303|Calculate Amount Paid in Taxes||63.0%|Easy||
+|2304|Minimum Path Cost in a Grid||65.4%|Medium||
+|2305|Fair Distribution of Cookies||62.9%|Medium||
+|2306|Naming a Company||34.4%|Hard||
+|2307|Check for Contradictions in Equations||40.9%|Hard||
+|2308|Arrange Table by Gender||79.5%|Medium||
+|2309|Greatest English Letter in Upper and Lower Case||68.5%|Easy||
+|2310|Sum of Numbers With Units Digit K||25.4%|Medium||
+|2311|Longest Binary Subsequence Less Than or Equal to K||36.1%|Medium||
+|2312|Selling Pieces of Wood||48.0%|Hard||
+|2313|Minimum Flips in Binary Tree to Get Result||67.5%|Hard||
+|2314|The First Day of the Maximum Recorded Degree in Each City||76.9%|Medium||
+|2315|Count Asterisks||82.2%|Easy||
+|2316|Count Unreachable Pairs of Nodes in an Undirected Graph||38.6%|Medium||
+|2317|Maximum XOR After Operations||78.2%|Medium||
+|2318|Number of Distinct Roll Sequences||56.3%|Hard||
+|2319|Check if Matrix Is X-Matrix||67.3%|Easy||
+|2320|Count Number of Ways to Place Houses||39.9%|Medium||
+|2321|Maximum Score Of Spliced Array||55.1%|Hard||
+|2322|Minimum Score After Removals on a Tree||50.3%|Hard||
+|2323|Find Minimum Time to Finish All Jobs II||75.4%|Medium||
+|2324|Product Sales Analysis IV||84.5%|Medium||
+|2325|Decode the Message||84.7%|Easy||
+|2326|Spiral Matrix IV||74.6%|Medium||
+|2327|Number of People Aware of a Secret||44.4%|Medium||
+|2328|Number of Increasing Paths in a Grid||47.7%|Hard||
+|2329|Product Sales Analysis V||70.2%|Easy||
+|2330|Valid Palindrome IV||76.2%|Medium||
+|2331|Evaluate Boolean Binary Tree||79.5%|Easy||
+|2332|The Latest Time to Catch a Bus||22.7%|Medium||
+|2333|Minimum Sum of Squared Difference||24.9%|Medium||
+|2334|Subarray With Elements Greater Than Varying Threshold||40.1%|Hard||
+|2335|Minimum Amount of Time to Fill Cups||55.3%|Easy||
+|2336|Smallest Number in Infinite Set||71.8%|Medium||
+|2337|Move Pieces to Obtain a String||48.0%|Medium||
+|2338|Count the Number of Ideal Arrays||25.3%|Hard||
+|2339|All the Matches of the League||88.8%|Easy||
+|2340|Minimum Adjacent Swaps to Make a Valid Array||76.6%|Medium||
+|2341|Maximum Number of Pairs in Array||76.6%|Easy||
+|2342|Max Sum of a Pair With Equal Sum of Digits||52.9%|Medium||
+|2343|Query Kth Smallest Trimmed Number||40.7%|Medium||
+|2344|Minimum Deletions to Make Array Divisible||56.9%|Hard||
+|2345|Finding the Number of Visible Mountains||44.5%|Medium||
+|2346|Compute the Rank as a Percentage||32.9%|Medium||
+|2347|Best Poker Hand||60.7%|Easy||
+|2348|Number of Zero-Filled Subarrays||56.8%|Medium||
+|2349|Design a Number Container System||46.8%|Medium||
+|2350|Shortest Impossible Sequence of Rolls||68.2%|Hard||
+|2351|First Letter to Appear Twice||76.6%|Easy||
+|2352|Equal Row and Column Pairs||71.1%|Medium||
+|2353|Design a Food Rating System||34.4%|Medium||
+|2354|Number of Excellent Pairs||45.8%|Hard||
+|2355|Maximum Number of Books You Can Take||47.0%|Hard||
+|2356|Number of Unique Subjects Taught by Each Teacher||91.5%|Easy||
+|2357|Make Array Zero by Subtracting Equal Amounts||72.5%|Easy||
+|2358|Maximum Number of Groups Entering a Competition||67.3%|Medium||
+|2359|Find Closest Node to Given Two Nodes||33.8%|Medium||
+|2360|Longest Cycle in a Graph||38.5%|Hard||
+|2361|Minimum Costs Using the Train Line||77.1%|Hard||
+|2362|Generate the Invoice||89.1%|Hard||
+|2363|Merge Similar Items||75.1%|Easy||
+|2364|Count Number of Bad Pairs||40.5%|Medium||
+|2365|Task Scheduler II||46.0%|Medium||
+|2366|Minimum Replacements to Sort the Array||39.5%|Hard||
+|2367|Number of Arithmetic Triplets||83.7%|Easy||
+|2368|Reachable Nodes With Restrictions||57.2%|Medium||
+|2369|Check if There is a Valid Partition For The Array||40.0%|Medium||
+|2370|Longest Ideal Subsequence||37.8%|Medium||
+|2371|Minimize Maximum Value in a Grid||69.5%|Hard||
+|2372|Calculate the Influence of Each Salesperson||88.6%|Medium||
+|2373|Largest Local Values in a Matrix||84.1%|Easy||
+|2374|Node With Highest Edge Score||45.9%|Medium||
+|2375|Construct Smallest Number From DI String||73.7%|Medium||
+|2376|Count Special Integers||36.0%|Hard||
+|2377|Sort the Olympic Table||80.2%|Easy||
+|2378|Choose Edges to Maximize Score in a Tree||61.9%|Medium||
+|2379|Minimum Recolors to Get K Consecutive Black Blocks||56.6%|Easy||
+|2380|Time Needed to Rearrange a Binary String||47.7%|Medium||
+|2381|Shifting Letters II||33.9%|Medium||
+|2382|Maximum Segment Sum After Removals||47.7%|Hard||
+|2383|Minimum Hours of Training to Win a Competition||40.8%|Easy||
+|2384|Largest Palindromic Number||30.1%|Medium||
+|2385|Amount of Time for Binary Tree to Be Infected||56.0%|Medium||
+|2386|Find the K-Sum of an Array||36.2%|Hard||
+|2387|Median of a Row Wise Sorted Matrix||67.7%|Medium||
+|2388|Change Null Values in a Table to the Previous Value||79.7%|Medium||
+|2389|Longest Subsequence With Limited Sum||64.4%|Easy||
+|2390|Removing Stars From a String||62.9%|Medium||
+|2391|Minimum Amount of Time to Collect Garbage||85.4%|Medium||
+|2392|Build a Matrix With Conditions||59.1%|Hard||
+|2393|Count Strictly Increasing Subarrays||76.4%|Medium||
+|2394|Employees With Deductions||50.9%|Medium||
+|2395|Find Subarrays With Equal Sum||63.6%|Easy||
+|2396|Strictly Palindromic Number||87.7%|Medium||
+|2397|Maximum Rows Covered by Columns||52.2%|Medium||
+|2398|Maximum Number of Robots Within Budget||31.6%|Hard||
+|2399|Check Distances Between Same Letters||70.5%|Easy||
+|2400|Number of Ways to Reach a Position After Exactly k Steps||31.8%|Medium||
+|2401|Longest Nice Subarray||47.7%|Medium||
+|2402|Meeting Rooms III||32.7%|Hard||
+|2403|Minimum Time to Kill All Monsters||52.3%|Hard||
+|2404|Most Frequent Even Element||51.7%|Easy||
+|2405|Optimal Partition of String||74.1%|Medium||
+|2406|Divide Intervals Into Minimum Number of Groups||45.0%|Medium||
+|2407|Longest Increasing Subsequence II||20.6%|Hard||
+|2408|Design SQL||87.3%|Medium||
+|2409|Count Days Spent Together||42.3%|Easy||
+|2410|Maximum Matching of Players With Trainers||59.3%|Medium||
+|2411|Smallest Subarrays With Maximum Bitwise OR||40.0%|Medium||
+|2412|Minimum Money Required Before Transactions||38.8%|Hard||
+|2413|Smallest Even Multiple||88.2%|Easy||
+|2414|Length of the Longest Alphabetical Continuous Substring||55.5%|Medium||
+|2415|Reverse Odd Levels of Binary Tree||75.6%|Medium||
+|2416|Sum of Prefix Scores of Strings||42.3%|Hard||
+|2417|Closest Fair Integer||48.5%|Medium||
+|2418|Sort the People||82.7%|Easy||
+|2419|Longest Subarray With Maximum Bitwise AND||47.3%|Medium||
+|2420|Find All Good Indices||36.8%|Medium||
+|2421|Number of Good Paths||37.5%|Hard||
+|2422|Merge Operations to Turn Array Into a Palindrome||74.8%|Medium||
+|2423|Remove Letter To Equalize Frequency||19.4%|Easy||
+|2424|Longest Uploaded Prefix||53.2%|Medium||
+|2425|Bitwise XOR of All Pairings||58.3%|Medium||
+|2426|Number of Pairs Satisfying Inequality||41.1%|Hard||
+|2427|Number of Common Factors||80.3%|Easy||
+|2428|Maximum Sum of an Hourglass||73.6%|Medium||
+|2429|Minimize XOR||41.4%|Medium||
+|2430|Maximum Deletions on a String||32.8%|Hard||
+|2431|Maximize Total Tastiness of Purchased Fruits||76.6%|Medium||
+|2432|The Employee That Worked on the Longest Task||48.5%|Easy||
+|2433|Find The Original Array of Prefix Xor||85.1%|Medium||
+|2434|Using a Robot to Print the Lexicographically Smallest String||37.5%|Medium||
+|2435|Paths in Matrix Whose Sum Is Divisible by K||40.8%|Hard||
+|2436|Minimum Split Into Subarrays With GCD Greater Than One||85.0%|Medium||
+|2437|Number of Valid Clock Times||40.3%|Easy||
+|2438|Range Product Queries of Powers||36.6%|Medium||
+|2439|Minimize Maximum of Array||30.1%|Medium||
+|2440|Create Components With Same Value||53.4%|Hard||
+|2441|Largest Positive Integer That Exists With Its Negative||68.7%|Easy||
+|2442|Count Number of Distinct Integers After Reverse Operations||78.8%|Medium||
+|2443|Sum of Number and Its Reverse||40.6%|Medium||
+|2444|Count Subarrays With Fixed Bounds||38.4%|Hard||
|------------|-------------------------------------------------------|-------| ----------------| ---------------|-------------|
-
------------------------------------------------------------------
下面这些是免费的算法题,但是暂时还不能使用 Go 解答的:
@@ -1669,7 +2594,7 @@
------------------------------------------------------------------
-## 二.分类
+## 三.分类
## Array
diff --git a/README_old.md b/README_old.md
new file mode 100644
index 000000000..bc1892c44
--- /dev/null
+++ b/README_old.md
@@ -0,0 +1,1173 @@
+
+# LeetCode by Go
+[LeetCode Online Judge] (https://leetcode.com/) is a website containing many **algorithm questions**. Most of them are real interview questions of **Google, Facebook, LinkedIn, Apple**, etc. This repo shows my solutions by Go with the code style strictly follows the [Google Golang Style Guide](https://github.com/golang/go/wiki/CodeReviewComments). Please feel free to reference and **STAR** to support this repo, thank you!
+
+
+
+
2.静态链表
3.对称矩阵
4.稀疏矩阵||
+|栈|广义栈||
+|队列|1.链表实现
2.循环数组实现
3.双端队列||
+|字符串|1.KMP算法
2.有限状态自动机
3.模式匹配有限状态自动机
4.BM模式匹配算法
5.BM-KMP算法||
+|树|1.二叉树
2.并查集
3.Huffman数||
+|数组实现的堆|1.极大堆和极小堆
2.极大极小堆
3.双端堆
4.d叉堆||
+|树实现的堆|1.左堆
2.扁堆
3.二项式堆
4.斐波那契堆
5.配对堆||
+|查找|1.哈希表
2.跳跃表
3.排序二叉树
4.AVL树
5.B树
6.AA树
7.红黑树
8.排序二叉堆
9.Splay树
10.双链树
11.Trie树||
+
+
+## Data Structures
+
+> 标识了 (已全部做完) 的专题是全部完成了的,没有标识的是还没有做完的
+
+* [Array](#array)
+* [String](#string)
+* [Linked List](#linked-list)
+* [Stack](#stack)
+* [Tree](#tree)
+* [Dynamic programming](#dynamic-programming)
+* [Depth-first search](#depth-first-search)
+* [Math](#math)
+* [Search](#search)
+* [Sort](#sort)
+* [Union Find](#union-find)
+
+## Companies
+* [Google](#google)
+* [Facebook](#facebook)
+* [Snapchat](#snapchat)
+* [Uber](#uber)
+* [Airbnb](#airbnb)
+* [LinkedIn](#linkedin)
+* [Amazon](#amazon)
+* [Microsoft](#microsoft)
+
+
+## 算法
+
+
+## 一. 目录
+
+|题号|题目|通过率|难度|收藏|
+|:--:|:--|:--: | :--: | :--: |
+|1|[Two Sum](./Algorithms/1.two-sum)|38%|Easy||
+|2|[Add Two Numbers](./Algorithms/2.add-two-numbers)|28%|Medium||
+|3|[Longest Substring Without Repeating Characters](./Algorithms/3.longest-substring-without-repeating-characters)|24%|Medium||
+|4|[Median of Two Sorted Arrays](./Algorithms/4.median-of-two-sorted-arrays)|23%|Hard||
+|5|[Longest Palindromic Substring](./Algorithms/5.longest-palindromic-substring)|25%|Medium||
+|6|[ZigZag Conversion](./Algorithms/6.zigzag-conversion)|27%|Medium||
+|7|[Reverse Integer](./Algorithms/7.reverse-integer)|24%|Easy||
+|8|[String to Integer (atoi)](./Algorithms/8.string-to-integer-atoi)|14%|Medium||
+|9|[Palindrome Number](./Algorithms/9.palindrome-number)|35%|Easy||
+|10|[Regular Expression Matching](./Algorithms/10.regular-expression-matching)|24%|Hard|❤️|
+|11|[Container With Most Water](./Algorithms/11.container-with-most-water)|37%|Medium||
+|12|[Integer to Roman](./Algorithms/12.integer-to-roman)|46%|Medium||
+|13|[Roman to Integer](./Algorithms/13.roman-to-integer)|48%|Easy||
+|14|[Longest Common Prefix](./Algorithms/14.longest-common-prefix)|31%|Easy||
+|15|[3Sum](./Algorithms/15.3sum)|21%|Medium||
+|16|[3Sum Closest](./Algorithms/16.3sum-closest)|31%|Medium||
+|17|[Letter Combinations of a Phone Number](./Algorithms/17.letter-combinations-of-a-phone-number)|36%|Medium||
+|18|[4Sum](./Algorithms/18.4sum)|27%|Medium||
+|19|[Remove Nth Node From End of List](./Algorithms/19.remove-nth-node-from-end-of-list)|33%|Medium||
+|20|[Valid Parentheses](./Algorithms/20.Valid-Parentheses)|33%|Easy||
+|21|[Merge Two Sorted Lists](./Algorithms/21.merge-two-sorted-lists)|41%|Easy||
+|22|[Generate Parentheses](./Algorithms/22.generate-parentheses)|48%|Medium|❤️|
+|23|[Merge k Sorted Lists](./Algorithms/23.merge-k-sorted-lists)|28%|Hard||
+|24|[Swap Nodes in Pairs](./Algorithms/24.Swap-Nodes-In-Pairs)|39%|Medium|❤️|
+|25|[Reverse Nodes in k-Group](./Algorithms/25.Reverse-Nodes-In-k-Group)|31%|Hard|❤️|
+|26|[Remove Duplicates from Sorted Array](./Algorithms/26.remove-duplicates-from-sorted-array)|36%|Easy|❤️|
+|27|[Remove Element](./Algorithms/27.remove-element)|40%|Easy||
+|28|[Implement strStr()](./Algorithms/28.implement-strstr)|28%|Easy||
+|29|[Divide Two Integers](./Algorithms/29.divide-two-integers)|15%|Medium||
+|30|[Substring with Concatenation of All Words](./Algorithms/30.substring-with-concatenation-of-all-words)|22%|Hard|❤️|
+|31|[Next Permutation](./Algorithms/31.next-permutation)|29%|Medium|❤️|
+|32|[Longest Valid Parentheses](./Algorithms/32.longest-valid-parentheses)|23%|Hard||
+|33|[Search in Rotated Sorted Array](./Algorithms/33.search-in-rotated-sorted-array)|31%|Medium|❤️|
+|34|[Search for a Range](./Algorithms/34.search-for-a-range)|31%|Medium||
+|35|[Search Insert Position](./Algorithms/35.search-insert-position)|40%|Easy||
+|36|[Valid Sudoku](./Algorithms/36.valid-sudoku)|37%|Medium|❤️|
+|37|[Sudoku Solver](./Algorithms/37.sudoku-solver)|32%|Hard|❤️|
+|38|[Count and Say](./Algorithms/38.count-and-say)|36%|Easy||
+|39|[Combination Sum](./Algorithms/39.combination-sum)|41%|Medium||
+|40|[Combination Sum II](./Algorithms/40.combination-sum-ii)|35%|Medium||
+|41|[First Missing Positive](./Algorithms/41.First-Missing-Positive)|25%|Hard||
+|42|[Trapping Rain Water](./Algorithms/42.trapping-rain-water)|37%|Hard||
+|43|[Multiply Strings](./Algorithms/43.multiply-strings)|28%|Medium||
+|44|[Wildcard Matching](./Algorithms/44.wildcard-matching)|21%|Hard|❤️|
+|45|[Jump Game II](./Algorithms/45.jump-game-ii)|26%|Hard||
+|46|[Permutations](./Algorithms/46.permutations)|47%|Medium||
+|47|[Permutations II](./Algorithms/47.permutations-ii)|35%|Medium||
+|48|[Rotate Image](./Algorithms/48.rotate-image)|41%|Medium||
+|49|[Group Anagrams](./Algorithms/49.group-anagrams)|38%|Medium|❤️|
+|50|[Pow(x, n)](./Algorithms/50.powx-n)|26%|Medium||
+|51|[N-Queens](./Algorithms/51.n-queens)|33%|Hard||
+|52|[N-Queens II](./Algorithms/52.n-queens-ii)|46%|Hard||
+|53|[Maximum Subarray](./Algorithms/53.maximum-subarray)|40%|Easy|❤️|
+|54|[Spiral Matrix](./Algorithms/54.spiral-matrix)|27%|Medium|❤️|
+|55|[Jump Game](./Algorithms/55.jump-game)|29%|Medium||
+|56|[Merge Intervals](./Algorithms/56.merge-intervals)|31%|Medium|❤️|
+|57|[Insert Interval](./Algorithms/57.insert-interval)|28%|Hard||
+|58|[Length of Last Word](./Algorithms/58.length-of-last-word)|32%|Easy||
+|59|[Spiral Matrix II](./Algorithms/59.spiral-matrix-ii)|41%|Medium|❤️|
+|60|[Permutation Sequence](./Algorithms/60.permutation-sequence)|29%|Medium||
+|61|[Rotate List](./Algorithms/61.rotate-list)|24%|Medium|❤️|
+|62|[Unique Paths](./Algorithms/62.unique-paths)|42%|Medium|❤️|
+|63|[Unique Paths II](./Algorithms/63.unique-paths-ii)|32%|Medium||
+|64|[Minimum Path Sum](./Algorithms/64.minimum-path-sum)|40%|Medium||
+|65|[Valid Number](./Algorithms/65.valid-number)|12%|Hard||
+|66|[Plus One](./Algorithms/66.plus-one)|39%|Easy||
+|67|[Add Binary](./Algorithms/67.add-binary)|34%|Easy||
+|68|[Text Justification](./Algorithms/68.text-justification)|20%|Hard||
+|69|[Sqrt(x)](./Algorithms/69.sqrtx)|28%|Easy||
+|70|[Climbing Stairs](./Algorithms/70.climbing-stairs)|41%|Easy||
+|71|[Simplify Path](./Algorithms/71.simplify-path)|26%|Medium||
+|72|[Edit Distance](./Algorithms/72.edit-distance)|32%|Hard|❤️|
+|73|[Set Matrix Zeroes](./Algorithms/73.set-matrix-zeroes)|36%|Medium|❤️|
+|74|[Search a 2D Matrix](./Algorithms/74.search-a-2d-matrix)|34%|Medium||
+|75|[Sort Colors](./Algorithms/75.sort-colors)|38%|Medium|❤️|
+|76|[Minimum Window Substring](./Algorithms/76.minimum-window-substring)|26%|Hard|❤️|
+|77|[Combinations](./Algorithms/77.combinations)|41%|Medium||
+|78|[Subsets](./Algorithms/78.subsets)|44%|Medium|❤️|
+|79|[Word Search](./Algorithms/79.word-search)|28%|Medium||
+|80|[Remove Duplicates from Sorted Array II](./Algorithms/80.remove-duplicates-from-sorted-array-ii)|36%|Medium|❤️|
+|81|[Search in Rotated Sorted Array II](./Algorithms/81.search-in-rotated-sorted-array-ii)|32%|Medium||
+|82|[Remove Duplicates from Sorted List II](./Algorithms/82.remove-duplicates-from-sorted-list-ii)|29%|Medium|❤️|
+|83|[Remove Duplicates from Sorted List](./Algorithms/83.remove-duplicates-from-sorted-list)|40%|Easy||
+|84|[Largest Rectangle in Histogram](./Algorithms/84.largest-rectangle-in-histogram)|27%|Hard|❤️|
+|85|[Maximal Rectangle](./Algorithms/85.maximal-rectangle)|29%|Hard|❤️|
+|86|[Partition List](./Algorithms/86.partition-list)|33%|Medium||
+|87|[Scramble String](./Algorithms/87.scramble-string)|29%|Hard|❤️|
+|88|[Merge Sorted Array](./Algorithms/88.Merge-Sorted-Array)|32%|Easy||
+|89|[Gray Code](./Algorithms/89.gray-code)|42%|Medium||
+|90|[Subsets II](./Algorithms/90.subsets-ii)|38%|Medium|❤️|
+|91|[Decode Ways](./Algorithms/91.decode-ways)|20%|Medium|❤️|
+|92|[Reverse Linked List II](./Algorithms/92.reverse-linked-list-ii)|31%|Medium||
+|93|[Restore IP Addresses](./Algorithms/93.restore-ip-addresses)|28%|Medium|❤️|
+|94|[Binary Tree Inorder Traversal](./Algorithms/94.binary-tree-inorder-traversal)|49%|Medium||
+|95|[Unique Binary Search Trees II](./Algorithms/95.unique-binary-search-trees-ii)|32%|Medium|❤️|
+|96|[Unique Binary Search Trees](./Algorithms/96.unique-binary-search-trees)|41%|Medium||
+|97|[Interleaving String](./Algorithms/97.interleaving-string)|25%|Hard|❤️|
+|98|[Validate Binary Search Tree](./Algorithms/98.validate-binary-search-tree)|24%|Medium|❤️|
+|99|[Recover Binary Search Tree](./Algorithms/99.recover-binary-search-tree)|31%|Hard|❤️|
+|100|[Same Tree](./Algorithms/100.same-tree)|47%|Easy||
+|101|[Symmetric Tree](./Algorithms/101.symmetric-tree)|40%|Easy|❤️|
+|102|[Binary Tree Level Order Traversal](./Algorithms/102.binary-tree-level-order-traversal)|42%|Medium||
+|103|[Binary Tree Zigzag Level Order Traversal](./Algorithms/103.binary-tree-zigzag-level-order-traversal)|36%|Medium||
+|104|[Maximum Depth of Binary Tree](./Algorithms/104.maximum-depth-of-binary-tree)|54%|Easy||
+|105|[Construct Binary Tree from Preorder and Inorder Traversal](./Algorithms/105.construct-binary-tree-from-preorder-and-inorder-traversal)|34%|Medium|❤️|
+|106|[Construct Binary Tree from Inorder and Postorder Traversal](./Algorithms/106.construct-binary-tree-from-inorder-and-postorder-traversal)|33%|Medium|❤️|
+|107|[Binary Tree Level Order Traversal II](./Algorithms/107.binary-tree-level-order-traversal-ii)|42%|Easy||
+|108|[Convert Sorted Array to Binary Search Tree](./Algorithms/108.convert-sorted-array-to-binary-search-tree)|44%|Easy||
+|109|[Convert Sorted List to Binary Search Tree](./Algorithms/109.convert-sorted-list-to-binary-search-tree)|35%|Medium||
+|110|[Balanced Binary Tree](./Algorithms/110.balanced-binary-tree)|38%|Easy||
+|111|[Minimum Depth of Binary Tree](./Algorithms/111.minimum-depth-of-binary-tree)|33%|Easy||
+|112|[Path Sum](./Algorithms/112.path-sum)|34%|Easy||
+|113|[Path Sum II](./Algorithms/113.path-sum-ii)|35%|Medium||
+|114|[Flatten Binary Tree to Linked List](./Algorithms/114.flatten-binary-tree-to-linked-list)|36%|Medium|❤️|
+|115|[Distinct Subsequences](./Algorithms/115.distinct-subsequences)|32%|Hard|❤️|
+|118|[Pascal's Triangle](./Algorithms/118.pascals-triangle)|40%|Easy||
+|119|[Pascal's Triangle II](./Algorithms/119.pascals-triangle-ii)|38%|Easy||
+|120|[Triangle](./Algorithms/120.triangle)|34%|Medium|❤️|
+|121|[Best Time to Buy and Sell Stock](./Algorithms/121.best-time-to-buy-and-sell-stock)|42%|Easy||
+|122|[Best Time to Buy and Sell Stock II](./Algorithms/122.best-time-to-buy-and-sell-stock-ii)|47%|Easy||
+|123|[Best Time to Buy and Sell Stock III](./Algorithms/123.best-time-to-buy-and-sell-stock-iii)|30%|Hard||
+|124|[Binary Tree Maximum Path Sum](./Algorithms/124.binary-tree-maximum-path-sum)|27%|Hard|❤️|
+|125|[Valid Palindrome](./Algorithms/125.Valid-Palindrome)|27.0%|Easy||
+|126|[Word Ladder II](./Algorithms/126.word-ladder-ii)|14%|Hard|❤️|
+|127|[Word Ladder](./Algorithms/127.word-ladder)|20%|Medium|❤️|
+|128|[Longest Consecutive Sequence](./Algorithms/128.longest-consecutive-sequence)|38%|Hard||
+|129|[Sum Root to Leaf Numbers](./Algorithms/129.sum-root-to-leaf-numbers)|37%|Medium||
+|130|[Surrounded Regions](./Algorithms/130.surrounded-regions)|19%|Medium|❤️|
+|131|[Palindrome Partitioning](./Algorithms/131.palindrome-partitioning)|35%|Medium|❤️|
+|132|[Palindrome Partitioning II](./Algorithms/132.palindrome-partitioning-ii)|24%|Hard|❤️|
+|134|[Gas Station](./Algorithms/134.gas-station)|29%|Medium|❤️|
+|135|[Candy](./Algorithms/135.candy)|25%|Hard||
+|136|[Single Number](./Algorithms/136.single-number)|55%|Easy||
+|137|[Single Number II](./Algorithms/137.single-number-ii)|42%|Medium|❤️|
+|139|[Word Break](./Algorithms/139.word-break)|31%|Medium|❤️|
+|140|[Word Break II](./Algorithms/140.word-break-ii)|24%|Hard|❤️|
+|141|[Linked List Cycle](./Algorithms/140.Linked-List-Cycle)|24%|Hard|❤️|
+|142|[Linked List Cycle II](./Algorithms/140.Linked-List-Cycle-II)|24%|Hard|❤️|
+|143|[Reorder List](./Algorithms/143.reorder-list)|26%|Medium|❤️|
+|144|[Binary Tree Preorder Traversal](./Algorithms/144.binary-tree-preorder-traversal)|46%|Medium|❤️|
+|145|[Binary Tree Postorder Traversal](./Algorithms/145.binary-tree-postorder-traversal)|42%|Hard||
+|146|[LRU Cache](./Algorithms/146.lru-cache)|19%|Hard|❤️|
+|147|[Insertion Sort List](./Algorithms/147.insertion-sort-list)|33%|Medium|❤️|
+|148|[Sort List](./Algorithms/148.sort-list)|29%|Medium|❤️|
+|149|[Max Points on a Line](./Algorithms/149.max-points-on-a-line)|15%|Hard|❤️|
+|150|[Evaluate Reverse Polish Notation](./Algorithms/150.evaluate-reverse-polish-notation)|28%|Medium||
+|152|[Maximum Product Subarray](./Algorithms/152.maximum-product-subarray)|26%|Medium|❤️|
+|153|[Find Minimum in Rotated Sorted Array](./Algorithms/153.find-minimum-in-rotated-sorted-array)|40%|Medium||
+|154|[Find Minimum in Rotated Sorted Array II](./Algorithms/154.find-minimum-in-rotated-sorted-array-ii)|37%|Hard||
+|155|[Min Stack](./Algorithms/155.min-stack)|31%|Easy||
+|162|[Find Peak Element](./Algorithms/162.find-peak-element)|38%|Medium||
+|164|[Maximum Gap](./Algorithms/164.maximum-gap)|30%|Hard||
+|165|[Compare Version Numbers](./Algorithms/165.compare-version-numbers)|20%|Medium||
+|166|[Fraction to Recurring Decimal](./Algorithms/166.fraction-to-recurring-decimal)|18%|Medium|❤️|
+|167|[Two Sum II - Input array is sorted](./Algorithms/167.two-sum-ii-input-array-is-sorted)|47%|Easy||
+|168|[Excel Sheet Column Title](./Algorithms/168.excel-sheet-column-title)|27%|Easy|❤️|
+|169|[Majority Element](./Algorithms/169.majority-element)|48%|Easy|❤️|
+|171|[Excel Sheet Column Number](./Algorithms/171.excel-sheet-column-number)|48%|Easy||
+|172|[Factorial Trailing Zeroes](./Algorithms/172.factorial-trailing-zeroes)|36%|Easy||
+|174|[Dungeon Game](./Algorithms/174.dungeon-game)|24%|Hard|❤️|
+|179|[Largest Number](./Algorithms/179.largest-number)|23%|Medium|❤️|
+|187|[Repeated DNA Sequences](./Algorithms/187.repeated-dna-sequences)|33%|Medium||
+|188|[Best Time to Buy and Sell Stock IV](./Algorithms/188.best-time-to-buy-and-sell-stock-iv)|24%|Hard|❤️|
+|189|[Rotate Array](./Algorithms/189.rotate-array)|25%|Easy||
+|198|[House Robber](./Algorithms/198.house-robber)|39%|Easy|❤️|
+|199|[Binary Tree Right Side View](./Algorithms/199.binary-tree-right-side-view)|42%|Medium||
+|200|[Number of Islands](./Algorithms/200.number-of-islands)|36%|Medium||
+|201|[Bitwise AND of Numbers Range](./Algorithms/201.bitwise-and-of-numbers-range)|34%|Medium|❤️|
+|202|[Happy Number](./Algorithms/202.happy-number)|41%|Easy||
+|203|[Remove Linked List Elements](./Algorithms/203.remove-linked-list-elements)|33%|Easy||
+|204|[Count Primes](./Algorithms/204.count-primes)|26%|Easy|❤️|
+|205|[Isomorphic Strings](./Algorithms/205.isomorphic-strings)|34%|Easy|❤️|
+|206|[Reverse Linked List](./Algorithms/206.Reverse-Linked-List)|46%|Easy||
+|207|[Course Schedule](./Algorithms/207.course-schedule)|33%|Medium|❤️|
+|208|[Implement Trie (Prefix Tree)](./Algorithms/208.implement-trie-prefix-tree)|30%|Medium|❤️|
+|209|[Minimum Size Subarray Sum](./Algorithms/209.minimum-size-subarray-sum)|32%|Medium||
+|210|[Course Schedule II](./Algorithms/210.course-schedule-ii)|30%|Medium||
+|211|[Add and Search Word - Data structure design](./Algorithms/211.add-and-search-word-data-structure-design)|25%|Medium|❤️|
+|212|[Word Search II](./Algorithms/212.word-search-ii)|24%|Hard|❤️|
+|213|[House Robber II](./Algorithms/213.house-robber-ii)|34%|Medium||
+|214|[Shortest Palindrome](./Algorithms/214.shortest-palindrome)|25%|Hard|❤️|
+|215|[Kth Largest Element in an Array](./Algorithms/215.kth-largest-element-in-an-array)|40%|Medium|❤️|
+|216|[Combination Sum III](./Algorithms/216.combination-sum-iii)|47%|Medium||
+|217|[Contains Duplicate](./Algorithms/217.contains-duplicate)|47%|Easy||
+|218|[The Skyline Problem](./Algorithms/218.the-skyline-problem)|29%|Hard|❤️|
+|219|[Contains Duplicate II](./Algorithms/219.contains-duplicate-ii)|32%|Easy||
+|220|[Contains Duplicate III](./Algorithms/220.contains-duplicate-iii)|18%|Medium|❤️|
+|221|[Maximal Square](./Algorithms/221.maximal-square)|30%|Medium|❤️|
+|223|[Rectangle Area](./Algorithms/223.rectangle-area)|33%|Medium||
+|224|[Basic Calculator](./Algorithms/224.basic-calculator)|28%|Hard||
+|225|[Implement Stack using Queues](./Algorithms/225.implement-stack-using-queues)|34%|Easy||
+|226|[Invert Binary Tree](./Algorithms/226.invert-binary-tree)|53%|Easy||
+|227|[Basic Calculator II](./Algorithms/227.basic-calculator-ii)|30%|Medium||
+|228|[Summary Ranges](./Algorithms/228.summary-ranges)|32%|Medium||
+|229|[Majority Element II](./Algorithms/229.majority-element-ii)|29%|Medium|❤️|
+|230|[Kth Smallest Element in a BST](./Algorithms/230.kth-smallest-element-in-a-bst)|45%|Medium||
+|231|[Power of Two](./Algorithms/231.power-of-two)|40%|Easy||
+|232|[Implement Queue using Stacks](./Algorithms/232.implement-queue-using-stacks)|38%|Easy||
+|233|[Number of Digit One](./Algorithms/233.number-of-digit-one)|29%|Hard|❤️|
+|234|[Palindrome Linked List](./Algorithms/234.palindrome-linked-list)|33%|Easy||
+|238|[Product of Array Except Self](./Algorithms/238.product-of-array-except-self)|50%|Medium||
+|239|[Sliding Window Maximum](./Algorithms/239.sliding-window-maximum)|34%|Hard|❤️|
+|240|[Search a 2D Matrix II](./Algorithms/240.search-a-2d-matrix-ii)|39%|Medium|❤️|
+|241|[Different Ways to Add Parentheses](./Algorithms/241.different-ways-to-add-parentheses)|46%|Medium||
+|242|[Valid Anagram](./Algorithms/242.valid-anagram)|47%|Easy||
+|257|[Binary Tree Paths](./Algorithms/257.binary-tree-paths)|41%|Easy||
+|258|[Add Digits](./Algorithms/258.add-digits)|51%|Easy||
+|260|[Single Number III](./Algorithms/260.single-number-iii)|53%|Medium|❤️|
+|263|[Ugly Number](./Algorithms/263.ugly-number)|39%|Easy||
+|264|[Ugly Number II](./Algorithms/264.ugly-number-ii)|33%|Medium|❤️|
+|268|[Missing Number](./Algorithms/268.missing-number)|45%|Easy||
+|273|[Integer to English Words](./Algorithms/273.integer-to-english-words)|22%|Hard|❤️|
+|274|[H-Index](./Algorithms/274.h-index)|33%|Medium||
+|275|[H-Index II](./Algorithms/275.h-index-ii)|34%|Medium|❤️|
+|279|[Perfect Squares](./Algorithms/279.perfect-squares)|37%|Medium|❤️|
+|282|[Expression Add Operators](./Algorithms/282.expression-add-operators)|30%|Hard|❤️|
+|283|[Move Zeroes](./Algorithms/283.move-zeroes)|51%|Easy||
+|287|[Find the Duplicate Number](./Algorithms/287.find-the-duplicate-number)|44%|Medium|❤️|
+|289|[Game of Life](./Algorithms/289.game-of-life)|37%|Medium|❤️|
+|290|[Word Pattern](./Algorithms/290.word-pattern)|33%|Easy||
+|292|[Nim Game](./Algorithms/292.nim-game)|55%|Easy|❤️|
+|295|[Find Median from Data Stream](./Algorithms/295.find-median-from-data-stream)|29%|Hard|❤️|
+|299|[Bulls and Cows](./Algorithms/299.bulls-and-cows)|35%|Medium||
+|300|[Longest Increasing Subsequence](./Algorithms/300.longest-increasing-subsequence)|38%|Medium|❤️|
+|301|[Remove Invalid Parentheses](./Algorithms/301.remove-invalid-parentheses)|35%|Hard|❤️|
+|303|[Range Sum Query - Immutable](./Algorithms/303.range-sum-query-immutable)|32%|Easy||
+|304|[Range Sum Query 2D - Immutable](./Algorithms/304.range-sum-query-2d-immutable)|27%|Medium||
+|306|[Additive Number](./Algorithms/306.additive-number)|27%|Medium||
+|307|[Range Sum Query - Mutable](./Algorithms/307.range-sum-query-mutable)|22%|Medium||
+|309|[Best Time to Buy and Sell Stock with Cooldown](./Algorithms/309.best-time-to-buy-and-sell-stock-with-cooldown)|41%|Medium|❤️|
+|310|[Minimum Height Trees](./Algorithms/310.minimum-height-trees)|28%|Medium||
+|312|[Burst Balloons](./Algorithms/312.burst-balloons)|43%|Hard|❤️|
+|313|[Super Ugly Number](./Algorithms/313.super-ugly-number)|38%|Medium|❤️|
+|315|[Count of Smaller Numbers After Self](./Algorithms/315.count-of-smaller-numbers-after-self)|34%|Hard|❤️|
+|316|[Remove Duplicate Letters](./Algorithms/316.remove-duplicate-letters)|30%|Hard|❤️|
+|318|[Maximum Product of Word Lengths](./Algorithms/318.maximum-product-of-word-lengths)|45%|Medium|❤️|
+|319|[Bulb Switcher](./Algorithms/319.bulb-switcher)|42%|Medium|❤️|
+|321|[Create Maximum Number](./Algorithms/321.create-maximum-number)|24%|Hard|❤️|
+|322|[Coin Change](./Algorithms/322.coin-change)|26%|Medium|❤️|
+|324|[Wiggle Sort II](./Algorithms/324.wiggle-sort-ii)|26%|Medium||
+|326|[Power of Three](./Algorithms/326.power-of-three)|40%|Easy|❤️|
+|327|[Count of Range Sum](./Algorithms/327.count-of-range-sum)|30%|Hard|❤️|
+|328|[Odd Even Linked List](./Algorithms/328.odd-even-linked-list)|44%|Medium|❤️|
+|329|[Longest Increasing Path in a Matrix](./Algorithms/329.longest-increasing-path-in-a-matrix)|37%|Hard|❤️|
+|330|[Patching Array](./Algorithms/330.patching-array)|32%|Hard||
+|331|[Verify Preorder Serialization of a Binary Tree](./Algorithms/331.verify-preorder-serialization-of-a-binary-tree)|37%|Medium|❤️|
+|332|[Reconstruct Itinerary](./Algorithms/332.reconstruct-itinerary)|29%|Medium|❤️|
+|334|[Increasing Triplet Subsequence](./Algorithms/334.increasing-triplet-subsequence)|39%|Medium|❤️|
+|335|[Self Crossing](./Algorithms/335.self-crossing)|26%|Hard||
+|336|[Palindrome Pairs](./Algorithms/336.palindrome-pairs)|27%|Hard|❤️|
+|337|[House Robber III](./Algorithms/337.house-robber-iii)|44%|Medium|❤️|
+|338|[Counting Bits](./Algorithms/338.counting-bits)|62%|Medium||
+|342|[Power of Four](./Algorithms/342.power-of-four)|39%|Easy||
+|343|[Integer Break](./Algorithms/343.integer-break)|46%|Medium||
+|344|[Reverse String](./Algorithms/344.reverse-string)|60%|Easy||
+|345|[Reverse Vowels of a String](./Algorithms/345.reverse-vowels-of-a-string)|39%|Easy||
+|347|[Top K Frequent Elements](./Algorithms/347.top-k-frequent-elements)|49%|Medium||
+|349|[Intersection of Two Arrays](./Algorithms/349.intersection-of-two-arrays)|48%|Easy||
+|350|[Intersection of Two Arrays II](./Algorithms/350.intersection-of-two-arrays-ii)|44%|Easy|❤️|
+|352|[Data Stream as Disjoint Intervals](./Algorithms/352.data-stream-as-disjoint-intervals)|41%|Hard||
+|354|[Russian Doll Envelopes](./Algorithms/354.russian-doll-envelopes)|32%|Hard|❤️|
+|355|[Design Twitter](./Algorithms/355.design-twitter)|25%|Medium|❤️|
+|357|[Count Numbers with Unique Digits](./Algorithms/357.count-numbers-with-unique-digits)|46%|Medium|❤️|
+|363|[Max Sum of Rectangle No Larger Than K](./Algorithms/363.max-sum-of-rectangle-no-larger-than-k)|33%|Hard|❤️|
+|365|[Water and Jug Problem](./Algorithms/365.water-and-jug-problem)|28%|Medium|❤️|
+|367|[Valid Perfect Square](./Algorithms/367.valid-perfect-square)|38%|Easy||
+|368|[Largest Divisible Subset](./Algorithms/368.largest-divisible-subset)|33%|Medium|❤️|
+|371|[Sum of Two Integers](./Algorithms/371.sum-of-two-integers)|50%|Easy|❤️|
+|372|[Super Pow](./Algorithms/372.super-pow)|34%|Medium||
+|373|[Find K Pairs with Smallest Sums](./Algorithms/373.find-k-pairs-with-smallest-sums)|31%|Medium|❤️|
+|375|[Guess Number Higher or Lower II](./Algorithms/375.guess-number-higher-or-lower-ii)|36%|Medium||
+|376|[Wiggle Subsequence](./Algorithms/376.wiggle-subsequence)|36%|Medium|❤️|
+|377|[Combination Sum IV](./Algorithms/377.combination-sum-iv)|42%|Medium||
+|378|[Kth Smallest Element in a Sorted Matrix](./Algorithms/378.kth-smallest-element-in-a-sorted-matrix)|45%|Medium|❤️|
+|380|[Insert Delete GetRandom O(1)](./Algorithms/380.insert-delete-getrandom-o1)|39%|Medium|❤️|
+|381|[Insert Delete GetRandom O(1) - Duplicates allowed](./Algorithms/381.insert-delete-getrandom-o1-duplicates-allowed)|29%|Hard|❤️|
+|382|[Linked List Random Node](./Algorithms/382.linked-list-random-node)|47%|Medium||
+|383|[Ransom Note](./Algorithms/383.ransom-note)|47%|Easy||
+|384|[Shuffle an Array](./Algorithms/384.shuffle-an-array)|47%|Medium|❤️|
+|385|[Mini Parser](./Algorithms/385.mini-parser)|30%|Medium|❤️|
+|387|[First Unique Character in a String](./Algorithms/387.first-unique-character-in-a-string)|47%|Easy||
+|388|[Longest Absolute File Path](./Algorithms/388.longest-absolute-file-path)|37%|Medium||
+|389|[Find the Difference](./Algorithms/389.find-the-difference)|51%|Easy||
+|390|[Elimination Game](./Algorithms/390.elimination-game)|42%|Medium|❤️|
+|391|[Perfect Rectangle](./Algorithms/391.perfect-rectangle)|27%|Hard||
+|392|[Is Subsequence](./Algorithms/392.is-subsequence)|44%|Medium|❤️|
+|393|[UTF-8 Validation](./Algorithms/393.utf-8-validation)|34%|Medium|❤️|
+|394|[Decode String](./Algorithms/394.decode-string)|42%|Medium||
+|395|[Longest Substring with At Least K Repeating Characters](./Algorithms/395.longest-substring-with-at-least-k-repeating-characters)|35%|Medium||
+|396|[Rotate Function](./Algorithms/396.rotate-function)|33%|Medium|❤️|
+|397|[Integer Replacement](./Algorithms/397.integer-replacement)|30%|Medium|❤️|
+|398|[Random Pick Index](./Algorithms/398.random-pick-index)|44%|Medium||
+|399|[Evaluate Division](./Algorithms/399.evaluate-division)|42%|Medium|❤️|
+|400|[Nth Digit](./Algorithms/400.nth-digit)|30%|Easy|❤️|
+|401|[Binary Watch](./Algorithms/401.binary-watch)|44%|Easy||
+|402|[Remove K Digits](./Algorithms/402.remove-k-digits)|25%|Medium|❤️|
+|403|[Frog Jump](./Algorithms/403.frog-jump)|32%|Hard|❤️|
+|404|[Sum of Left Leaves](./Algorithms/404.sum-of-left-leaves)|47%|Easy||
+|405|[Convert a Number to Hexadecimal](./Algorithms/405.convert-a-number-to-hexadecimal)|41%|Easy||
+|406|[Queue Reconstruction by Height](./Algorithms/406.queue-reconstruction-by-height)|56%|Medium|❤️|
+|407|[Trapping Rain Water II](./Algorithms/407.trapping-rain-water-ii)|37%|Hard||
+|409|[Longest Palindrome](./Algorithms/409.longest-palindrome)|45%|Easy||
+|410|[Split Array Largest Sum](./Algorithms/410.split-array-largest-sum)|39%|Hard||
+|412|[Fizz Buzz](./Algorithms/412.Fizz-Buzz)|58%|Easy||
+|413|[Arithmetic Slices](./Algorithms/413.arithmetic-slices)|54%|Medium||
+|414|[Third Maximum Number](./Algorithms/414.third-maximum-number)|28%|Easy||
+|415|[Add Strings](./Algorithms/415.add-strings)|41%|Easy||
+|416|[Partition Equal Subset Sum](./Algorithms/416.partition-equal-subset-sum)|38%|Medium|❤️|
+|417|[Pacific Atlantic Water Flow](./Algorithms/417.pacific-atlantic-water-flow)|34%|Medium||
+|419|[Battleships in a Board](./Algorithms/419.battleships-in-a-board)|63%|Medium||
+|420|[Strong Password Checker](./Algorithms/420.strong-password-checker)|19%|Hard|❤️|
+|421|[Maximum XOR of Two Numbers in an Array](./Algorithms/421.maximum-xor-of-two-numbers-in-an-array)|47%|Medium|❤️|
+|423|[Reconstruct Original Digits from English](./Algorithms/423.reconstruct-original-digits-from-english)|44%|Medium||
+|424|[Longest Repeating Character Replacement](./Algorithms/424.longest-repeating-character-replacement)|42%|Medium|❤️|
+|432|[All O`one Data Structure](./Algorithms/432.all-oone-data-structure)|27%|Hard|❤️|
+|434|[Number of Segments in a String](./Algorithms/434.number-of-segments-in-a-string)|36%|Easy||
+|435|[Non-overlapping Intervals](./Algorithms/435.non-overlapping-intervals)|41%|Medium|❤️|
+|436|[Find Right Interval](./Algorithms/436.find-right-interval)|41%|Medium||
+|437|[Path Sum III](./Algorithms/437.path-sum-iii)|40%|Easy|❤️|
+|438|[Find All Anagrams in a String](./Algorithms/438.find-all-anagrams-in-a-string)|33%|Easy||
+|440|[K-th Smallest in Lexicographical Order](./Algorithms/440.k-th-smallest-in-lexicographical-order)|25%|Hard|❤️|
+|441|[Arranging Coins](./Algorithms/441.arranging-coins)|36%|Easy||
+|442|[Find All Duplicates in an Array](./Algorithms/442.find-all-duplicates-in-an-array)|56%|Medium||
+|443|[String Compression](./Algorithms/443.string-compression)|35%|Easy|❤️|
+|445|[Add Two Numbers II](./Algorithms/445.add-two-numbers-ii)|46%|Medium|❤️|
+|446|[Arithmetic Slices II - Subsequence](./Algorithms/446.arithmetic-slices-ii-subsequence)|28%|Hard|❤️|
+|447|[Number of Boomerangs](./Algorithms/447.number-of-boomerangs)|46%|Easy||
+|448|[Find All Numbers Disappeared in an Array](./Algorithms/448.find-all-numbers-disappeared-in-an-array)|51%|Easy||
+|450|[Delete Node in a BST](./Algorithms/450.delete-node-in-a-bst)|37%|Medium|❤️|
+|451|[Sort Characters By Frequency](./Algorithms/451.sort-characters-by-frequency)|51%|Medium||
+|452|[Minimum Number of Arrows to Burst Balloons](./Algorithms/452.minimum-number-of-arrows-to-burst-balloons)|44%|Medium||
+|453|[Minimum Moves to Equal Array Elements](./Algorithms/453.minimum-moves-to-equal-array-elements)|48%|Easy||
+|454|[4Sum II](./Algorithms/454.4sum-ii)|47%|Medium||
+|455|[Assign Cookies](./Algorithms/455.assign-cookies)|47%|Easy||
+|456|[132 Pattern](./Algorithms/456.132-pattern)|27%|Medium|❤️|
+|459|[Repeated Substring Pattern](./Algorithms/459.repeated-substring-pattern)|38%|Easy|❤️|
+|460|[LFU Cache](./Algorithms/460.lfu-cache)|25%|Hard||
+|461|[Hamming Distance](./Algorithms/461.hamming-distance)|69%|Easy||
+|462|[Minimum Moves to Equal Array Elements II](./Algorithms/462.minimum-moves-to-equal-array-elements-ii)|51%|Medium||
+|463|[Island Perimeter](./Algorithms/463.island-perimeter)|57%|Easy||
+|464|[Can I Win](./Algorithms/464.can-i-win)|25%|Medium|❤️|
+|466|[Count The Repetitions](./Algorithms/466.count-the-repetitions)|27%|Hard|❤️|
+|467|[Unique Substrings in Wraparound String](./Algorithms/467.unique-substrings-in-wraparound-string)|33%|Medium|❤️|
+|468|[Validate IP Address](./Algorithms/468.validate-ip-address)|20%|Medium||
+|472|[Concatenated Words](./Algorithms/472.concatenated-words)|30%|Hard||
+|473|[Matchsticks to Square](./Algorithms/473.matchsticks-to-square)|35%|Medium|❤️|
+|474|[Ones and Zeroes](./Algorithms/474.ones-and-zeroes)|38%|Medium||
+|475|[Heaters](./Algorithms/475.heaters)|29%|Easy||
+|476|[Number Complement](./Algorithms/476.number-complement)|61%|Easy||
+|477|[Total Hamming Distance](./Algorithms/477.total-hamming-distance)|47%|Medium|❤️|
+|479|[Largest Palindrome Product](./Algorithms/479.largest-palindrome-product)|25%|Easy||
+|480|[Sliding Window Median](./Algorithms/480.sliding-window-median)|30%|Hard|❤️|
+|481|[Magical String](./Algorithms/481.magical-string)|45%|Medium||
+|482|[License Key Formatting](./Algorithms/482.license-key-formatting)|39%|Easy||
+|483|[Smallest Good Base](./Algorithms/483.smallest-good-base)|33%|Hard|❤️|
+|485|[Max Consecutive Ones](./Algorithms/485.max-consecutive-ones)|53%|Easy||
+|486|[Predict the Winner](./Algorithms/486.predict-the-winner)|45%|Medium||
+|488|[Zuma Game](./Algorithms/488.zuma-game)|37%|Hard|❤️|
+|491|[Increasing Subsequences](./Algorithms/491.increasing-subsequences)|38%|Medium|❤️|
+|492|[Construct the Rectangle](./Algorithms/492.construct-the-rectangle)|48%|Easy|❤️|
+|493|[Reverse Pairs](./Algorithms/493.reverse-pairs)|20%|Hard||
+|494|[Target Sum](./Algorithms/494.target-sum)|43%|Medium|❤️|
+|495|[Teemo Attacking](./Algorithms/495.teemo-attacking)|51%|Medium||
+|496|[Next Greater Element I](./Algorithms/496.next-greater-element-i)|56%|Easy||
+|498|[Diagonal Traverse](./Algorithms/498.diagonal-traverse)|46%|Medium||
+|500|[Keyboard Row](./Algorithms/500.keyboard-row)|59%|Easy||
+|501|[Find Mode in Binary Search Tree](./Algorithms/501.find-mode-in-binary-search-tree)|37%|Easy|❤️|
+|502|[IPO](./Algorithms/502.ipo)|36%|Hard||
+|503|[Next Greater Element II](./Algorithms/503.next-greater-element-ii)|48%|Medium|❤️|
+|504|[Base 7](./Algorithms/504.base-7)|43%|Easy||
+|506|[Relative Ranks](./Algorithms/506.relative-ranks)|46%|Easy||
+|507|[Perfect Number](./Algorithms/507.perfect-number)|32%|Easy||
+|508|[Most Frequent Subtree Sum](./Algorithms/508.most-frequent-subtree-sum)|52%|Medium||
+|513|[Find Bottom Left Tree Value](./Algorithms/513.find-bottom-left-tree-value)|56%|Medium||
+|514|[Freedom Trail](./Algorithms/514.freedom-trail)|39%|Hard||
+|515|[Find Largest Value in Each Tree Row](./Algorithms/515.find-largest-value-in-each-tree-row)|55%|Medium||
+|516|[Longest Palindromic Subsequence](./Algorithms/516.longest-palindromic-subsequence)|42%|Medium|❤️|
+|517|[Super Washing Machines](./Algorithms/517.super-washing-machines)|36%|Hard|❤️|
+|520|[Detect Capital](./Algorithms/520.detect-capital)|51%|Easy||
+|521|[Longest Uncommon Subsequence I](./Algorithms/521.longest-uncommon-subsequence-i)|55%|Easy||
+|522|[Longest Uncommon Subsequence II](./Algorithms/522.longest-uncommon-subsequence-ii)|31%|Medium||
+|523|[Continuous Subarray Sum](./Algorithms/523.continuous-subarray-sum)|23%|Medium|❤️|
+|524|[Longest Word in Dictionary through Deleting](./Algorithms/524.longest-word-in-dictionary-through-deleting)|43%|Medium||
+|525|[Contiguous Array](./Algorithms/525.contiguous-array)|41%|Medium|❤️|
+|526|[Beautiful Arrangement](./Algorithms/526.beautiful-arrangement)|53%|Medium|❤️|
+|529|[Minesweeper](./Algorithms/529.minesweeper)|49%|Medium||
+|530|[Minimum Absolute Difference in BST](./Algorithms/530.minimum-absolute-difference-in-bst)|47%|Easy|❤️|
+|532|[K-diff Pairs in an Array](./Algorithms/532.k-diff-pairs-in-an-array)|28%|Easy||
+|537|[Complex Number Multiplication](./Algorithms/537.complex-number-multiplication)|63%|Medium||
+|538|[Convert BST to Greater Tree](./Algorithms/538.convert-bst-to-greater-tree)|48%|Easy||
+|539|[Minimum Time Difference](./Algorithms/539.minimum-time-difference)|46%|Medium||
+|540|[Single Element in a Sorted Array](./Algorithms/540.single-element-in-a-sorted-array)|55%|Medium||
+|541|[Reverse String II](./Algorithms/541.reverse-string-ii)|43%|Easy||
+|542|[01 Matrix](./Algorithms/542.01-matrix)|33%|Medium|❤️|
+|543|[Diameter of Binary Tree](./Algorithms/543.diameter-of-binary-tree)|44%|Easy||
+|546|[Remove Boxes](./Algorithms/546.remove-boxes)|35%|Hard|❤️|
+|547|[Friend Circles](./Algorithms/547.friend-circles)|49%|Medium|❤️|
+|551|[Student Attendance Record I](./Algorithms/551.student-attendance-record-i)|44%|Easy||
+|552|[Student Attendance Record II](./Algorithms/552.student-attendance-record-ii)|31%|Hard|❤️|
+|553|[Optimal Division](./Algorithms/553.optimal-division)|55%|Medium||
+|554|[Brick Wall](./Algorithms/554.brick-wall)|46%|Medium||
+|556|[Next Greater Element III](./Algorithms/556.next-greater-element-iii)|28%|Medium||
+|557|[Reverse Words in a String III](./Algorithms/557.reverse-words-in-a-string-iii)|60%|Easy||
+|560|[Subarray Sum Equals K](./Algorithms/560.subarray-sum-equals-k)|39%|Medium|❤️|
+|561|[Array Partition I](./Algorithms/561.array-partition-i)|66%|Easy||
+|563|[Binary Tree Tilt](./Algorithms/563.binary-tree-tilt)|47%|Easy||
+|564|[Find the Closest Palindrome](./Algorithms/564.find-the-closest-palindrome)|17%|Hard||
+|565|[Array Nesting](./Algorithms/565.array-nesting)|49%|Medium||
+|566|[Reshape the Matrix](./Algorithms/566.reshape-the-matrix)|57%|Easy||
+|567|[Permutation in String](./Algorithms/567.permutation-in-string)|36%|Medium||
+|572|[Subtree of Another Tree](./Algorithms/572.subtree-of-another-tree)|40%|Easy|❤️|
+|575|[Distribute Candies](./Algorithms/575.distribute-candies)|57%|Easy||
+|576|[Out of Boundary Paths](./Algorithms/576.out-of-boundary-paths)|30%|Medium|❤️|
+|581|[Shortest Unsorted Continuous Subarray](./Algorithms/581.shortest-unsorted-continuous-subarray)|29%|Easy|❤️|
+|583|[Delete Operation for Two Strings](./Algorithms/583.delete-operation-for-two-strings)|44%|Medium|❤️|
+|587|[Erect the Fence](./Algorithms/587.erect-the-fence)|33%|Hard|❤️|
+|591|[Tag Validator](./Algorithms/591.tag-validator)|31%|Hard|❤️|
+|592|[Fraction Addition and Subtraction](./Algorithms/592.fraction-addition-and-subtraction)|46%|Medium||
+|593|[Valid Square](./Algorithms/593.valid-square)|39%|Medium||
+|594|[Longest Harmonious Subsequence](./Algorithms/594.longest-harmonious-subsequence)|40%|Easy||
+|598|[Range Addition II](./Algorithms/598.range-addition-ii)|48%|Easy||
+|599|[Minimum Index Sum of Two Lists](./Algorithms/599.minimum-index-sum-of-two-lists)|46%|Easy||
+|600|[Non-negative Integers without Consecutive Ones](./Algorithms/600.non-negative-integers-without-consecutive-ones)|31%|Hard|❤️|
+|605|[Can Place Flowers](./Algorithms/605.can-place-flowers)|30%|Easy|❤️|
+|606|[Construct String from Binary Tree](./Algorithms/606.construct-string-from-binary-tree)|49%|Easy||
+|609|[Find Duplicate File in System](./Algorithms/609.find-duplicate-file-in-system)|52%|Medium||
+|611|[Valid Triangle Number](./Algorithms/611.valid-triangle-number)|42%|Medium|❤️|
+|617|[Merge Two Binary Trees](./Algorithms/617.merge-two-binary-trees)|67%|Easy||
+|621|[Task Scheduler](./Algorithms/621.task-scheduler)|42%|Medium|❤️|
+|623|[Add One Row to Tree](./Algorithms/623.add-one-row-to-tree)|46%|Medium||
+|628|[Maximum Product of Three Numbers](./Algorithms/628.maximum-product-of-three-numbers)|44%|Easy|❤️|
+|629|[K Inverse Pairs Array](./Algorithms/629.k-inverse-pairs-array)|27%|Hard||
+|630|[Course Schedule III](./Algorithms/630.course-schedule-iii)|29%|Hard|❤️|
+|632|[Smallest Range](./Algorithms/632.smallest-range)|41%|Hard||
+|633|[Sum of Square Numbers](./Algorithms/633.sum-of-square-numbers)|32%|Easy||
+|636|[Exclusive Time of Functions](./Algorithms/636.exclusive-time-of-functions)|44%|Medium|❤️|
+|637|[Average of Levels in Binary Tree](./Algorithms/637.average-of-levels-in-binary-tree)|55%|Easy||
+|638|[Shopping Offers](./Algorithms/638.shopping-offers)|45%|Medium|❤️|
+|639|[Decode Ways II](./Algorithms/639.decode-ways-ii)|24%|Hard||
+|640|[Solve the Equation](./Algorithms/640.solve-the-equation)|38%|Medium||
+|643|[Maximum Average Subarray I](./Algorithms/643.maximum-average-subarray-i)|37%|Easy||
+|645|[Set Mismatch](./Algorithms/645.set-mismatch)|39%|Easy|❤️|
+|646|[Maximum Length of Pair Chain](./Algorithms/646.maximum-length-of-pair-chain)|47%|Medium||
+|647|[Palindromic Substrings](./Algorithms/647.palindromic-substrings)|54%|Medium|❤️|
+|648|[Replace Words](./Algorithms/648.replace-words)|47%|Medium||
+|649|[Dota2 Senate](./Algorithms/649.dota2-senate)|36%|Medium|❤️|
+|650|[2 Keys Keyboard](./Algorithms/650.2-keys-keyboard)|44%|Medium||
+|652|[Find Duplicate Subtrees](./Algorithms/652.find-duplicate-subtrees)|36%|Medium||
+|653|[Two Sum IV - Input is a BST](./Algorithms/653.two-sum-iv-input-is-a-bst)|49%|Easy||
+|654|[Maximum Binary Tree](./Algorithms/654.maximum-binary-tree)|69%|Medium|❤️|
+|655|[Print Binary Tree](./Algorithms/655.print-binary-tree)|49%|Medium||
+|657|[Judge Route Circle](./Algorithms/657.judge-route-circle)|68%|Easy||
+|658|[Find K Closest Elements](./Algorithms/658.find-k-closest-elements)|34%|Medium|❤️|
+|659|[Split Array into Consecutive Subsequences](./Algorithms/659.split-array-into-consecutive-subsequences)|36%|Medium|❤️|
+|661|[Image Smoother](./Algorithms/661.image-smoother)|46%|Easy||
+|662|[Maximum Width of Binary Tree](./Algorithms/662.maximum-width-of-binary-tree)|37%|Medium||
+|664|[Strange Printer](./Algorithms/664.strange-printer)|34%|Hard|❤️|
+|665|[Non-decreasing Array](./Algorithms/665.non-decreasing-array)|20%|Easy||
+|667|[Beautiful Arrangement II](./Algorithms/667.beautiful-arrangement-ii)|51%|Medium||
+|668|[Kth Smallest Number in Multiplication Table](./Algorithms/668.kth-smallest-number-in-multiplication-table)|40%|Hard||
+|669|[Trim a Binary Search Tree](./Algorithms/669.trim-a-binary-search-tree)|58%|Easy||
+|670|[Maximum Swap](./Algorithms/670.maximum-swap)|38%|Medium|❤️|
+|671|[Second Minimum Node In a Binary Tree](./Algorithms/671.second-minimum-node-in-a-binary-tree)|41%|Easy||
+|672|[Bulb Switcher II](./Algorithms/672.bulb-switcher-ii)|49%|Medium||
+|673|[Number of Longest Increasing Subsequence](./Algorithms/673.number-of-longest-increasing-subsequence)|31%|Medium|❤️|
+|674|[Longest Continuous Increasing Subsequence](./Algorithms/674.longest-continuous-increasing-subsequence)|42%|Easy||
+|675|[Cut Off Trees for Golf Event](./Algorithms/675.cut-off-trees-for-golf-event)|27%|Hard|❤️|
+|676|[Implement Magic Dictionary](./Algorithms/676.implement-magic-dictionary)|49%|Medium||
+|677|[Map Sum Pairs](./Algorithms/677.map-sum-pairs)|51%|Medium|❤️|
+|678|[Valid Parenthesis String](./Algorithms/678.valid-parenthesis-string)|29%|Medium|❤️|
+|679|[24 Game](./Algorithms/679.24-game)|38%|Hard|❤️|
+|680|[Valid Palindrome II](./Algorithms/680.valid-palindrome-ii)|32%|Easy||
+|682|[Baseball Game](./Algorithms/682.baseball-game)|58%|Easy||
+|684|[Redundant Connection](./Algorithms/684.redundant-connection)|43%|Medium||
+|685|[Redundant Connection II](./Algorithms/685.redundant-connection-ii)|27%|Hard|❤️|
+|686|[Repeated String Match](./Algorithms/686.repeated-string-match)|32%|Easy|❤️|
+|687|[Longest Univalue Path](./Algorithms/687.longest-univalue-path)|32%|Easy||
+|688|[Knight Probability in Chessboard](./Algorithms/688.knight-probability-in-chessboard)|39%|Medium||
+|689|[Maximum Sum of 3 Non-Overlapping Subarrays](./Algorithms/689.maximum-sum-of-3-non-overlapping-subarrays)|41%|Hard||
+|691|[Stickers to Spell Word](./Algorithms/691.stickers-to-spell-word)|34%|Hard|❤️|
+|692|[Top K Frequent Words](./Algorithms/692.top-k-frequent-words)|41%|Medium||
+|693|[Binary Number with Alternating Bits](./Algorithms/693.binary-number-with-alternating-bits)|55%|Easy||
+|695|[Max Area of Island](./Algorithms/695.max-area-of-island)|51%|Easy|❤️|
+|696|[Count Binary Substrings](./Algorithms/696.count-binary-substrings)|50%|Easy||
+|697|[Degree of an Array](./Algorithms/697.degree-of-an-array)|46%|Easy||
+|698|[Partition to K Equal Sum Subsets](./Algorithms/698.partition-to-k-equal-sum-subsets)|37%|Medium|❤️|
+|699|[Falling Squares](./Algorithms/699.falling-squares)|37%|Hard||
+|712|[Minimum ASCII Delete Sum for Two Strings](./Algorithms/712.minimum-ascii-delete-sum-for-two-strings)|51%|Medium|❤️|
+|713|[Subarray Product Less Than K](./Algorithms/713.subarray-product-less-than-k)|33%|Medium|❤️|
+|714|[Best Time to Buy and Sell Stock with Transaction Fee](./Algorithms/714.best-time-to-buy-and-sell-stock-with-transaction-fee)|45%|Medium|❤️|
+|715|[Range Module](./Algorithms/715.range-module)|31%|Hard||
+|717|[1-bit and 2-bit Characters](./Algorithms/717.1-bit-and-2-bit-characters)|49%|Easy||
+|718|[Maximum Length of Repeated Subarray](./Algorithms/718.maximum-length-of-repeated-subarray)|41%|Medium|❤️|
+|719|[Find K-th Smallest Pair Distance](./Algorithms/719.find-k-th-smallest-pair-distance)|27%|Hard|❤️|
+|720|[Longest Word in Dictionary](./Algorithms/720.longest-word-in-dictionary)|41%|Easy||
+|721|[Accounts Merge](./Algorithms/721.accounts-merge)|32%|Medium|❤️|
+|722|[Remove Comments](./Algorithms/722.remove-comments)|27%|Medium|❤️|
+|724|[Find Pivot Index](./Algorithms/724.find-pivot-index)|39%|Easy||
+|725|[Split Linked List in Parts](./Algorithms/725.split-linked-list-in-parts)|47%|Medium||
+|726|[Number of Atoms](./Algorithms/726.number-of-atoms)|43%|Hard|❤️|
+|728|[Self Dividing Numbers](./Algorithms/728.self-dividing-numbers)|66%|Easy||
+|729|[My Calendar I](./Algorithms/729.my-calendar-i)|42%|Medium||
+|730|[Count Different Palindromic Subsequences](./Algorithms/730.count-different-palindromic-subsequences)|34%|Hard|❤️|
+|731|[My Calendar II](./Algorithms/731.my-calendar-ii)|37%|Medium|❤️|
+|732|[My Calendar III](./Algorithms/732.my-calendar-iii)|50%|Hard||
+|733|[Flood Fill](./Algorithms/733.flood-fill)|47%|Easy||
+|735|[Asteroid Collision](./Algorithms/735.asteroid-collision)|37%|Medium||
+|736|[Parse Lisp Expression](./Algorithms/736.parse-lisp-expression)|42%|Hard|❤️|
+|738|[Monotone Increasing Digits](./Algorithms/738.monotone-increasing-digits)|40%|Medium||
+|739|[Daily Temperatures](./Algorithms/739.daily-temperatures)|52%|Medium|❤️|
+|740|[Delete and Earn](./Algorithms/740.delete-and-earn)|43%|Medium|❤️|
+|741|[Cherry Pickup](./Algorithms/741.cherry-pickup)|23%|Hard||
+|743|[Network Delay Time](./Algorithms/743.network-delay-time)|34%|Medium||
+|744|[Find Smallest Letter Greater Than Target](./Algorithms/744.find-smallest-letter-greater-than-target)|44%|Easy||
+|745|[Prefix and Suffix Search](./Algorithms/745.prefix-and-suffix-search)|25%|Hard||
+|746|[Min Cost Climbing Stairs](./Algorithms/746.min-cost-climbing-stairs)|43%|Easy||
+|747|[Largest Number At Least Twice of Others](./Algorithms/747.largest-number-at-least-twice-of-others)|41%|Easy||
+|748|[Shortest Completing Word](./Algorithms/748.shortest-completing-word)|51%|Medium||
+|749|[Contain Virus](./Algorithms/749.contain-virus)|39%|Hard||
+|752|[Open the Lock](./Algorithms/752.open-the-lock)|38%|Medium|❤️|
+|753|[Cracking the Safe](./Algorithms/753.cracking-the-safe)|39%|Hard|❤️|
+|754|[Reach a Number](./Algorithms/754.reach-a-number)|26%|Medium|❤️|
+|756|[Pyramid Transition Matrix](./Algorithms/756.pyramid-transition-matrix)|45%|Medium|❤️|
+|757|[Set Intersection Size At Least Two](./Algorithms/757.set-intersection-size-at-least-two)|34%|Hard||
+|761|[Special Binary String](./Algorithms/761.special-binary-string)|41%|Hard||
+|762|[Prime Number of Set Bits in Binary Representation](./Algorithms/762.prime-number-of-set-bits-in-binary-representation)|55%|Easy||
+|763|[Partition Labels](./Algorithms/763.partition-labels)|64%|Medium||
+|764|[Largest Plus Sign](./Algorithms/764.largest-plus-sign)|37%|Medium||
+|765|[Couples Holding Hands](./Algorithms/765.couples-holding-hands)|48%|Hard||
+|766|[Toeplitz Matrix](./Algorithms/766.toeplitz-matrix)|57%|Easy||
+|767|[Reorganize String](./Algorithms/767.reorganize-string)|35%|Medium||
+|768|[Max Chunks To Make Sorted II](./Algorithms/768.max-chunks-to-make-sorted-ii)|42%|Hard||
+|769|[Max Chunks To Make Sorted](./Algorithms/769.max-chunks-to-make-sorted)|47%|Medium||
+|770|[Basic Calculator IV](./Algorithms/770.basic-calculator-iv)|43%|Hard|❤️|
+|771|[Jewels and Stones](./Algorithms/771.jewels-and-stones)|82%|Easy||
+|773|[Sliding Puzzle](./Algorithms/773.sliding-puzzle)|47%|Hard||
+|775|[Global and Local Inversions](./Algorithms/775.global-and-local-inversions)|31%|Medium||
+|777|[Swap Adjacent in LR String](./Algorithms/777.swap-adjacent-in-lr-string)|27%|Medium||
+|778|[Swim in Rising Water](./Algorithms/778.swim-in-rising-water)|44%|Hard||
+|779|[K-th Symbol in Grammar](./Algorithms/779.k-th-symbol-in-grammar)|35%|Medium||
+|780|[Reaching Points](./Algorithms/780.reaching-points)|21%|Hard||
+|781|[Rabbits in Forest](./Algorithms/781.rabbits-in-forest)|49%|Medium||
+|782|[Transform to Chessboard](./Algorithms/782.transform-to-chessboard)|35%|Hard||
+|783|[Minimum Distance Between BST Nodes](./Algorithms/783.minimum-distance-between-bst-nodes)|47%|Easy||
+|784|[Letter Case Permutation](./Algorithms/784.letter-case-permutation)|52%|Easy|❤️|
+|785|[Is Graph Bipartite?](./Algorithms/785.is-graph-bipartite)|38%|Medium|❤️|
+|786|[K-th Smallest Prime Fraction](./Algorithms/786.k-th-smallest-prime-fraction)|29%|Hard|❤️|
+|787|[Cheapest Flights Within K Stops](./Algorithms/787.cheapest-flights-within-k-stops)|30%|Medium|❤️|
+|788|[Rotated Digits](./Algorithms/788.rotated-digits)|50%|Easy||
+|789|[Escape The Ghosts](./Algorithms/789.escape-the-ghosts)|47%|Medium||
+|790|[Domino and Tromino Tiling](./Algorithms/790.domino-and-tromino-tiling)|32%|Medium|❤️|
+|791|[Custom Sort String](./Algorithms/791.custom-sort-string)|60%|Medium||
+|792|[Number of Matching Subsequences](./Algorithms/792.number-of-matching-subsequences)|35%|Medium|❤️|
+|793| * Preimage Size of Factorial Zeroes Function|45%|Hard||
+|794| * Valid Tic-Tac-Toe State|27%|Medium||
+|795| * Number of Subarrays with Bounded Maximum|40%|Medium||
+|796| * Rotate String|54%|Easy||
+|797| * All Paths From Source to Target|69%|Medium||
+|798| * Smallest Rotation with Highest Score|31%|Hard||
+|799| * Champagne Tower|28%|Medium||
+|801| * Minimum Swaps To Make Sequences Increasing|23%|Medium||
+|802| * Find Eventual Safe States|35%|Medium||
+|803| * Bricks Falling When Hit|20%|Hard||
+|804| * Unique Morse Code Words|76%|Easy||
+|805| * Split Array With Same Average|19%|Hard||
+|806| * Number of Lines To Write String|64%|Easy||
+|807| * Max Increase to Keep City Skyline|82%|Medium||
+|808| * Soup Servings|30%|Medium||
+|809| * Expressive Words|34%|Medium||
+|810| * Chalkboard XOR Game|35%|Hard||
+|811| * Subdomain Visit Count|65%|Easy||
+|812| * Largest Triangle Area :new: |51%|Easy||
+|813| * Largest Sum of Averages :new: |37%|Medium||
+|814| * Binary Tree Pruning :new: |73%|Medium||
+|815| * Bus Routes :new: |30%|Hard||
+
+
+------------------------------------------------------------------
+
+以下免费的算法题,暂时不能使用 Go 解答
+
+- [116.Populating Next Right Pointers in Each Node](https://leetcode.com/problems/populating-next-right-pointers-in-each-node/)
+- [117.Populating Next Right Pointers in Each Node II](https://leetcode.com/problems/populating-next-right-pointers-in-each-node-ii/)
+- [133.Clone Graph](https://leetcode.com/problems/clone-graph/)
+- [138.Copy List with Random Pointer](https://leetcode.com/problems/copy-list-with-random-pointer/)
+- [141.Linked List Cycle](https://leetcode.com/problems/linked-list-cycle/)
+- [142.Linked List Cycle II](https://leetcode.com/problems/linked-list-cycle-ii/)
+- [151.Reverse Words in a String](https://leetcode.com/problems/reverse-words-in-a-string/)
+- [160.Intersection of Two Linked Lists](https://leetcode.com/problems/intersection-of-two-linked-lists/)
+- [173.Binary Search Tree Iterator](https://leetcode.com/problems/binary-search-tree-iterator/)
+- [190.Reverse Bits](https://leetcode.com/problems/reverse-bits/)
+- [191.Number of 1 Bits](https://leetcode.com/problems/number-of-1-bits/)
+- [222.Count Complete Tree Nodes](https://leetcode.com/problems/count-complete-tree-nodes/)
+- [235.Lowest Common Ancestor of a Binary Search Tree](https://leetcode.com/problems/lowest-common-ancestor-of-a-binary-search-tree/)
+- [236.Lowest Common Ancestor of a Binary Tree](https://leetcode.com/problems/lowest-common-ancestor-of-a-binary-tree/)
+- [237.Delete Node in a Linked List](https://leetcode.com/problems/delete-node-in-a-linked-list/)
+- [278.First Bad Version](https://leetcode.com/problems/first-bad-version/)
+- [284.Peeking Iterator](https://leetcode.com/problems/peeking-iterator/)
+- [297.Serialize and Deserialize Binary Tree](https://leetcode.com/problems/serialize-and-deserialize-binary-tree/)
+- [341.Flatten Nested List Iterator](https://leetcode.com/problems/flatten-nested-list-iterator/)
+- [374.Guess Number Higher or Lower](https://leetcode.com/problems/guess-number-higher-or-lower/)
+- [386.Lexicographical Numbers](https://leetcode.com/problems/lexicographical-numbers/)
+- [449.Serialize and Deserialize BST](https://leetcode.com/problems/serialize-and-deserialize-bst/)
+- [535.Encode and Decode TinyURL](https://leetcode.com/problems/encode-and-decode-tinyurl/)
+- [690.Employee Importance](https://leetcode.com/problems/employee-importance/)
+
+------------------------------------------------------------------
+
+## 二.分类
+
+## Array
+
+| Title | Solution | Difficulty | Time | Space |收藏|
+| ----- | :--------: | :----------: | :----: | :-----: | :-----: |
+|[1. Two Sum](https://leetcode.com/problems/two-sum/)| [Go](https://github.com/halfrost/LeetCode-Go/tree/master/Algorithms/0001.%20Two%20Sum)| Easy | O(n)| O(n)||
+|[11. Container With Most Water](https://leetcode.com/problems/container-with-most-water/)| [Go](https://github.com/halfrost/LeetCode-Go/tree/master/Algorithms/0011.%20Container%20With%20Most%20Water)| Medium | O(n)| O(1)||
+|[15. 3Sum](https://leetcode.com/problems/3sum)| [Go](https://github.com/halfrost/LeetCode-Go/tree/master/Algorithms/0015.%203Sum)| Medium | O(n^2)| O(n)||
+|[16. 3Sum Closest](https://leetcode.com/problems/3sum-closest)| [Go](https://github.com/halfrost/LeetCode-Go/tree/master/Algorithms/0016.%203Sum%20Closest)| Medium | O(n^2)| O(1)||
+|[18. 4Sum](https://leetcode.com/problems/4sum)| [Go](https://github.com/halfrost/LeetCode-Go/tree/master/Algorithms/0018.%204Sum)| Medium | O(n^3)| O(n^2)||
+|[26. Remove Duplicates from Sorted Array](https://leetcode.com/problems/remove-duplicates-from-sorted-array)| [Go](https://github.com/halfrost/LeetCode-Go/tree/master/Algorithms/0026.%20Remove%20Duplicates%20from%20Sorted%20Array)| Easy | O(n)| O(1)||
+|[27. Remove Element](https://leetcode.com/problems/remove-element)| [Go](https://github.com/halfrost/LeetCode-Go/tree/master/Algorithms/0027.%20Remove%20Element)| Easy | O(n)| O(1)||
+|[39. Combination Sum](https://leetcode.com/problems/combination-sum)| [Go](https://github.com/halfrost/LeetCode-Go/tree/master/Algorithms/0039.%20Combination%20Sum)| Medium | O(n log n)| O(n)||
+|[40. Combination Sum II](https://leetcode.com/problems/combination-sum-ii)| [Go](https://github.com/halfrost/LeetCode-Go/tree/master/Algorithms/0040.%20Combination%20Sum%20II)| Medium | O(n log n)| O(n)||
+|[41. First Missing Positive](https://leetcode.com/problems/first-missing-positive)| [Go](https://github.com/halfrost/LeetCode-Go/tree/master/Algorithms/0041.%20First-Missing-Positive)| Hard | O(n)| O(n)||
+|[42. Trapping Rain Water](https://leetcode.com/problems/trapping-rain-water)| [Go](https://github.com/halfrost/LeetCode-Go/tree/master/Algorithms/0042.%20Trapping%20Rain%20Water)| Hard | O(n)| O(1)||
+|[48. Rotate Image](https://leetcode.com/problems/rotate-image)| [Go](https://github.com/halfrost/LeetCode-Go/tree/master/Algorithms/0048.%20Rotate%20Image)| Medium | O(n)| O(1)||
+|[53. Maximum Subarray](https://leetcode.com/problems/maximum-subarray)| [Go](https://github.com/halfrost/LeetCode-Go/tree/master/Algorithms/0053.%20Maximum%20Subarray)| Easy | O(n)| O(n)||
+|[54. Spiral Matrix](https://leetcode.com/problems/spiral-matrix)| [Go](https://github.com/halfrost/LeetCode-Go/tree/master/Algorithms/0054.%20Spiral%20Matrix)| Medium | O(n)| O(n^2)||
+|[56. Merge Intervals](https://leetcode.com/problems/merge-intervals)| [Go](https://github.com/halfrost/LeetCode-Go/tree/master/Algorithms/0056.%20Merge%20Intervals)| Medium | O(n log n)| O(1)||
+|[57. Insert Interval](https://leetcode.com/problems/insert-interval)| [Go](https://github.com/halfrost/LeetCode-Go/tree/master/Algorithms/0057.%20Insert%20Interval)| Hard | O(n)| O(1)||
+|[59. Spiral Matrix II](https://leetcode.com/problems/spiral-matrix-ii)| [Go](https://github.com/halfrost/LeetCode-Go/tree/master/Algorithms/0059.%20Spiral%20Matrix%20II)| Medium | O(n)| O(n^2)||
+|[62. Unique Paths](https://leetcode.com/problems/unique-paths)| [Go](https://github.com/halfrost/LeetCode-Go/tree/master/Algorithms/0062.%20Unique%20Paths)| Medium | O(n^2)| O(n^2)||
+|[63. Unique Paths II](https://leetcode.com/problems/unique-paths-ii)| [Go](https://github.com/halfrost/LeetCode-Go/tree/master/Algorithms/0063.%20Unique%20Paths%20II)| Medium | O(n^2)| O(n^2)||
+|[64. Minimum Path Sum](https://leetcode.com/problems/minimum-path-sum)| [Go](https://github.com/halfrost/LeetCode-Go/tree/master/Algorithms/0064.%20Minimum%20Path%20Sum)| Medium | O(n^2)| O(n^2)||
+|[75. Sort Colors](https://leetcode.com/problems/sort-colors)| [Go](https://github.com/halfrost/LeetCode-Go/tree/master/Algorithms/0075.%20Sort%20Colors)| Medium | O(n)| O(1)||
+|[78. Subsets](https://leetcode.com/problems/subsets)| [Go](https://github.com/halfrost/LeetCode-Go/tree/master/Algorithms/0078.%20Subsets)| Medium | O(n^2)| O(n)||
+|[79. Word Search](https://leetcode.com/problems/word-search)| [Go](https://github.com/halfrost/LeetCode-Go/tree/master/Algorithms/0079.%20Word%20Search)| Medium | O(n^2)| O(n^2)||
+|[80. Remove Duplicates from Sorted Array II](https://leetcode.com/problems/remove-duplicates-from-sorted-array-ii)| [Go](https://github.com/halfrost/LeetCode-Go/tree/master/Algorithms/0080.%20Remove%20Duplicates%20from%20Sorted%20Array%20II)| Medium | O(n^2)| O(n^2)||
+|[84. Largest Rectangle in Histogram](https://leetcode.com/problems/largest-rectangle-in-histogram)| [Go](https://github.com/halfrost/LeetCode-Go/tree/master/Algorithms/0084.%20Largest%20Rectangle%20in%20Histogram)| Medium | O(n)| O(n)||
+|[88. Merge Sorted Array](https://leetcode.com/problems/merge-sorted-array)| [Go](https://github.com/halfrost/LeetCode-Go/tree/master/Algorithms/0088.%20Merge-Sorted-Array)| Easy | O(n)| O(1)||
+|[90. Subsets II](https://leetcode.com/problems/subsets-ii)| [Go](https://github.com/halfrost/LeetCode-Go/tree/master/Algorithms/0090.%20Subsets%20II)| Medium | O(n^2)| O(n)||
+|[120. Triangle](https://leetcode.com/problems/triangle)| [Go](https://github.com/halfrost/LeetCode-Go/tree/master/Algorithms/0120.%20Triangle)| Medium | O(n^2)| O(n)||
+|[121. Best Time to Buy and Sell Stock](https://leetcode.com/problems/best-time-to-buy-and-sell-stock)| [Go](https://github.com/halfrost/LeetCode-Go/tree/master/Algorithms/0121.%20Best%20Time%20to%20Buy%20and%20Sell%20Stock)| Easy | O(n)| O(1)||
+|[122. Best Time to Buy and Sell Stock II](https://leetcode.com/problems/best-time-to-buy-and-sell-stock-ii)| [Go](https://github.com/halfrost/LeetCode-Go/tree/master/Algorithms/0122.%20Best%20Time%20to%20Buy%20and%20Sell%20Stock%20II)| Easy | O(n)| O(1)||
+|[126. Word Ladder II](https://leetcode.com/problems/word-ladder-ii)| [Go](https://github.com/halfrost/LeetCode-Go/tree/master/Algorithms/0126.%20Word%20Ladder%20II)| Hard | O(n)| O(n^2)||
+|[152. Maximum Product Subarray](https://leetcode.com/problems/maximum-product-subarray)| [Go](https://github.com/halfrost/LeetCode-Go/tree/master/Algorithms/0152.%20Maximum%20Product%20Subarray)| Medium | O(n)| O(1)||
+|[167. Two Sum II - Input array is sorted](https://leetcode.com/problems/two-sum-ii-input-array-is-sorted)| [Go](https://github.com/halfrost/LeetCode-Go/tree/master/Algorithms/0167.%20Two%20Sum%20II%20-%20Input%20array%20is%20sorted)| Easy | O(n)| O(1)||
+|[209. Minimum Size Subarray Sum](https://leetcode.com/problems/minimum-size-subarray-sum)| [Go](https://github.com/halfrost/LeetCode-Go/tree/master/Algorithms/0209.%20Minimum%20Size%20Subarray%20Sum)| Medium | O(n)| O(1)||
+|[216. Combination Sum III](https://leetcode.com/problems/combination-sum-iii)| [Go](https://github.com/halfrost/LeetCode-Go/tree/master/Algorithms/0216.%20Combination%20Sum%20III)| Medium | O(n)| O(1)||
+|[217. Contains Duplicate](https://leetcode.com/problems/contains-duplicate)| [Go](https://github.com/halfrost/LeetCode-Go/tree/master/Algorithms/0217.%20Contains%20Duplicate)| Easy | O(n)| O(n)||
+|[219. Contains Duplicate II](https://leetcode.com/problems/contains-duplicate-ii)| [Go](https://github.com/halfrost/LeetCode-Go/tree/master/Algorithms/0219.%20Contains%20Duplicate%20II)| Easy | O(n)| O(n)||
+|[283. Move Zeroes](https://leetcode.com/problems/move-zeroes)| [Go](https://github.com/halfrost/LeetCode-Go/tree/master/Algorithms/0283.%20Move%20Zeroes)| Easy | O(n)| O(1)||
+|[287. Find the Duplicate Number](https://leetcode.com/problems/find-the-duplicate-number)| [Go](https://github.com/halfrost/LeetCode-Go/tree/master/Algorithms/0287.%20Find%20the%20Duplicate%20Number)| Easy | O(n)| O(1)||
+|[532. K-diff Pairs in an Array](https://leetcode.com/problems/k-diff-pairs-in-an-array)| [Go](https://github.com/halfrost/LeetCode-Go/tree/master/Algorithms/0532.%20K-diff%20Pairs%20in%20an%20Array)| Easy | O(n)| O(n)||
+|[566. Reshape the Matrix](https://leetcode.com/problems/reshape-the-matrix)| [Go](https://github.com/halfrost/LeetCode-Go/tree/master/Algorithms/0566.%20Reshape%20the%20Matrix)| Easy | O(n^2)| O(n^2)||
+|[628. Maximum Product of Three Numbers](https://leetcode.com/problems/maximum-product-of-three-numbers)| [Go](https://github.com/halfrost/LeetCode-Go/tree/master/Algorithms/0628.%20Maximum%20Product%20of%20Three%20Numbers)| Easy | O(n)| O(1)||
+|[713. Subarray Product Less Than K](https://leetcode.com/problems/subarray-product-less-than-k)| [Go](https://github.com/halfrost/LeetCode-Go/tree/master/Algorithms/0713.%20Subarray%20Product%20Less%20Than%20K)| Medium | O(n)| O(1)||
+|[714. Best Time to Buy and Sell Stock with Transaction Fee](https://leetcode.com/problems/best-time-to-buy-and-sell-stock-with-transaction-fee)| [Go](https://github.com/halfrost/LeetCode-Go/tree/master/Algorithms/0714.%20Best%20Time%20to%20Buy%20and%20Sell%20Stock%20with%20Transaction%20Fee)| Medium | O(n)| O(1)||
+|[746. Min Cost Climbing Stairs](https://leetcode.com/problems/min-cost-climbing-stairs)| [Go](https://github.com/halfrost/LeetCode-Go/tree/master/Algorithms/0746.%20Min%20Cost%20Climbing%20Stairs)| Easy | O(n)| O(1)||
+|[766. Toeplitz Matrix](https://leetcode.com/problems/toeplitz-matrix)| [Go](https://github.com/halfrost/LeetCode-Go/tree/master/Algorithms/0766.%20Toeplitz%20Matrix)| Easy | O(n)| O(1)||
+|[867. Transpose Matrix](https://leetcode.com/problems/transpose-matrix)| [Go](https://github.com/halfrost/LeetCode-Go/tree/master/Algorithms/0867.%20Transpose%20Matrix)| Easy | O(n)| O(1)||
+|[891. Sum of Subsequence Widths](https://leetcode.com/problems/sum-of-subsequence-widths)| [Go]()| Hard | O(n)| O(1)||
+|[907. Sum of Subarray Minimums](https://leetcode.com/problems/sum-of-subarray-minimums)| [Go]()| Medium | O(n)| O(1)||
+|[922. Sort Array By Parity II](https://leetcode.com/problems/sum-of-subarray-minimums)| [Go]()| Medium | O(n)| O(1)||
+|[969. Pancake Sorting](https://leetcode.com/problems/pancake-sorting)| [Go](https://github.com/halfrost/LeetCode-Go/tree/master/Algorithms/0969.%20Pancake%20Sorting)| Medium | O(n)| O(1)||
+|[977. Squares of a Sorted Array](https://leetcode.com/problems/squares-of-a-sorted-array)| [Go](https://github.com/halfrost/LeetCode-Go/tree/master/Algorithms/0977.%20Squares%20of%20a%20Sorted%20Array)| Easy | O(n)| O(1)||
+
+
+
+
+| Title | Solution | Difficulty | Time | Space |
+| ----- | -------- | ---------- | ---- | ----- |
+[Max Consecutive Ones](https://leetcode.com/problems/max-consecutive-ones/)| [Go](./Array/MaxConsecutiveOnes.Go)| Easy| O(n)| O(1)|
+[Heaters](https://leetcode.com/problems/heaters/)| [Go](./Array/Heaters.Go)| Easy| O(nlogn)| O(1)|
+[Number of Boomerangs](https://leetcode.com/problems/number-of-boomerangs/)| [Go](./Array/NumberBoomerangs.Go)| Easy| O(n ^ 2)| O(n)|
+[Island Perimeter](https://leetcode.com/problems/island-perimeter/)| [Go](./Array/IslandPerimeter.Go)| Easy| O(nm)| O(1)|
+[Majority Element](https://leetcode.com/problems/majority-element/)| [Go](./Array/MajorityElement.Go)| Easy| O(n)| O(1)|
+[Majority Element II](https://leetcode.com/problems/majority-element-ii/)| [Go](./Array/MajorityElementII.Go)| Medium| O(n)| O(1)|
+[Intersection of Two Arrays](https://leetcode.com/problems/intersection-of-two-arrays/)| [Go](./Array/IntersectionTwoArrays.Go)| Easy| O(n)| O(n)|
+[Intersection of Two Arrays II](https://leetcode.com/problems/intersection-of-two-arrays-ii/)| [Go](./Array/IntersectionTwoArraysII.Go)| Easy| O(n)| O(n)|
+[Contains Duplicate](https://leetcode.com/problems/contains-duplicate/)| [Go](./Array/ContainsDuplicate.Go)| Easy| O(n)| O(n)|
+[Contains Duplicate II](https://leetcode.com/problems/contains-duplicate-ii/)| [Go](./Array/ContainsDuplicateII.Go)| Easy| O(n)| O(n)|
+[Remove Duplicates from Sorted Array](https://leetcode.com/problems/remove-duplicates-from-sorted-array/)| [Go](./Array/RemoveDuplicatesFromSortedArray.Go)| Easy| O(n)| O(1)|
+[Remove Duplicates from Sorted Array II](https://leetcode.com/problems/remove-duplicates-from-sorted-array-ii/)| [Go](./Array/RemoveDuplicatesFromSortedArrayII.Go)| Medium| O(n)| O(1)|
+[Move Zeroes](https://leetcode.com/problems/move-zeroes/)| [Go](./Array/MoveZeroes.Go)| Easy| O(n)| O(1)|
+[Remove Element](https://leetcode.com/problems/remove-element/)| [Go](./Array/RemoveElement.Go)| Easy| O(n)| O(1)|
+[Two Sum](https://leetcode.com/problems/two-sum/)| [Go](./Array/TwoSum.Go)| Easy| O(n)| O(n)|
+[3Sum](https://leetcode.com/problems/3sum/)| [Go](./Array/ThreeSum.Go)| Medium| O(n^2)| O(nC3)|
+[3Sum Closest](https://leetcode.com/problems/3sum-closest/)| [Go](./Array/ThreeSum.Go)| Medium| O(n^2)| O(nC3)|
+[4Sum](https://leetcode.com/problems/4sum/)| [Go](./Array/FourSum.Go)| Medium| O(n^3)| O(nC4)|
+[Summary Ranges](https://leetcode.com/problems/summary-ranges/)| [Go](./Array/SummaryRanges.Go)| Medium| O(n)| O(n)|
+[Shortest Word Distance](https://leetcode.com/problems/shortest-word-distance/)| [Go](./Array/ShortestWordDistance.Go)| Easy| O(n)| O(1)|
+[Shortest Word Distance III](https://leetcode.com/problems/shortest-word-distance-iii/)| [Go](./Array/ShortestWordDistanceIII.Go)| Medium| O(n)| O(1)|
+[Minimum Size Subarray Sum](https://leetcode.com/problems/minimum-size-subarray-sum/)| [Go](./Array/MinimumSizeSubarraySum.Go)| Medium| O(n)| O(1)|
+[Maximum Size Subarray Sum Equals k](https://leetcode.com/problems/maximum-size-subarray-sum-equals-k/)| [Go](./Array/MaximumSizeSubarraySumEqualsK.Go)| Medium| O(n)| O(n)|
+[Smallest Range](https://leetcode.com/problems/smallest-range/)| [Go](./Array/SmallestRange.Go)| Hard | O(nm)| O(nm)|
+[Product of Array Except Self](https://leetcode.com/problems/product-of-array-except-self/)| [Go](./Array/ProductExceptSelf.Go)| Medium| O(n)| O(n)|
+[Rotate Array](https://leetcode.com/problems/rotate-array/)| [Go](./Array/RotateArray.Go)| Easy| O(n)| O(1)|
+[Rotate Image](https://leetcode.com/problems/rotate-image/)| [Go](./Array/RotateImage.Go)| Medium| O(n^2)| O(1)|
+[Spiral Matrix](https://leetcode.com/problems/spiral-matrix/)| [Go](./Array/SpiralMatrix.Go)| Medium| O(n^2)| O(1)|
+[Spiral Matrix II](https://leetcode.com/problems/spiral-matrix/)| [Go](./Array/SpiralMatrixII.Go)| Medium| O(n^2)| O(1)|
+[Valid Sudoku](https://leetcode.com/problems/valid-sudoku/)| [Go](./Array/ValidSudoku.Go)| Easy| O(n^2)| O(n)|
+[Set Matrix Zero](https://leetcode.com/problems/set-matrix-zeroes/)| [Go](./Array/SetMatrixZero.Go)| Medium| O(n^2)| O(1)|
+[Next Permutation](https://leetcode.com/problems/next-permutation/)| [Go](./Array/NextPermutation.Go)| Medium| O(n)| O(1)|
+[Gas Station](https://leetcode.com/problems/gas-station/)| [Go](./Array/GasStation.Go)| Medium| O(n)| O(1)|
+[Game of Life](https://leetcode.com/problems/game-of-life/)| [Go](./Array/GameLife.Go)| Medium| O(n)| O(1)|
+[Task Scheduler](https://leetcode.com/problems/task-scheduler/)| [Go](./Array/TaskScheduler.Go)| Medium| O(nlogn)| O(n)|
+[Sliding Window Maximum ](https://leetcode.com/problems/sliding-window-maximum/)| [Go](./Array/SlidingWindowMaximum.Go)| Hard| O(n)| O(n)|
+[Longest Consecutive Sequence](https://leetcode.com/problems/longest-consecutive-sequence/)| [Go](./Array/LongestConsecutiveSequence.Go)| Hard| O(n)| O(n)|
+
+
+## String
+| Title | Solution | Difficulty | Time | Space |
+| ----- | -------- | ---------- | ---- | ----- |
+[Fizz Buzz](https://leetcode.com/problems/fizz-buzz/)| [Go](./String/FizzBuzz.Go)| Easy| O(n)| O(1)|
+[First Unique Character in a String](https://leetcode.com/problems/first-unique-character-in-a-string/)| [Go](./String/FirstUniqueCharacterInString.Go)| Easy| O(n)| O(1)|
+[Keyboard Row](https://leetcode.com/problems/keyboard-row/)| [Go](./String/KeyboardRow.Go)| Easy| O(nm)| O(n)|
+[Valid Palindrome](https://leetcode.com/problems/valid-palindrome/)| [Go](./String/ValidPalindrome.Go)| Easy| O(n)| O(n)|
+[Valid Palindrome II](https://leetcode.com/problems/valid-palindrome-ii/)| [Go](./String/ValidPalindromeII.Go)| Easy| O(n)| O(n)|
+[Detect Capital](https://leetcode.com/problems/detect-capital/)| [Go](./String/DetectCapital.Go)| Easy| O(n)| O(1)|
+[Count and Say](https://leetcode.com/problems/count-and-say/)| [Go](./String/CountAndSay.Go)| Easy| O(n^2)| O(n)|
+[Flip Game](https://leetcode.com/problems/flip-game/)| [Go](./String/FlipGame.Go)| Easy| O(n)| O(n)|
+[Implement strStr()](https://leetcode.com/problems/implement-strstr/)| [Go](./String/StrStr.Go)| Easy| O(nm)| O(n)|
+[Isomorphic Strings](https://leetcode.com/problems/isomorphic-strings/)| [Go](./String/IsomorphicStrings.Go)| Easy| O(n)| O(n)|
+[Reverse String](https://leetcode.com/problems/reverse-string/)| [Go](./String/ReverseString.Go)| Easy| O(n)| O(n)|
+[Reverse String II](https://leetcode.com/problems/reverse-string-ii/)| [Go](./String/ReverseStringII.Go)| Easy| O(n)| O(n)|
+[Reverse Vowels of a String](https://leetcode.com/problems/reverse-vowels-of-a-string/)| [Go](./String/ReverseVowelsOfAString.Go)| Easy| O(n)| O(n)|
+[Length of Last Word](https://leetcode.com/problems/length-of-last-word/)| [Go](./String/AddStrings.Go)| Easy| O(n)| O(n)|
+[Add Strings](https://leetcode.com/problems/add-strings/)| [Go](./String/LengthLastWord.Go)| Easy| O(n)| O(1)|
+[Multiply Strings](https://leetcode.com/problems/multiply-strings/)| [Go](./String/MultiplyStrings.Go)| Medium| O(n)| O(1)|
+[Palindrome Permutation](https://leetcode.com/problems/palindrome-permutation/)| [Go](./String/PalindromePermutation.Go)| Easy| O(n)| O(n)|
+[Valid Anagram](https://leetcode.com/problems/valid-anagram/)| [Go](./String/ValidAnagram.Go)| Easy| O(nlogn)| O(1)|
+[Ransom Note](https://leetcode.com/problems/ransom-note/)| [Go](./String/RansomNote.Go)| Easy| O(n)| O(n)|
+[Group Anagrams](https://leetcode.com/problems/anagrams/)| [Go](./String/GroupAnagrams.Go)| Medium| O(nmlogm + nlogn)| O(n)
+[Longest Common Prefix](https://leetcode.com/problems/longest-common-prefix/)| [Go](./String/LongestCommonPrefix.Go)| Easy| O(nm)| O(m)|
+[Longest Substring Without Repeating Characters](https://leetcode.com/problems/longest-substring-without-repeating-characters/)| [Go](./String/LongestSubstringWithoutRepeatingCharacters.Go)| Medium| O(n)| O(n)|
+[One Edit Distance](https://leetcode.com/problems/one-edit-distance/)| [Go](./String/OneEditDistance.Go)| Medium| O(n)| O(n)|
+[Word Pattern](https://leetcode.com/problems/word-pattern/)| [Go](./String/WordPattern.Go)| Easy| O(n)| O(n)|
+[Minimum Window Substring](https://leetcode.com/problems/minimum-window-substring/)| [Go](./Array/MinimumWindowSubstring.Go)| Hard| O(n^2)| O(n)|
+[Text Justification](https://leetcode.com/problems/text-justification/)| [Go](./String/TextJustification.Go)| Hard| O(n)| O(n)|
+
+## Linked List (已全部做完)
+
+- 巧妙的构造虚拟头结点。可以使遍历处理逻辑更加统一。
+- 灵活使用递归。构造递归条件,使用递归可以巧妙的解题。不过需要注意有些题目不能使用递归,因为递归深度太深会导致超时和栈溢出。
+- 链表区间逆序。第 92 题。
+- 链表寻找中间节点。第 876 题。链表寻找倒数第 n 个节点。第 19 题。只需要一次遍历就可以得到答案。
+- 合并 K 个有序链表。第 21 题,第 23 题。
+- 链表归类。第 86 题,第 328 题。
+- 链表排序,时间复杂度要求 O(n * log n),空间复杂度 O(1)。只有一种做法,归并排序,至顶向下归并。第 148 题。
+- 判断链表是否存在环,如果有环,输出环的交叉点的下标;判断 2 个链表是否有交叉点,如果有交叉点,输出交叉点。第 141 题,第 142 题,第 160 题。
+
+
+
+| Title | Solution | Difficulty | Time | Space |收藏|
+| ----- | :--------: | :----------: | :----: | :-----: | :-----: |
+|[2. Add Two Numbers](https://leetcode.com/problems/add-two-numbers)| [Go](https://github.com/halfrost/LeetCode-Go/tree/master/Algorithms/0002.%20Add-Two-Number)| Medium | O(n)| O(1)||
+|[19. Remove Nth Node From End of List](https://leetcode.com/problems/remove-nth-node-from-end-of-list/)| [Go](https://github.com/halfrost/LeetCode-Go/tree/master/Algorithms/0019.%20Remove%20Nth%20Node%20From%20End%20of%20List)| Medium | O(n)| O(1)||
+|[21. Merge Two Sorted Lists](https://leetcode.com/problems/merge-two-sorted-lists)| [Go](https://github.com/halfrost/LeetCode-Go/tree/master/Algorithms/0021.%20Merge%20Two%20Sorted%20Lists)| Easy | O(log n)| O(1)||
+|[23. Merge k Sorted Lists](https://leetcode.com/problems/merge-k-sorted-lists/)| [Go](https://github.com/halfrost/LeetCode-Go/tree/master/Algorithms/0023.%20Merge%20k%20Sorted%20Lists)| Hard | O(log n)| O(1)|❤️|
+|[24. Swap Nodes in Pairs](https://leetcode.com/problems/swap-nodes-in-pairs/)| [Go](https://github.com/halfrost/LeetCode-Go/tree/master/Algorithms/0024.%20Swap%20Nodes%20in%20Pairs)| Medium | O(n)| O(1)||
+|[25. Reverse Nodes in k-Group](https://leetcode.com/problems/reverse-nodes-in-k-group/)| [Go](https://github.com/halfrost/LeetCode-Go/tree/master/Algorithms/0025.%20Reverse%20Nodes%20in%20k%20Group)| Hard | O(log n)| O(1)|❤️|
+|[61. Rotate List](https://leetcode.com/problems/rotate-list/)| [Go](https://github.com/halfrost/LeetCode-Go/tree/master/Algorithms/0061.%20Rotate%20List)| Medium | O(n)| O(1)||
+|[82. Remove Duplicates from Sorted List II](https://leetcode.com/problems/remove-duplicates-from-sorted-list-ii/)| [Go](https://github.com/halfrost/LeetCode-Go/tree/master/Algorithms/0082.%20Remove%20Duplicates%20from%20Sorted%20List%20II)| Medium | O(n)| O(1)||
+|[83. Remove Duplicates from Sorted List](https://leetcode.com/problems/remove-duplicates-from-sorted-list/)| [Go](https://github.com/halfrost/LeetCode-Go/tree/master/Algorithms/0083.%20Remove%20Duplicates%20from%20Sorted%20List)| Easy | O(n)| O(1)||
+|[86. Partition List](https://leetcode.com/problems/partition-list/)| [Go](https://github.com/halfrost/LeetCode-Go/tree/master/Algorithms/0086.%20Partition%20List)| Medium | O(n)| O(1)|❤️|
+|[92. Reverse Linked List II](https://leetcode.com/problems/reverse-linked-list-ii/)| [Go](https://github.com/halfrost/LeetCode-Go/tree/master/Algorithms/0092.%20Reverse%20Linked%20List%20II)| Medium | O(n)| O(1)|❤️|
+|[109. Convert Sorted List to Binary Search Tree](https://leetcode.com/problems/convert-sorted-list-to-binary-search-tree/)| [Go](https://github.com/halfrost/LeetCode-Go/tree/master/Algorithms/0109.%20Convert%20Sorted%20List%20to%20Binary%20Search%20Tree)| Medium | O(log n)| O(n)||
+|[141. Linked List Cycle](https://leetcode.com/problems/linked-list-cycle/)| [Go](https://github.com/halfrost/LeetCode-Go/tree/master/Algorithms/0141.%20Linked%20List%20Cycle)| Easy | O(n)| O(1)|❤️|
+|[142. Linked List Cycle II](https://leetcode.com/problems/linked-list-cycle-ii/)| [Go](https://github.com/halfrost/LeetCode-Go/tree/master/Algorithms/0142.%20Linked%20List%20Cycle%20II)| Medium | O(n)| O(1)|❤️|
+|[143. Reorder List](https://leetcode.com/problems/reorder-list/)| [Go](https://github.com/halfrost/LeetCode-Go/tree/master/Algorithms/0143.%20Reorder%20List)| Medium | O(n)| O(1)|❤️|
+|[147. Insertion Sort List](https://leetcode.com/problems/insertion-sort-list/)| [Go](https://github.com/halfrost/LeetCode-Go/tree/master/Algorithms/0147.%20Insertion%20Sort%20List)| Medium | O(n)| O(1)||
+|[148. Sort List](https://leetcode.com/problems/sort-list/)| [Go](https://github.com/halfrost/LeetCode-Go/tree/master/Algorithms/0148.%20Sort%20List)| Medium | O(log n)| O(n)|❤️|
+|[160. Intersection of Two Linked Lists](https://leetcode.com/problems/intersection-of-two-linked-lists/)| [Go](https://github.com/halfrost/LeetCode-Go/tree/master/Algorithms/0160.%20Intersection%20of%20Two%20Linked%20Lists)| Easy | O(n)| O(1)|❤️|
+|[203. Remove Linked List Elements](https://leetcode.com/problems/remove-linked-list-elements/)| [Go](https://github.com/halfrost/LeetCode-Go/tree/master/Algorithms/0203.%20Remove%20Linked%20List%20Elements)| Easy | O(n)| O(1)||
+|[206. Reverse Linked List](https://leetcode.com/problems/reverse-linked-list/)| [Go](https://github.com/halfrost/LeetCode-Go/tree/master/Algorithms/0206.%20Reverse-Linked-List)| Easy | O(n)| O(1)||
+|[234. Palindrome Linked List](https://leetcode.com/problems/palindrome-linked-list/)| [Go](https://github.com/halfrost/LeetCode-Go/tree/master/Algorithms/0234.%20Palindrome%20Linked%20List)| Easy | O(n)| O(1)||
+|[237. Delete Node in a Linked List](https://leetcode.com/problems/delete-node-in-a-linked-list/)| [Go](https://github.com/halfrost/LeetCode-Go/tree/master/Algorithms/0237.%20Delete%20Node%20in%20a%20Linked%20List)| Easy | O(n)| O(1)||
+|[328. Odd Even Linked List](https://leetcode.com/problems/odd-even-linked-list/)| [Go](https://github.com/halfrost/LeetCode-Go/tree/master/Algorithms/0328.%20Odd%20Even%20Linked%20List)| Medium | O(n)| O(1)||
+|[445. Add Two Numbers II](https://leetcode.com/problems/add-two-numbers-ii/)| [Go](https://github.com/halfrost/LeetCode-Go/tree/master/Algorithms/0445.%20Add%20Two%20Numbers%20II)| Medium | O(n)| O(n)||
+|[725. Split Linked List in Parts](https://leetcode.com/problems/split-linked-list-in-parts/)| [Go](https://github.com/halfrost/LeetCode-Go/tree/master/Algorithms/0725.%20Split%20Linked%20List%20in%20Parts)| Medium | O(n)| O(1)||
+|[817. Linked List Components](https://leetcode.com/problems/linked-list-components/)| [Go](https://github.com/halfrost/LeetCode-Go/tree/master/Algorithms/0817.%20Linked%20List%20Components)| Medium | O(n)| O(1)||
+|[707. Design Linked List](https://leetcode.com/problems/design-linked-list/)| [Go](https://github.com/halfrost/LeetCode-Go/tree/master/Algorithms/0707.%20Design%20Linked%20List)| Easy | O(n)| O(1)||
+|[876. Middle of the Linked List](https://leetcode.com/problems/middle-of-the-linked-list/)| [Go](https://github.com/halfrost/LeetCode-Go/tree/master/Algorithms/0876.%20Middle%20of%20the%20Linked%20List)| Easy | O(n)| O(1)|❤️|
+|[1019. Next Greater Node In Linked List](https://leetcode.com/problems/next-greater-node-in-linked-list/)| [Go](https://github.com/halfrost/LeetCode-Go/tree/master/Algorithms/1019.%20Next%20Greater%20Node%20In%20Linked%20List)| Medium | O(n)| O(1)||
+|----------------------------------------------------------------------------|-------------|-------------| -------------| -------------|-------------|
+
+## Stack (已全部做完)
+
+| Title | Solution | Difficulty | Time | Space |
+| ----- | -------- | ---------- | ---- | ----- |
+[Valid Parentheses](https://leetcode.com/problems/valid-parentheses/)| [Go](./Stack/ValidParentheses.Go)| Easy| O(n)| O(n)|
+[Longest Valid Parentheses](https://leetcode.com/problems/longest-valid-parentheses/)| [Go](./Stack/LongestValidParentheses.Go)| Hard| O(n)| O(n)|
+[Evaluate Reverse Polish Notation](https://leetcode.com/problems/evaluate-reverse-polish-notation/)| [Go](./Stack/EvaluateReversePolishNotation.Go)| Medium| O(n)| O(n)|
+[Simplify Path](https://leetcode.com/problems/simplify-path/)| [Go](./Stack/SimplifyPath.Go)| Medium| O(n)| O(n)|
+[Remove K Digits](https://leetcode.com/problems/remove-k-digits/)| [Go](./Stack/RemoveKDigits.Go)| Medium| O(n)| O(n)|
+[Ternary Expression Parser](https://leetcode.com/problems/ternary-expression-parser/)| [Go](./Stack/TernaryExpressionParser.Go)| Medium| O(n)| O(n)|
+[Binary Tree Preorder Traversal](https://leetcode.com/problems/binary-tree-preorder-traversal/)| [Go](./Stack/PreorderTraversal.Go)| Medium| O(n)| O(n)|
+[Binary Tree Inorder Traversal](https://leetcode.com/problems/binary-tree-inorder-traversal/)| [Go](./Stack/InorderTraversal.Go)| Medium| O(n)| O(n)|
+[Binary Tree Postorder Traversal](https://leetcode.com/problems/binary-tree-postorder-traversal/)| [Go](./Stack/PostorderTraversal.Go)| Hard| O(n)| O(n)|
+
+
+## Tree
+| Title | Solution | Difficulty | Time | Space |
+| ----- | -------- | ---------- | ---- | ----- |
+[Same Tree](https://oj.leetcode.com/problems/same-tree/)| [Go](./Tree/SameTree.Go)| Easy| O(n)| O(n)|
+[Symmetric Tree](https://leetcode.com/problems/symmetric-tree/)| [Go](./Tree/SymmetricTree.Go)| Easy| O(n)| O(n)|
+[Invert Binary Tree](https://leetcode.com/problems/invert-binary-tree/)| [Go](./Tree/InvertBinaryTree)| Easy| O(n)| O(n)|
+[Binary Tree Upside Down](https://leetcode.com/problems/binary-tree-upside-down/)| [Go](./Tree/BinaryTreeUpsideDown)| Medium| O(n)| O(1)|
+[Minimum Depth of Binary Tree](https://leetcode.com/problems/minimum-depth-of-binary-tree/)| [Go](./Tree/MinimumDepthOfBinaryTree.Go)| Easy| O(n)| O(1)|
+[Maximum Depth of Binary Tree](https://leetcode.com/problems/maximum-depth-of-binary-tree/)| [Go](./Tree/MaximumDepthOfBinaryTree.Go)| Easy| O(n)| O(1)|
+[Diameter of Binary Tree](https://leetcode.com/problems/diameter-of-binary-tree/)| [Go](./Tree/DiameterBinaryTree.Go)| Easy| O(n)| O(1)|
+[Balanced Binary Tree](https://leetcode.com/problems/balanced-binary-tree/)| [Go](./Tree/BalancedBinaryTree.Go)| Easy| O(n)| O(n)|
+[Sum of Left Leaves](https://leetcode.com/problems/sum-of-left-leaves/)| [Go](./Tree/SumLeftLeaves.Go)| Easy| O(n)| O(1)|
+[Flatten Binary Tree to Linked List](https://leetcode.com/problems/flatten-binary-tree-to-linked-list/)| [Go](./Tree/FlattenBinaryTreeLinkedList.Go)| Medium| O(n)| O(1)|
+[Validate Binary Search Tree](https://leetcode.com/problems/validate-binary-search-tree/)| [Go](./Tree/ValidateBinarySearchTree.Go)| Medium| O(n)| O(n)|
+[Binary Tree Level Order Traversal](https://leetcode.com/problems/binary-tree-level-order-traversal/)| [Go](./Tree/BinaryTreeLevelOrderTraversal.Go)| Easy| O(n)| O(n)|
+[Binary Tree Level Order Traversal II](https://leetcode.com/problems/binary-tree-level-order-traversal-ii/)| [Go](./Tree/BinaryTreeLevelOrderTraversalII.Go)| Easy| O(n)| O(n)|
+[Binary Tree Zigzag Level Order Traversal](https://leetcode.com/problems/binary-tree-zigzag-level-order-traversal/)| [Go](./Tree/BinaryTreeZigzagLevelOrderTraversal.Go)| Medium| O(n)| O(n)|
+[Binary Tree Vertical Order Traversal](https://leetcode.com/problems/binary-tree-vertical-order-traversal/)| [Go](./Tree/BinaryTreeVerticalOrderTraversal.Go)| Medium| O(n)| O(n)|
+[Binary Tree Right Side View](https://leetcode.com/problems/binary-tree-right-side-view/)| [Go](./Tree/BinaryTreeRightSideView.Go)| Medium| O(n)| O(n)|
+[Construct Binary Tree from Preorder and Inorder Traversal](https://leetcode.com/problems/construct-binary-tree-from-preorder-and-inorder-traversal/)| [Go](./Tree/ConstructBinaryTreePreorderInorder.Go)| Medium| O(n)| O(n)|
+[Construct Binary Tree from Inorder and Postorder Traversal](https://leetcode.com/problems/construct-binary-tree-from-inorder-and-postorder-traversal/)| [Go](./Tree/ConstructBinaryTreeInorderPostorder.Go)| Medium| O(n)| O(n)|
+[Path Sum](https://leetcode.com/problems/path-sum/)| [Go](./Tree/PathSum.Go)| Easy| O(n)| O(n)|
+[Path Sum II](https://leetcode.com/problems/path-sum-ii/)| [Go](./Tree/PathSumII.Go)| Medium| O(n)| O(n)|
+[Path Sum III](https://leetcode.com/problems/path-sum-iiI/)| [Go](./Tree/PathSumIII.Go)| Easy| O(n^2)| O(1)|
+[Bnary Tree Paths](https://leetcode.com/problems/binary-tree-paths/)| [Go](./Tree/BnaryTreePaths.Go)| Easy| O(n)| O(n)|
+[Unique Binary Search Trees](https://leetcode.com/problems/unique-binary-search-trees/)| [Go](./Tree/UniqueBinarySearchTrees.Go)| Medium| O(n^2)| O(n)|
+[Recover Binary Search Tree](https://leetcode.com/problems/recover-binary-search-tree/)| [Go](./Tree/RecoverBinarySearchTree.Go)| Hard| O(n)| O(1)|
+[Merge Two Binary Trees](https://leetcode.com/problems/merge-two-binary-trees/description/) | [Go](./Tree/MergeTwoBinaryTrees.Go) | Easy | O(n) | O(n) |
+
+## Dynamic programming
+| Title | Solution | Difficulty | Time | Space |
+| ----- | -------- | ---------- | ---- | ----- |
+[Nested List Weight Sum](https://leetcode.com/problems/nested-list-weight-sum/)| [Go](./DP/NestedListWeightSum.Go)| Easy| O(n)| O(1)|
+[Climbing Stairs](https://leetcode.com/problems/climbing-stairs/)| [Go](./DP/ClimbingStairs.Go)| Easy| O(n)| O(1)|
+[Min Cost Climbing Stairs](https://leetcode.com/problems/min-cost-climbing-stairs/)| [Go](./DP/MinCostClimbingStairs.Go)| Easy| O(n)| O(n)|
+[Unique Paths](https://leetcode.com/problems/unique-paths/)| [Go](./DP/UniquePaths.Go)| Medium| O(mn)| O(mn)|
+[Unique Paths II](https://leetcode.com/problems/unique-paths-ii/)| [Go](./DP/UniquePathsII.Go)| Medium| O(mn)| O(mn)|
+[Decode Ways](https://leetcode.com/problems/decode-ways/)| [Go](./DP/DecodeWays.Go) | O(n)|O(n)|
+[Minimum Path Sum](https://leetcode.com/problems/minimum-path-sum/)| [Go](./DP/MinimumPathSum.Go)| Medium| O(mn)| O(mn)|
+[Generate Parentheses](https://leetcode.com/problems/generate-parentheses/)| [Go](./DP/GenerateParentheses.Go)| Medium| O(2^n)| O(n)|
+[Different Ways to Add Parentheses](https://leetcode.com/problems/different-ways-to-add-parentheses/)| [Go](./DP/DifferentWaysAddParentheses.Go)| Medium| O(n^n)| O(n)|
+[Best Time to Buy and Sell Stock](https://leetcode.com/problems/best-time-to-buy-and-sell-stock/)| [Go](./DP/BestTimeBuySellStock.Go)| Easy| O(n)| O(1)|
+[Best Time to Buy and Sell Stock II](https://leetcode.com/problems/best-time-to-buy-and-sell-stock-ii/)| [Go](./DP/BestTimeBuySellStockII.Go)| Medium| O(n)| O(1)|
+[Best Time to Buy and Sell Stock III](https://leetcode.com/problems/best-time-to-buy-and-sell-stock-iii/)| [Go](./DP/BestTimeBuySellStockIII.Go)| Hard| O(n)| O(n)|
+[Best Time to Buy and Sell Stock IV](https://leetcode.com/problems/https://leetcode.com/problems/best-time-to-buy-and-sell-stock-iv/)| [Go](./DP/BestTimeBuySellStockIV.Go)| Hard| O(n^2)| O(n)|
+[Best Time to Buy and Sell Stock with Cooldown](https://leetcode.com/problems/best-time-to-buy-and-sell-stock-with-cooldown/)| [Go](./DP/BestTimeBuySellStockCooldown.Go)| Medium| O(n^2)| O(n)|
+[Coin Change](https://leetcode.com/problems/coin-change/)| [Go](./DP/CoinChange.Go)| Medium| O(n^2)| O(n)|
+[Coin Change II](https://leetcode.com/problems/coin-change-ii/)| [Go](./DP/CoinChangeII.Go)| Medium| O(n^2)| O(n)|
+[Longest Increasing Subsequence](https://leetcode.com/problems/longest-increasing-subsequence/)| [Go](./DP/LongestIncreasingSubsequence.Go)| Medium| O(n^2)| O(n)|
+[Longest Palindromic Substring](https://leetcode.com/problems/longest-palindromic-substring/)| [Go](./DP/LongestPalindromicSubstring.Go)| Medium| O(n^2)| O(n^2)|
+[Perfect Squares](https://leetcode.com/problems/perfect-squares/)| [Go](./DP/PerfectSquares.Go)| Medium| O(n^2)| O(n)|
+[House Robber](https://leetcode.com/problems/house-robber/)| [Go](./DP/HouseRobber.Go)| Easy| O(n)| O(1)|
+[House Robber II](https://leetcode.com/problems/house-robber-ii/)| [Go](./DP/HouseRobberII.Go)| Medium| O(n)| O(1)|
+[Paint Fence](https://leetcode.com/problems/paint-fence/)| [Go](./DP/PaintFence.Go)| Easy| O(n)| O(n)|
+[Maximum Subarray](https://leetcode.com/problems/maximum-subarray/)| [Go](./DP/MaximumSubarray.Go)| Medium| O(n)| O(1)|
+[Maximum Product Subarray](https://leetcode.com/problems/maximum-product-subarray/)| [Go](./DP/MaximumProductSubarray.Go)| Medium| O(n)| O(1)|
+[Maximal Square](https://leetcode.com/problems/maximal-square/)| [Go](./DP/MaximalSquare.Go)| Medium| O(mn)| O(mn)|
+[Edit Distance](https://leetcode.com/problems/edit-distance/)| [Go](./DP/EditDistance.Go)| Hard| O(mn)| O(mn)|
+[Combination Sum IV](https://leetcode.com/problems/combination-sum-iv/)| [Go](./DP/CombinationSumIV.Go)| Medium| O(2^n)| O(n)|
+[Triangle](https://leetcode.com/problems/triangle/)| [Go](./DP/Triangle.Go)| Medium| O(2^n - 1)| O(m)|
+[Guess Number Higher or Lower II](https://leetcode.com/problems/guess-number-higher-or-lower-ii/)| [Go](./DP/GuessNumberHigherOrLowerII.Go)| Medium| O(nlogn)| O(n^2)|
+[Burst Ballons](https://leetcode.com/problems/burst-balloons/)| [Go](./DP/BurstBalloons.Go)| Hard| O(n^3)| O(n)|
+[Frog Jump](https://leetcode.com/problems/frog-jump/)| [Go](./DP/FrogJump.Go)| Hard| O(n^2)| O(n)|
+
+## Depth-first search
+| Title | Solution | Difficulty | Time | Space |
+| ----- | -------- | ---------- | ---- | ----- |
+[Permutations](https://leetcode.com/problems/permutations/)| [Go](./DFS/Permutations.Go)| Medium| O(n!)| O(n)|
+[Permutations II](https://leetcode.com/problems/permutations-ii/)| [Go](./DFS/PermutationsII.Go)| Medium| O(n!)| O(n)|
+[Subsets](https://leetcode.com/problems/subsets/)| [Go](./DFS/Subsets.Go)| Medium| O(n!)| O(n)|
+[Subsets II](https://leetcode.com/problems/subsets-ii/)| [Go](./DFS/SubsetsII.Go)| Medium| O(n!)| O(n)|
+[Combinations](https://leetcode.com/problems/combinations/)| [Go](./DFS/Combinations.Go)| Medium| O(n!)| O(n)|
+[Combination Sum](https://leetcode.com/problems/combination-sum/)| [Go](./DFS/CombinationSum.Go)| Medium| O(n^n)| O(2^n - 1)|
+[Combination Sum II](https://leetcode.com/problems/combination-sum-ii/)| [Go](./DFS/CombinationSumII.Go)| Medium| O(n!)| O(2^n - 2)|
+[Combination Sum III](https://leetcode.com/problems/combination-sum-iii/)| [Go](./DFS/CombinationSumIII.Go)| Medium| O(n!)| O(nCk)|
+[Letter Combinations of a Phone Number](https://leetcode.com/problems/letter-combinations-of-a-phone-number/)| [Go](./DFS/LetterCombinationsPhoneNumber.Go)| Medium| O(mn)| O(n)|
+[Factor Combinations](https://leetcode.com/problems/factor-combinations/)| [Go](./DFS/FactorCombinations.Go)| Medium| O(n^n))| O(2^n - 1)|
+[Generalized Abbreviation](https://leetcode.com/problems/generalized-abbreviation/)| [Go](./DFS/GeneralizedAbbreviation.Go)| Medium| O(n!)| O(2^n)|
+[Palindrome Partitioning](https://leetcode.com/problems/palindrome-partitioning/)| [Go](./DFS/PalindromePartitioning.Go)| Medium| O(n!)| O(n)|
+[Number of Islands](https://leetcode.com/problems/number-of-islands/)| [Go](./DFS/NumberofIslands.Go)| Medium| O((mn)^2)| O(1)|
+[Walls and Gates](https://leetcode.com/problems/walls-and-gates/)| [Go](./DFS/WallsGates.Go)| Medium| O(n!)| O(2^n)|
+[Word Search](https://leetcode.com/problems/word-search/)| [Go](./DFS/WordSearch.Go)| Medium| O((n^2)!)| O(n^2)|
+[Word Search II](https://leetcode.com/problems/word-search-ii/)| [Go](./DFS/WordSearchII.Go)| Hard| O(((mn)^2))| O(n^2)|
+[Add and Search Word - Data structure design](https://leetcode.com/problems/add-and-search-word-data-structure-design/)| [Go](./DFS/WordDictionary.Go)| Medium| O(n)| O(n)|
+[N-Queens](https://leetcode.com/problems/n-queens/)| [Go](./DFS/NQueens.Go)| Hard| O((n^4))| O(n^2)|
+[N-Queens II](https://leetcode.com/problems/n-queens-ii/)| [Go](./DFS/NQueensII.Go)| Hard| O((n^3))| O(n)|
+[Sudoku Solver](https://leetcode.com/problems/sudoku-solver/)| [Go](./DFS/SudokuSolver.Go)| Hard| O(n^4)| O(1)|
+[Remove Invalid Parentheses](https://leetcode.com/problems/remove-invalid-parentheses/)| [Go](./DFS/RemoveInvalidParentheses.Go)| Hard| O(n!)| O(n)|
+[Expression Add Operators](https://leetcode.com/problems/expression-add-operators/)| [Go](./DFS/ExpressionAddOperators.Go)| Hard| O(n!)| O(n)|
+
+## Math
+
+| Title | Solution | Difficulty | Time | Space |
+| ----- | -------- | ---------- | ---- | ----- |
+[Add Binary](https://leetcode.com/problems/add-binary/)| [Go](./Math/AddBinary.Go)| Easy| O(n)| O(n)|
+[Add Two Numbers](https://leetcode.com/problems/add-two-numbers/)| [Go](./Math/AddTwoNumbers.Go)| Medium| O(n)| O(1)|
+[Add Digits](https://leetcode.com/problems/add-digits/)| [Go](./Math/AddDigits.Go)| Easy| O(1)| O(1)|
+[Plus One](https://leetcode.com/problems/plus-one/)| [Go](./Math/PlusOne.Go)| Easy| O(n)| O(1)|
+[Divide Two Integers](https://leetcode.com/problems/divide-two-integers/)| [Go](./Math/DivideTwoIntegers.Go)| Medium| O(logn)| O(1)|
+[Number Complement](https://leetcode.com/problems/number-complement/)| [Go](./Math/NumberComplement.Go)| Easy| O(n)| O(1)|
+[Hamming Distance](https://leetcode.com/problems/hamming-distance/)| [Go](./Math/HammingDistance.Go)| Easy| O(n)| O(1)|
+[Integer Break](https://leetcode.com/problems/integer-break/)| [Go](./Math/IntegerBreak.Go)| Medium| O(logn)| O(1)|
+[Happy Number](https://leetcode.com/problems/happy-number/)| [Go](./Math/HappyNumber.Go)| Easy| O(n)| O(n)|
+[Single Number](https://leetcode.com/problems/single-number/)| [Go](./Math/SingleNumber.Go)| Medium| O(n)| O(1)|
+[Ugly Number](https://leetcode.com/problems/ugly-number/)| [Go](./Math/UglyNumber.Go)| Easy| O(logn)| O(1)|
+[Ugly Number II](https://leetcode.com/problems/ugly-number-ii/)| [Go](./Math/UglyNumberII.Go)| Medium| O(n)| O(n)|
+[Super Ugly Number](https://leetcode.com/problems/super-ugly-number/)| [Go](./Math/SuperUglyNumber.Go)| Medium| O(n^2)| O(n)|
+[Count Primes](https://leetcode.com/problems/count-primes/)| [Go](./Math/CountPrimes.Go)| Easy| O(n)| O(n)|
+[String to Integer (atoi)](https://leetcode.com/problems/string-to-integer-atoi/)| [Go](./Math/Atoi.Go)| Easy| O(n)| O(1)|
+[Pow(x, n)](https://leetcode.com/problems/isomorphic-strings/)| [Go](./Math/Pow.Go)| Medium| O(logn)| O(1)|
+[Power of Two](https://leetcode.com/problems/power-of-two/)| [Go](./Math/PowerTwo.Go)| Easy| O(1)| O(1)|
+[Power of Three](https://leetcode.com/problems/power-of-three/)| [Go](./Math/PowerThree.Go)| Easy| O(1)| O(1)|
+[Super Power](https://leetcode.com/problems/super-pow/)| [Go](./Math/SuperPow.Go)| Medium| O(n)| O(1)|
+[Sum of Two Integers](https://leetcode.com/problems/sum-of-two-integers/)| [Go](./Math/SumTwoIntegers.Go)| Easy| O(n)| O(1)|
+[Reverse Integer](https://leetcode.com/problems/reverse-integer/)| [Go](./Math/ReverseInteger.Go)| Easy| O(n)| O(1)|
+[Excel Sheet Column Number](https://leetcode.com/problems/excel-sheet-column-number/)| [Go](./Math/ExcelSheetColumnNumber.Go)| Easy| O(n)| O(1)|
+[Integer to Roman](https://leetcode.com/problems/integer-to-roman/)| [Go](./Math/IntegerToRoman.Go)| Medium| O(n)| O(1)|
+[Roman to Integer](https://leetcode.com/problems/roman-to-integer/)| [Go](./Math/RomanToInteger.Go)| Easy| O(n)| O(n)|
+[Integer to English Words](https://leetcode.com/problems/integer-to-english-words/)| [Go](./Math/IntegerEnglishWords.Go)| Hard| O(n)| O(1)|
+[Rectangle Area](https://leetcode.com/problems/rectangle-area/)| [Go](./Math/RectangleArea.Go)| Easy| O(1)| O(1)|
+[Trapping Rain Water](https://leetcode.com/problems/trapping-rain-water/)| [Go](./Math/TrappingRainWater.Go)| Hard| O(n)| O(n)|
+[Container With Most Water](https://leetcode.com/problems/container-with-most-water/)| [Go](./Math/ContainerMostWater.Go)| Medium| O(n)| O(1)|
+[Counting Bits](https://leetcode.com/problems/counting-bits/)| [Go](./Math/CountingBits.Go)| Medium| O(n)| O(n)|
+[K-th Smallest in Lexicographical Order](https://leetcode.com/problems/k-th-smallest-in-lexicographical-order/)| [Go](./Math/KthSmallestLexicographicalOrder.Go)| Hard| O(n)| O(1)|
+
+## Search
+
+| Title | Solution | Difficulty | Time | Space |
+| ----- | -------- | ---------- | ---- | ----- |
+[Closest Binary Search Tree Value](https://leetcode.com/problems/closest-binary-search-tree-value/)| [Go](./Search/ClosestBinarySearchTreeValue.Go)| Easy| O(logn)| O(1)|
+[Closest Binary Search Tree Value II](https://leetcode.com/problems/closest-binary-search-tree-value-ii/)| [Go](./Search/ClosestBinarySearchTreeValueII.Go)| Hard| O(n)| O(n)|
+[Search in Rotated Sorted Array](https://leetcode.com/problems/search-in-rotated-sorted-array/)| [Go](./Search/SearchInRotatedSortedArray.Go)| Hard| O(logn)| O(1)|
+[Search in Rotated Sorted Array II](https://leetcode.com/problems/search-in-rotated-sorted-array-ii/)| [Go](./Search/SearchInRotatedSortedArrayII.Go)| Medium| O(logn)| O(1)|
+[Find Minimum in Rotated Sorted Array](https://leetcode.com/problems/find-minimum-in-rotated-sorted-array/)| [Go](./Search/FindMinimumRotatedSortedArray.Go)| Medium| O(logn)| O(1)|
+[Find Minimum in Rotated Sorted Array II](https://leetcode.com/problems/find-minimum-in-rotated-sorted-array-ii/)| [Go](./Search/FindMinimumRotatedSortedArrayII.Go)| Hard| O(logn)| O(1)|
+[Search a 2D Matrix](https://leetcode.com/problems/search-a-2d-matrix/)| [Go](./Search/Search2DMatrix.Go)| Medium| O(log(m + n))| O(1)|
+[Search a 2D Matrix II](https://leetcode.com/problems/search-a-2d-matrix-ii/)| [Go](./Search/Search2DMatrixII.Go)| Medium| O(m + n)| O(1)|
+[Search for a Range](https://leetcode.com/problems/search-for-a-range/)| [Go](./Search/SearchForARange.Go)| Medium| O(logn)| O(1)|
+[Search Insert Position](https://leetcode.com/problems/search-insert-position/)| [Go](./Search/SearchForARange.Go)| Medium| O(logn)| O(1)|
+[Find Peak Element](https://leetcode.com/problems/find-peak-element/)| [Go](./Search/FindPeakElement.Go)| Medium| O(logn)| O(1)|
+[Sqrt(x)](https://leetcode.com/problems/sqrtx/)| [Go](./Search/Sqrtx.Go)| Medium| O(logn)| O(1)|
+[Median of Two Sorted Arrays](https://leetcode.com/problems/median-of-two-sorted-arrays/)| [Go](./Search/MedianTwoSortedArrays.Go)| Hard| O(log(m + n))| O(1)|
+
+
+## Sort (已全部做完)
+
+- 深刻的理解多路快排。第 75 题。
+- 链表的排序,插入排序(第 147 题)和归并排序(第 148 题)
+- 桶排序和基数排序。第 164 题。
+- "摆动排序"。第 324 题。
+- 两两不相邻的排序。第 767 题,第 1054 题。
+- "饼子排序"。第 969 题。
+
+| Title | Solution | Difficulty | Time | Space | 收藏 |
+| ----- | :--------: | :----------: | :----: | :-----: |:-----: |
+|[56. Merge Intervals](https://leetcode.com/problems/merge-intervals/)| [Go](https://github.com/halfrost/LeetCode-Go/tree/master/Algorithms/0056.%20Merge%20Intervals)| Medium | O(n log n)| O(log n)||
+|[57. Insert Interval](https://leetcode.com/problems/insert-interval/)| [Go](https://github.com/halfrost/LeetCode-Go/tree/master/Algorithms/0057.%20Insert%20Interval)| Hard | O(n)| O(1)||
+|[75. Sort Colors](https://leetcode.com/problems/sort-colors/)| [Go](https://github.com/halfrost/LeetCode-Go/tree/master/Algorithms/0075.%20Sort%20Colors)| Medium| O(n)| O(1)|❤️|
+|[147. Insertion Sort List](https://leetcode.com/problems/insertion-sort-list/)| [Go](https://github.com/halfrost/LeetCode-Go/tree/master/Algorithms/0147.%20Insertion%20Sort%20List)| Medium | O(n)| O(1) |❤️|
+|[148. Sort List](https://leetcode.com/problems/sort-list/)| [Go](https://github.com/halfrost/LeetCode-Go/tree/master/Algorithms/0148.%20Sort%20List)| Medium |O(n log n)| O(log n)|❤️|
+|[164. Maximum Gap](https://leetcode.com/problems/maximum-gap/)| [Go](https://github.com/halfrost/LeetCode-Go/tree/master/Algorithms/0164.%20Maximum%20Gap)| Hard | O(n log n)| O(log n) |❤️|
+|[179. Largest Number](https://leetcode.com/problems/largest-number/)| [Go](https://github.com/halfrost/LeetCode-Go/tree/master/Algorithms/0179.%20Largest%20Number)| Medium | O(n log n)| O(log n) |❤️|
+|[220. Contains Duplicate III](https://leetcode.com/problems/contains-duplicate-iii/)| [Go](https://github.com/halfrost/LeetCode-Go/tree/master/Algorithms/0220.%20Contains%20Duplicate%20III)| Medium | O(n^2)| O(1) ||
+|[242. Valid Anagram](https://leetcode.com/problems/valid-anagram/)| [Go](https://github.com/halfrost/LeetCode-Go/tree/master/Algorithms/0242.%20Valid%20Anagram)| Easy | O(n)| O(n) ||
+|[274. H-Index](https://leetcode.com/problems/h-index/)| [Go](https://github.com/halfrost/LeetCode-Go/tree/master/Algorithms/0274.%20H-Index)| Medium | O(n)| O(n) ||
+|[324. Wiggle Sort II](https://leetcode.com/problems/wiggle-sort-ii/)| [Go](https://github.com/halfrost/LeetCode-Go/tree/master/Algorithms/0324.%20Wiggle%20Sort%20II)| Medium| O(n)| O(n)|❤️|
+|[349. Intersection of Two Arrays](https://leetcode.com/problems/intersection-of-two-arrays/)| [Go](https://github.com/halfrost/LeetCode-Go/tree/master/Algorithms/0349.%20Intersection%20of%20Two%20Arrays)| Easy | O(n)| O(n) ||
+|[350. Intersection of Two Arrays II](https://leetcode.com/problems/intersection-of-two-arrays-ii/)| [Go](https://github.com/halfrost/LeetCode-Go/tree/master/Algorithms/0350.%20Intersection%20of%20Two%20Arrays%20II)| Easy | O(n)| O(n) ||
+|[524. Longest Word in Dictionary through Deleting](https://leetcode.com/problems/longest-word-in-dictionary-through-deleting/)| [Go](https://github.com/halfrost/LeetCode-Go/tree/master/Algorithms/0524.%20Longest%20Word%20in%20Dictionary%20through%20Deleting)| Medium | O(n)| O(1) ||
+|[767. Reorganize String](https://leetcode.com/problems/reorganize-string/)| [Go](https://github.com/halfrost/LeetCode-Go/tree/master/Algorithms/0767.%20Reorganize%20String)| Medium | O(n log n)| O(log n) |❤️|
+|[853. Car Fleet](https://leetcode.com/problems/car-fleet/)| [Go](https://github.com/halfrost/LeetCode-Go/tree/master/Algorithms/0853.%20Car%20Fleet)| Medium | O(n log n)| O(log n) ||
+|[710. Random Pick with Blacklist](https://leetcode.com/problems/random-pick-with-blacklist/)| [Go](https://github.com/halfrost/LeetCode-Go/tree/master/Algorithms/0710.%20Random%20Pick%20with%20Blacklist)| Hard | O(n)| O(n) ||
+|[922. Sort Array By Parity II](https://leetcode.com/problems/sort-array-by-parity-ii/)| [Go](https://github.com/halfrost/LeetCode-Go/tree/master/Algorithms/0922.%20Sort%20Array%20By%20Parity%20II)| Easy | O(n)| O(1) ||
+|[969. Pancake Sorting](https://leetcode.com/problems/pancake-sorting/)| [Go](https://github.com/halfrost/LeetCode-Go/tree/master/Algorithms/0969.%20Pancake%20Sorting)| Medium | O(n log n)| O(log n) |❤️|
+|[973. K Closest Points to Origin](https://leetcode.com/problems/k-closest-points-to-origin/)| [Go](https://github.com/halfrost/LeetCode-Go/tree/master/Algorithms/0973.%20K%20Closest%20Points%20to%20Origin)| Medium | O(n log n)| O(log n) ||
+|[976. Largest Perimeter Triangle](https://leetcode.com/problems/largest-perimeter-triangle/)| [Go](https://github.com/halfrost/LeetCode-Go/tree/master/Algorithms/0976.%20Largest%20Perimeter%20Triangle)| Easy | O(n log n)| O(log n) ||
+|[1030. Matrix Cells in Distance Order](https://leetcode.com/problems/matrix-cells-in-distance-order/)| [Go](https://github.com/halfrost/LeetCode-Go/tree/master/Algorithms/1030.%20Matrix%20Cells%20in%20Distance%20Order)| Easy | O(n^2)| O(1) ||
+|[1054. Distant Barcodes](https://leetcode.com/problems/distant-barcodes/)| [Go](https://github.com/halfrost/LeetCode-Go/tree/master/Algorithms/1054.%20Distant%20Barcodes)| Medium | O(n log n)| O(log n) ||
+|-----------------------------------------------------------------|-------------|-------------| --------------------------| --------------------------|-------------|
+
+
+## Union Find
+| Title | Solution | Difficulty | Time | Space |
+| ----- | -------- | ---------- | ---- | ----- |
+[Number of Connected Components in an Undirected Graph](https://leetcode.com/problems/number-of-connected-components-in-an-undirected-graph/)| [Go](./UnionFind/NumberConnectedComponentsUndirectedGraph.Go)| Medium| O(nlogn)| O(n)|
+[Graph Valid Tree](https://leetcode.com/problems/graph-valid-tree/)| [Go](./UnionFind/GraphValidTree.Go)| Medium| O(nlogn)| O(n)|
+
+## Google
+| Title | Solution | Difficulty | Frequency |
+| ----- | -------- | ---------- | --------- |
+[Plus One](https://leetcode.com/problems/plus-one/)| [Go](./Math/PlusOne.Go)| Easy| ★★★★★★|
+[Number of Islands](https://leetcode.com/problems/number-of-islands/)| [Go](./DFS/NumberofIslands.Go)| Medium| ★★★★|
+[Summary Ranges](https://leetcode.com/problems/summary-ranges/)| [Go](./Array/SummaryRanges.Go)| Medium| ★★★★|
+[Perfect Squares](https://leetcode.com/problems/perfect-squares/)| [Go](./DP/PerfectSquares.Go)| Medium| ★★★★|
+[Merge Intervals](https://leetcode.com/problems/merge-intervals/)| [Go](./Sort/MergeIntervals.Go)| Hard| ★★★|
+[Valid Parentheses](https://leetcode.com/problems/valid-parentheses/)| [Go](./Stack/ValidParentheses.Go)| Easy| ★★★|
+[Trapping Rain Water](https://leetcode.com/problems/trapping-rain-water/)| [Go](./Math/TrappingRainWater.Go)| Hard| ★★|
+[Merge k Sorted Lists](https://leetcode.com/problems/merge-k-sorted-lists/)| [Go](./LinkedList/MergeKSortedLists.Go)| Hard| ★★|
+[Longest Consecutive Sequence](https://leetcode.com/problems/longest-consecutive-sequence/)| [Go](./Array/LongestConsecutiveSequence.Go)| Hard| ★★|
+[Find Peak Element](https://leetcode.com/problems/find-peak-element/)| [Go](./Search/FindPeakElement.Go)| Medium| ★★|
+[Power of Two](https://leetcode.com/problems/power-of-two/)| [Go](./Math/PowerTwo.Go)| Easy| ★★|
+[Spiral Matrix](https://leetcode.com/problems/spiral-matrix/)| [Go](./Array/SpiralMatrix.Go)| Medium| ★★|
+[Sliding Window Maximum ](https://leetcode.com/problems/sliding-window-maximum/)| [Go](./Array/SlidingWindowMaximum.Go)| Hard| ★★|
+[Pow(x, n)](https://leetcode.com/problems/isomorphic-strings/)| [Go](./Math/Pow.Go)| Medium| ★★|
+[Letter Combinations of a Phone Number](https://leetcode.com/problems/letter-combinations-of-a-phone-number/)| [Go](./DFS/LetterCombinationsPhoneNumber.Go)| Medium| ★★|
+[Heaters](https://leetcode.com/problems/heaters/)| [Go](./Array/Heaters.Go)| Easy| ★|
+
+## Facebook
+| Title | Solution | Difficulty | Frequency |
+| ----- | -------- | ---------- | --------- |
+[3Sum](https://leetcode.com/problems/3sum/)| [Go](./Array/ThreeSum.Go)| Medium| ★★★★★★|
+[Valid Palindrome](https://leetcode.com/problems/valid-palindrome/)| [Go](./String/ValidPalindrome.Go)| Easy| ★★★★★★|
+[Valid Palindrome II](https://leetcode.com/problems/valid-palindrome-ii/)| [Go](./String/ValidPalindromeII.Go)| Easy| ★★★★★★|
+[Move Zeroes](https://leetcode.com/problems/move-zeroes/)| [Go](./Array/MoveZeroes.Go)| Easy| ★★★★★★|
+[Remove Invalid Parentheses](https://leetcode.com/problems/remove-invalid-parentheses/)| [Go](./DFS/RemoveInvalidParentheses.Go)| Hard| ★★★★★★|
+[Add Binary](https://leetcode.com/problems/add-binary/)| [Go](./Math/AddBinary.Go)| Easy| ★★★★★|
+[Two Sum](https://leetcode.com/problems/two-sum/)| [Go](./Array/TwoSum.Go)| Easy| ★★★★★|
+[Bnary Tree Paths](https://leetcode.com/problems/binary-tree-paths/)| [Go](./Tree/BnaryTreePaths.Go)| Easy| ★★★★|
+[Letter Combinations of a Phone Number](https://leetcode.com/problems/letter-combinations-of-a-phone-number/)| [Go](./DFS/LetterCombinationsPhoneNumber.Go)| Medium| ★★★★|
+[Merge k Sorted Lists](https://leetcode.com/problems/merge-k-sorted-lists/)| [Go](./LinkedList/MergeKSortedLists.Go)| Hard| ★★★★|
+[Reverse Linked List](https://leetcode.com/problems/reverse-linked-list/)| [Go](./LinkedList/ReverseLinkedList.Go)| Easy| ★★★|
+[Merge Intervals](https://leetcode.com/problems/merge-intervals/)| [Go](./Sort/MergeIntervals.Go)| Hard| ★★★|
+[Number of Islands](https://leetcode.com/problems/number-of-islands/)| [Go](./DFS/NumberofIslands.Go)| Medium| ★★★|
+[Reverse Linked List](https://leetcode.com/problems/reverse-linked-list/)| [Go](./LinkedList/ReverseLinkedList.Go)| Easy| ★★★|
+[Expression Add Operators](https://leetcode.com/problems/expression-add-operators/)| [Go](./DFS/ExpressionAddOperators.Go)| Hard| ★★★|
+[Subsets](https://leetcode.com/problems/subsets/)| [Go](./DFS/Subsets.Go)| Medium| ★★★|
+[Sort Colors](https://leetcode.com/problems/sort-colors/)| [Go](./Sort/SortColors.Go)| Medium| ★★|
+
+## Snapchat
+| Title | Solution | Difficulty | Frequency |
+| ----- | -------- | ---------- | --------- |
+[Game of Life](https://leetcode.com/problems/game-of-life/) | [Go](./Array/GameLife.Go)| Medium| ★★★★★★|
+[Meeting Rooms II](https://leetcode.com/problems/meeting-rooms-ii/)| [Go](./Sort/MeetingRoomsII.Go)| Medium| ★★★★★★|
+[Valid Sudoku](https://leetcode.com/problems/valid-sudoku/)| [Go](./Array/ValidSudoku.Go)| Easy| ★★★★★|
+[Binary Tree Vertical Order Traversal](https://leetcode.com/problems/binary-tree-vertical-order-traversal/)| [Go](./Tree/BinaryTreeVerticalOrderTraversal.Go)| Medium| ★★★★|
+[Alien Dictionary](https://leetcode.com/problems/alien-dictionary/)| [Go](./Sort/AlienDictionary.Go)| Hard| ★★★★|
+[One Edit Distance](https://leetcode.com/problems/one-edit-distance/)| [Go](./String/OneEditDistance.Go)| Medium| ★★★|
+[Sudoku Solver](https://leetcode.com/problems/sudoku-solver/)| [Go](./Math/SudokuSolver.Go)| Hard| ★★★|
+[Reverse Linked List](https://leetcode.com/problems/reverse-linked-list/)| [Go](./LinkedList/ReverseLinkedList.Go)| Easy| ★★|
+[Unique Binary Search Trees](https://leetcode.com/problems/unique-binary-search-trees/)| [Go](./Tree/UniqueBinarySearchTrees.Go)| Medium| ★★|
+[Minimum Window Substring](https://leetcode.com/problems/minimum-window-substring/)| [Go](./Array/MinimumWindowSubstring.Go)| Hard| ★★|
+[Remove K Digits](https://leetcode.com/problems/remove-k-digits/)| [Go](./Stack/RemoveKDigits.Go)| Medium| ★|
+[Ternary Expression Parser](https://leetcode.com/problems/ternary-expression-parser/)| [Go](./Stack/TernaryExpressionParser.Go)| Medium| ★|
+
+## Uber
+| Title | Solution | Difficulty | Frequency |
+| ----- | -------- | ---------- | --------- |
+[Valid Sudoku](https://leetcode.com/problems/valid-sudoku/)| [Go](./Array/ValidSudoku.Go)| Easy| ★★★★|
+[Spiral Matrix](https://leetcode.com/problems/spiral-matrix/)| [Go](./Array/SpiralMatrix.Go)| Medium| ★★★★|
+[Letter Combinations of a Phone Number](https://leetcode.com/problems/letter-combinations-of-a-phone-number/)| [Go](./DFS/LetterCombinationsPhoneNumber.Go)| Medium| ★★★★|
+[Group Anagrams](https://leetcode.com/problems/anagrams/)| [Go](./String/GroupAnagrams.Go)| Medium| ★★★★|
+[Word Pattern](https://leetcode.com/problems/word-pattern/)| [Go](./String/WordPattern.Go)| Easy| ★★★|
+[Roman to Integer](https://leetcode.com/problems/roman-to-integer/)| [Go](./Math/RomanToInteger.Go)| Easy| ★★★|
+[Combination Sum](https://leetcode.com/problems/combination-sum/)| [Go](./DFS/CombinationSum.Go)| Medium| ★★|
+
+## Airbnb
+| Title | Solution | Difficulty | Frequency |
+| ----- | -------- | ---------- | --------- |
+[Two Sum](https://leetcode.com/problems/two-sum/)| [Go](./Array/TwoSum.Go)| Easy| ★★★★★|
+[Text Justification](https://leetcode.com/problems/text-justification/)| [Go](./String/TextJustification.Go)| Hard| ★★★★|
+[House Robber](https://leetcode.com/problems/house-robber/)| [Go](./DP/HouseRobber.Go)| Easy| ★★|
+[Single Number](https://leetcode.com/problems/single-number/)| [Go](./Math/SingleNumber.Go)| Medium| ★★|
+[Word Search II](https://leetcode.com/problems/word-search-ii/)| [Go](./DFS/WordSearchII.Go)| Hard| ★★|
+[Add Two Numbers](https://leetcode.com/problems/add-two-numbers/)| [Go](./Math/AddTwoNumbers.Go)| Medium| ★★|
+
+## LinkedIn
+| Title | Solution | Difficulty | Frequency |
+| ----- | -------- | ---------- | --------- |
+[Maximum Subarray](https://leetcode.com/problems/maximum-subarray/)| [Go](./DP/MaximumSubarray.Go)| Medium| ★★★★★★|
+[Pow(x, n)](https://leetcode.com/problems/isomorphic-strings/)| [Go](./Math/Pow.Go)| Medium| ★★★★★★|
+[Merge Intervals](https://leetcode.com/problems/merge-intervals/)| [Go](./Sort/MergeIntervals.Go)| Hard| ★★★★★★|
+[Isomorphic Strings](https://leetcode.com/problems/isomorphic-strings/)| [Go](./String/IsomorphicStrings.Go)| Easy| ★★★★★★|
+[Search in Rotated Sorted Array](https://leetcode.com/problems/search-in-rotated-sorted-array/)| [Go](./Search/SearchInRotatedSortedArray.Go)| Hard| ★★★★★|
+[Search for a Range](https://leetcode.com/problems/search-for-a-range/)| [Go](./Search/SearchForARange.Go)| Medium| ★★★★★|
+[Two Sum](https://leetcode.com/problems/two-sum/)| [Go](./Array/TwoSum.Go)| Easy| ★★★★|
+[Binary Tree Level Order Traversal](https://leetcode.com/problems/binary-tree-level-order-traversal/)| [Go](./Tree/BinaryTreeLevelOrderTraversal.Go)| Easy| ★★★★|
+[Evaluate Reverse Polish Notation](https://leetcode.com/problems/evaluate-reverse-polish-notation/)| [Go](./Stack/EvaluateReversePolishNotation.Go)| Medium| ★★★|
+[Maximum Product Subarray](https://leetcode.com/problems/maximum-product-subarray/)| [Go](./DP/MaximumProductSubarray.Go)| Medium| ★★★|
+[Product of Array Except Self](https://leetcode.com/problems/product-of-array-except-self/)| [Go](./Array/ProductExceptSelf.Go)| Medium| ★★★|
+[Symmetric Tree](https://leetcode.com/problems/symmetric-tree/)| [Go](./Tree/SymmetricTree.Go)| Easy| ★★|
+
+## Amazon
+| Title | Solution | Difficulty | Frequency |
+| ----- | -------- | ---------- | --------- |
+[Two Sum](https://leetcode.com/problems/two-sum/)| [Go](./Array/TwoSum.Go)| Easy| ★★★★★★|
+[Min Cost Climbing Stairs](https://leetcode.com/problems/min-cost-climbing-stairs/)| [Go](./DP/MinCostClimbingStairs.Go)| Easy| ★★★★|
+[Number of Islands](https://leetcode.com/problems/number-of-islands/)| [Go](./DFS/NumberofIslands.Go)| Medium| ★★|
+[Add Two Numbers](https://leetcode.com/problems/add-two-numbers/)| [Go](./Math/AddTwoNumbers.Go)| Medium| ★★|
+[Reverse Linked List](https://leetcode.com/problems/reverse-linked-list/)| [Go](./LinkedList/ReverseLinkedList.Go)| Easy| ★★|
+[Valid Parentheses](https://leetcode.com/problems/valid-parentheses/)| [Go](./Stack/ValidParentheses.Go)| Easy| ★★|
+[Longest Palindromic Substring](https://leetcode.com/problems/longest-palindromic-substring/)| [Go](./DP/LongestPalindromicSubstring.Go)| Medium| ★★|
+[Trapping Rain Water](https://leetcode.com/problems/trapping-rain-water/)| [Go](./Math/TrappingRainWater.Go)| Hard| ★★|
+[Longest Substring Without Repeating Characters](https://leetcode.com/problems/longest-substring-without-repeating-characters/)| [Go](./String/LongestSubstringWithoutRepeatingCharacters.Go)| Medium| ★★|
+[Letter Combinations of a Phone Number](https://leetcode.com/problems/letter-combinations-of-a-phone-number/)| [Go](./DFS/LetterCombinationsPhoneNumber.Go)| Medium| ★★|
+[Valid Anagram](https://leetcode.com/problems/valid-anagram/)| [Go](./String/ValidAnagram.Go)| Easy| ★★|
+[Rotate Image](https://leetcode.com/problems/rotate-image/)| [Go](./Array/RotateImage.Go)| Medium| ★★|
+[Best Time to Buy and Sell Stock](https://leetcode.com/problems/best-time-to-buy-and-sell-stock/)| [Go](./DP/BestTimeBuySellStock.Go)| Easy| ★★|
+[3Sum](https://leetcode.com/problems/3sum/)| [Go](./Array/ThreeSum.Go)| Medium| ★★|
+[Sliding Window Maximum ](https://leetcode.com/problems/sliding-window-maximum/)| [Go](./Array/SlidingWindowMaximum.Go)| Hard| ★★|
+
+## Microsoft
+| Title | Solution | Difficulty | Frequency |
+| ----- | -------- | ---------- | --------- |
+[Reverse Linked List](https://leetcode.com/problems/reverse-linked-list/)| [Go](./LinkedList/ReverseLinkedList.Go)| Easy| ★★★★★★|
+[Two Sum](https://leetcode.com/problems/two-sum/)| [Go](./Array/TwoSum.Go)| Easy| ★★★★★|
+[String to Integer (atoi)](https://leetcode.com/problems/string-to-integer-atoi/)| [Go](./Math/Atoi.Go)| Easy| ★★★★|
+[Add Two Numbers](https://leetcode.com/problems/add-two-numbers/)| [Go](./Math/AddTwoNumbers.Go)| Medium| ★★★★|
+[Excel Sheet Column Number](https://leetcode.com/problems/excel-sheet-column-number/)| [Go](./Math/ExcelSheetColumnNumber.Go)| Easy| ★★★★|
+[Validate Binary Search Tree](https://leetcode.com/problems/validate-binary-search-tree/)| [Go](./Tree/ValidateBinarySearchTree.Go)| Medium| ★★★|
+[Merge Two Sorted Lists](https://leetcode.com/problems/merge-two-sorted-lists/)| [Go](./LinkedList/MergeTwoSortedLists.Go)| Easy| ★★★|
\ No newline at end of file
diff --git a/ctl/README.md b/ctl/README.md
new file mode 100644
index 000000000..cbbc8327f
--- /dev/null
+++ b/ctl/README.md
@@ -0,0 +1,20 @@
+# LeetCode-Go ctl
+
+## 配置方法
+
+1. 在`.gitignore`中,添加一行`*.toml`
+2. 在`LeetCode-Go`目录下,添加文本文件`config.toml`。
+3. 把以下内容复制到`config.toml`中。
+4. 把`config.toml`中的`test`分别修改为你的 leetcode `用户名`和`密码`。
+5. 去 leetcode 登录后,把网站 cookie 复制 (需要复制 csrftoken 和 LEETCODE_SESSION) 并替换 `config.toml`中的`Cookie`。
+
+```toml
+Username="test"
+Password="test"
+Cookie="csrftoken=XXXXXXXXX; LEETCODE_SESSION=YYYYYYYY;"
+CSRFtoken="ZZZZZZZZ"
+```
+
+## PDF 生成
+
+用 `leetcode-go pdf` 命令先生成书籍内容的合并版本 pdf.md,再用 vscode 或者其他支持 toc 目录生成的工具,生成 toc。最后用 Typora 把 md 文件转换成 pdf。就可以发布 release 新版本了。
\ No newline at end of file
diff --git a/ctl/command.go b/ctl/command.go
new file mode 100644
index 000000000..a440a5710
--- /dev/null
+++ b/ctl/command.go
@@ -0,0 +1,30 @@
+package main
+
+import (
+ "fmt"
+ "os"
+
+ "github.com/spf13/cobra"
+)
+
+var rootCmd = &cobra.Command{
+ Use: "leetcode-go",
+ Short: "A simple command line client for leetcode-go.",
+}
+
+func execute() {
+ if err := rootCmd.Execute(); err != nil {
+ fmt.Println(err)
+ os.Exit(-1)
+ }
+}
+
+func init() {
+ rootCmd.AddCommand(
+ versionCmd,
+ newBuildCommand(),
+ newLabelCommand(),
+ newPDFCommand(),
+ newRefresh(),
+ )
+}
diff --git a/ctl/config.go b/ctl/config.go
new file mode 100644
index 000000000..4288c3d25
--- /dev/null
+++ b/ctl/config.go
@@ -0,0 +1,32 @@
+package main
+
+import (
+ "fmt"
+ "log"
+
+ "github.com/BurntSushi/toml"
+)
+
+const (
+ configTOML = "config.toml"
+)
+
+type config struct {
+ Username string
+ Password string
+ Cookie string
+ CSRFtoken string
+}
+
+func (c config) String() string {
+ return fmt.Sprintf("Username: %s, Password: %s", c.Username, c.Password)
+}
+
+func getConfig() *config {
+ cfg := new(config)
+ if _, err := toml.DecodeFile(configTOML, &cfg); err != nil {
+ log.Panicf(err.Error())
+ }
+ // log.Printf("get config: %s", cfg)
+ return cfg
+}
diff --git a/ctl/error.go b/ctl/error.go
new file mode 100644
index 000000000..903460a83
--- /dev/null
+++ b/ctl/error.go
@@ -0,0 +1,21 @@
+package main
+
+import (
+ "fmt"
+ "os"
+)
+
+const (
+ // ExitSuccess define
+ ExitSuccess = iota
+ // ExitError define
+ ExitError
+ // ExitBadArgs define
+ ExitBadArgs
+)
+
+// ExitWithError define
+func ExitWithError(code int, err error) {
+ fmt.Fprintln(os.Stderr, "Error: ", err)
+ os.Exit(code)
+}
diff --git a/ctl/label.go b/ctl/label.go
new file mode 100644
index 000000000..db94bf720
--- /dev/null
+++ b/ctl/label.go
@@ -0,0 +1,348 @@
+package main
+
+import (
+ "bufio"
+ "errors"
+ "fmt"
+ "io"
+ "io/ioutil"
+ "os"
+ "regexp"
+ "strings"
+
+ "github.com/halfrost/LeetCode-Go/ctl/util"
+ "github.com/spf13/cobra"
+)
+
+var (
+ chapterOneFileOrder = []string{"_index", "Data_Structure", "Algorithm", "Time_Complexity"}
+ chapterOneMenuOrder = []string{"_index", "#关于作者", "Data_Structure", "Algorithm", "Time_Complexity"}
+ chapterTwoFileOrder = []string{"_index", "Array", "String", "Two_Pointers", "Linked_List", "Stack", "Tree", "Dynamic_Programming", "Backtracking", "Depth_First_Search", "Breadth_First_Search",
+ "Binary_Search", "Math", "Hash_Table", "Sorting", "Bit_Manipulation", "Union_Find", "Sliding_Window", "Segment_Tree", "Binary_Indexed_Tree"}
+ chapterThreeFileOrder = []string{"_index", "Segment_Tree", "UnionFind", "LRUCache", "LFUCache"}
+ preNextHeader = "----------------------------------------------\n
+
+
+# 说明
+
+此版本是 https://books.halfrost.com/leetcode 网页的离线版,由于网页版实时会更新,所以此 PDF 版难免会有一些排版或者错别字。如果读者遇到了,可以到网页版相应页面,点击页面 edit 按钮,提交 pr 进行更改。此 PDF 版本号是 V1.5.20。PDF 永久更新地址是 https://github.com/halfrost/leetcode-go/releases/,以版本号区分不同版本。笔者还是强烈推荐看在线版,有任何错误都会立即更新。如果觉得此书对刷题有一点点帮助,可以给此书点一个 star,鼓励一下笔者早点更新更多题解。
+
+> 版本号说明,V1.5.20,1 是大版本号,5 代表当前题解中有几百题,目前是 520 题,所以第二个版本号是 5,20 代表当前题解中有几十题,目前是 520 题,所以第三个版本号是 20 。
+
+# 目录
+
+[toc]
\ No newline at end of file
diff --git a/ctl/meta/Segment_Tree b/ctl/meta/Segment_Tree
new file mode 100644
index 000000000..0e7f9c743
--- /dev/null
+++ b/ctl/meta/Segment_Tree
@@ -0,0 +1,10 @@
+|218. The Skyline Problem | [Go]({{< relref "/ChapterFour/0218.The-Skyline-Problem.md" >}})| Hard | O(n log n)| O(n)|❤️|
+|307. Range Sum Query - Mutable | [Go]({{< relref "/ChapterFour/0307.Range-Sum-Query---Mutable.md" >}})| Hard | O(1)| O(n)||
+|315. Count of Smaller Numbers After Self | [Go]({{< relref "/ChapterFour/0315.Count-of-Smaller-Numbers-After-Self.md" >}})| Hard | O(n log n)| O(n)||
+|327. Count of Range Sum | [Go]({{< relref "/ChapterFour/0327.Count-of-Range-Sum.md" >}})| Hard | O(n log n)| O(n)|❤️|
+|493. Reverse Pairs | [Go]({{< relref "/ChapterFour/0493.Reverse-Pairs.md" >}})| Hard | O(n log n)| O(n)||
+|699. Falling Squares | [Go]({{< relref "/ChapterFour/0699.Falling-Squares.md" >}})| Hard | O(n log n)| O(n)|❤️|
+|715. Range Module | [Go]({{< relref "/ChapterFour/0715.Range-Module.md" >}})| Hard | O(log n)| O(n)|❤️|
+|732. My Calendar III | [Go]({{< relref "/ChapterFour/0732.My-Calendar-III.md" >}})| Hard | O(log n)| O(n)|❤️|
+|850. Rectangle Area II | [Go]({{< relref "/ChapterFour/0850.Rectangle-Area-II.md" >}})| Hard | O(n log n)| O(n)|❤️|
+|1157. Online Majority Element In Subarray | [Go]({{< relref "/ChapterFour/1157.Online-Majority-Element-In-Subarray.md" >}})| Hard | O(log n)| O(n)|❤️|
\ No newline at end of file
diff --git a/ctl/meta/Sliding_Window b/ctl/meta/Sliding_Window
new file mode 100644
index 000000000..e3ec8c4a2
--- /dev/null
+++ b/ctl/meta/Sliding_Window
@@ -0,0 +1,13 @@
+|3. Longest Substring Without Repeating Characters | [Go]({{< relref "/ChapterFour/0003.Longest-Substring-Without-Repeating-Characters.md" >}})| Medium | O(n)| O(1)|❤️|
+|76. Minimum Window Substring | [Go]({{< relref "/ChapterFour/0076.Minimum-Window-Substring.md" >}})| Hard | O(n)| O(n)|❤️|
+|239. Sliding Window Maximum | [Go]({{< relref "/ChapterFour/0239.Sliding-Window-Maximum.md" >}})| Hard | O(n * k)| O(n)|❤️|
+|424. Longest Repeating Character Replacement | [Go]({{< relref "/ChapterFour/0424.Longest-Repeating-Character-Replacement.md" >}})| Medium | O(n)| O(1) ||
+|480. Sliding Window Median | [Go]({{< relref "/ChapterFour/0480.Sliding-Window-Median.md" >}})| Hard | O(n * log k)| O(k)|❤️|
+|567. Permutation in String | [Go]({{< relref "/ChapterFour/0567.Permutation-in-String.md" >}})| Medium | O(n)| O(1)|❤️|
+|978. Longest Turbulent Subarray | [Go]({{< relref "/ChapterFour/0978.Longest-Turbulent-Subarray.md" >}})| Medium | O(n)| O(1)|❤️|
+|992. Subarrays with K Different Integers | [Go]({{< relref "/ChapterFour/0992.Subarrays-with-K-Different-Integers.md" >}})| Hard | O(n)| O(n)|❤️|
+|995. Minimum Number of K Consecutive Bit Flips | [Go]({{< relref "/ChapterFour/0995.Minimum-Number-of-K-Consecutive-Bit-Flips.md" >}})| Hard | O(n)| O(1)|❤️|
+|1004. Max Consecutive Ones III | [Go]({{< relref "/ChapterFour/1004.Max-Consecutive-Ones-III.md" >}})| Medium | O(n)| O(1) ||
+|1040. Moving Stones Until Consecutive II | [Go]({{< relref "/ChapterFour/1040.Moving-Stones-Until-Consecutive-II.md" >}})| Medium | O(n log n)| O(1) |❤️|
+|1052. Grumpy Bookstore Owner | [Go]({{< relref "/ChapterFour/1052.Grumpy-Bookstore-Owner.md" >}})| Medium | O(n log n)| O(1) ||
+|1074. Number of Submatrices That Sum to Target | [Go]({{< relref "/ChapterFour/1074.Number-of-Submatrices-That-Sum-to-Target.md" >}})| Hard | O(n^3)| O(n) |❤️|
\ No newline at end of file
diff --git a/ctl/meta/Sorting b/ctl/meta/Sorting
new file mode 100644
index 000000000..abe19d2ad
--- /dev/null
+++ b/ctl/meta/Sorting
@@ -0,0 +1,23 @@
+|56. Merge Intervals | [Go]({{< relref "/ChapterFour/0056.Merge-Intervals.md" >}})| Medium | O(n log n)| O(log n)||
+|57. Insert Interval | [Go]({{< relref "/ChapterFour/0057.Insert-Interval.md" >}})| Hard | O(n)| O(1)||
+|75. Sort Colors | [Go]({{< relref "/ChapterFour/0075.Sort-Colors.md" >}})| Medium| O(n)| O(1)|❤️|
+|147. Insertion Sort List | [Go]({{< relref "/ChapterFour/0147.Insertion-Sort-List.md" >}})| Medium | O(n^2)| O(1) |❤️|
+|148. Sort List | [Go]({{< relref "/ChapterFour/0148.Sort-List.md" >}})| Medium |O(n log n)| O(log n)|❤️|
+|164. Maximum Gap | [Go]({{< relref "/ChapterFour/0164.Maximum-Gap.md" >}})| Hard | O(n log n)| O(log n) |❤️|
+|179. Largest Number | [Go]({{< relref "/ChapterFour/0179.Largest-Number.md" >}})| Medium | O(n log n)| O(log n) |❤️|
+|220. Contains Duplicate III | [Go]({{< relref "/ChapterFour/0220.Contains-Duplicate-III.md" >}})| Medium | O(n log n)| O(1) |❤️|
+|242. Valid Anagram | [Go]({{< relref "/ChapterFour/0242.Valid-Anagram.md" >}})| Easy | O(n)| O(n) ||
+|274. H-Index | [Go]({{< relref "/ChapterFour/0274.H-Index.md" >}})| Medium | O(n)| O(n) ||
+|324. Wiggle Sort II | [Go]({{< relref "/ChapterFour/0324.Wiggle-Sort-II.md" >}})| Medium| O(n)| O(n)|❤️|
+|349. Intersection of Two Arrays | [Go]({{< relref "/ChapterFour/0349.Intersection-of-Two-Arrays.md" >}})| Easy | O(n)| O(n) ||
+|350. Intersection of Two Arrays II | [Go]({{< relref "/ChapterFour/0350.Intersection-of-Two-Arrays-II.md" >}})| Easy | O(n)| O(n) ||
+|524. Longest Word in Dictionary through Deleting | [Go]({{< relref "/ChapterFour/0524.Longest-Word-in-Dictionary-through-Deleting.md" >}})| Medium | O(n)| O(1) ||
+|767. Reorganize String | [Go]({{< relref "/ChapterFour/0767.Reorganize-String.md" >}})| Medium | O(n log n)| O(log n) |❤️|
+|853. Car Fleet | [Go]({{< relref "/ChapterFour/0853.Car-Fleet.md" >}})| Medium | O(n log n)| O(log n) ||
+|710. Random Pick with Blacklist | [Go]({{< relref "/ChapterFour/0710.Random-Pick-with-Blacklist.md" >}})| Hard | O(n)| O(n) ||
+|922. Sort Array By Parity II | [Go]({{< relref "/ChapterFour/0922.Sort-Array-By-Parity-II.md" >}})| Easy | O(n)| O(1) ||
+|969. Pancake Sorting | [Go]({{< relref "/ChapterFour/0969.Pancake-Sorting.md" >}})| Medium | O(n log n)| O(log n) |❤️|
+|973. K Closest Points to Origin | [Go]({{< relref "/ChapterFour/0973.K-Closest-Points-to-Origin.md" >}})| Medium | O(n log n)| O(log n) ||
+|976. Largest Perimeter Triangle | [Go]({{< relref "/ChapterFour/0976.Largest-Perimeter-Triangle.md" >}})| Easy | O(n log n)| O(log n) ||
+|1030. Matrix Cells in Distance Order | [Go]({{< relref "/ChapterFour/1030.Matrix-Cells-in-Distance-Order.md" >}})| Easy | O(n^2)| O(1) ||
+|1054. Distant Barcodes | [Go]({{< relref "/ChapterFour/1054.Distant-Barcodes.md" >}})| Medium | O(n log n)| O(log n) |❤️|
\ No newline at end of file
diff --git a/ctl/meta/Stack b/ctl/meta/Stack
new file mode 100644
index 000000000..a145368c2
--- /dev/null
+++ b/ctl/meta/Stack
@@ -0,0 +1,37 @@
+|20. Valid Parentheses | [Go]({{< relref "/ChapterFour/0020.Valid-Parentheses.md" >}})| Easy | O(log n)| O(1)||
+|42. Trapping Rain Water | [Go]({{< relref "/ChapterFour/0042.Trapping-Rain-Water.md" >}})| Hard | O(n)| O(1)|❤️|
+|71. Simplify Path | [Go]({{< relref "/ChapterFour/0071.Simplify-Path.md" >}})| Medium | O(n)| O(n)|❤️|
+|84. Largest Rectangle in Histogram | [Go]({{< relref "/ChapterFour/0084.Largest-Rectangle-in-Histogram.md" >}})| Medium | O(n)| O(n)|❤️|
+|94. Binary Tree Inorder Traversal | [Go]({{< relref "/ChapterFour/0094.Binary-Tree-Inorder-Traversal.md" >}})| Medium | O(n)| O(1)||
+|103. Binary Tree Zigzag Level Order Traversal | [Go]({{< relref "/ChapterFour/0103.Binary-Tree-Zigzag-Level-Order-Traversal.md" >}})| Medium | O(n)| O(n)||
+|144. Binary Tree Preorder Traversal | [Go]({{< relref "/ChapterFour/0144.Binary-Tree-Preorder-Traversal.md" >}})| Medium | O(n)| O(1)||
+|145. Binary Tree Postorder Traversal | [Go]({{< relref "/ChapterFour/0145.Binary-Tree-Postorder-Traversal.md" >}})| Hard | O(n)| O(1)||
+|150. Evaluate Reverse Polish Notation | [Go]({{< relref "/ChapterFour/0150.Evaluate-Reverse-Polish-Notation.md" >}})| Medium | O(n)| O(1)||
+|155. Min Stack | [Go]({{< relref "/ChapterFour/0155.Min-Stack.md" >}})| Easy | O(n)| O(n)||
+|173. Binary Search Tree Iterator | [Go]({{< relref "/ChapterFour/0173.Binary-Search-Tree-Iterator.md" >}})| Medium | O(n)| O(1)||
+|224. Basic Calculator | [Go]({{< relref "/ChapterFour/0224.Basic-Calculator.md" >}})| Hard | O(n)| O(n)||
+|225. Implement Stack using Queues | [Go]({{< relref "/ChapterFour/0225.Implement-Stack-using-Queues.md" >}})| Easy | O(n)| O(n)||
+|232. Implement Queue using Stacks | [Go]({{< relref "/ChapterFour/0232.Implement-Queue-using-Stacks.md" >}})| Easy | O(n)| O(n)||
+|331. Verify Preorder Serialization of a Binary Tree | [Go]({{< relref "/ChapterFour/0331.Verify-Preorder-Serialization-of-a-Binary-Tree.md" >}})| Medium | O(n)| O(1)||
+|394. Decode String | [Go]({{< relref "/ChapterFour/0394.Decode-String.md" >}})| Medium | O(n)| O(n)||
+|402. Remove K Digits | [Go]({{< relref "/ChapterFour/0402.Remove-K-Digits.md" >}})| Medium | O(n)| O(1)||
+|456. 132 Pattern | [Go]({{< relref "/ChapterFour/0456.132-Pattern.md" >}})| Medium | O(n)| O(n)||
+|496. Next Greater Element I | [Go]({{< relref "/ChapterFour/0496.Next-Greater-Element-I.md" >}})| Easy | O(n)| O(n)||
+|503. Next Greater Element II | [Go]({{< relref "/ChapterFour/0503.Next-Greater-Element-II.md" >}})| Medium | O(n)| O(n)||
+|636. Exclusive Time of Functions | [Go]({{< relref "/ChapterFour/0636.Exclusive-Time-of-Functions.md" >}})| Medium | O(n)| O(n)||
+|682. Baseball Game | [Go]({{< relref "/ChapterFour/0682.Baseball-Game.md" >}})| Easy | O(n)| O(n)||
+|726. Number of Atoms | [Go]({{< relref "/ChapterFour/0726.Number-of-Atoms.md" >}})| Hard | O(n)| O(n) |❤️|
+|735. Asteroid Collision | [Go]({{< relref "/ChapterFour/0735.Asteroid-Collision.md" >}})| Medium | O(n)| O(n) ||
+|739. Daily Temperatures | [Go]({{< relref "/ChapterFour/0739.Daily-Temperatures.md" >}})| Medium | O(n)| O(n) ||
+|844. Backspace String Compare | [Go]({{< relref "/ChapterFour/0844.Backspace-String-Compare.md" >}})| Easy | O(n)| O(n) ||
+|856. Score of Parentheses | [Go]({{< relref "/ChapterFour/0856.Score-of-Parentheses.md" >}})| Medium | O(n)| O(n)||
+|880. Decoded String at Index | [Go]({{< relref "/ChapterFour/0880.Decoded-String-at-Index.md" >}})| Medium | O(n)| O(n)||
+|895. Maximum Frequency Stack | [Go]({{< relref "/ChapterFour/0895.Maximum-Frequency-Stack.md" >}})| Hard | O(n)| O(n) ||
+|901. Online Stock Span | [Go]({{< relref "/ChapterFour/0901.Online-Stock-Span.md" >}})| Medium | O(n)| O(n) ||
+|907. Sum of Subarray Minimums | [Go]({{< relref "/ChapterFour/0907.Sum-of-Subarray-Minimums.md" >}})| Medium | O(n)| O(n)|❤️|
+|921. Minimum Add to Make Parentheses Valid | [Go]({{< relref "/ChapterFour/0921.Minimum-Add-to-Make-Parentheses-Valid.md" >}})| Medium | O(n)| O(n)||
+|946. Validate Stack Sequences | [Go]({{< relref "/ChapterFour/0946.Validate-Stack-Sequences.md" >}})| Medium | O(n)| O(n)||
+|1003. Check If Word Is Valid After Substitutions | [Go]({{< relref "/ChapterFour/1003.Check-If-Word-Is-Valid-After-Substitutions.md" >}})| Medium | O(n)| O(1)||
+|1019. Next Greater Node In Linked List | [Go]({{< relref "/ChapterFour/1019.Next-Greater-Node-In-Linked-List.md" >}})| Medium | O(n)| O(1)||
+|1021. Remove Outermost Parentheses | [Go]({{< relref "/ChapterFour/1021.Remove-Outermost-Parentheses.md" >}})| Medium | O(n)| O(1)||
+|1047. Remove All Adjacent Duplicates In String | [Go]({{< relref "/ChapterFour/1047.Remove-All-Adjacent-Duplicates-In-String.md" >}})| Medium | O(n)| O(1)||
\ No newline at end of file
diff --git a/ctl/meta/String b/ctl/meta/String
new file mode 100644
index 000000000..e2d905f71
--- /dev/null
+++ b/ctl/meta/String
@@ -0,0 +1,20 @@
+|3. Longest Substring Without Repeating Characters | [Go]({{< relref "/ChapterFour/0003.Longest-Substring-Without-Repeating-Characters.md" >}})| Medium | O(n)| O(1)|❤️|
+|17. Letter Combinations of a Phone Number | [Go]({{< relref "/ChapterFour/0017.Letter-Combinations-of-a-Phone-Number.md" >}})| Medium | O(log n)| O(1)||
+|20. Valid Parentheses | [Go]({{< relref "/ChapterFour/0020.Valid-Parentheses.md" >}})| Easy | O(log n)| O(1)||
+|22. Generate Parentheses | [Go]({{< relref "/ChapterFour/0022.Generate-Parentheses.md" >}})| Medium | O(log n)| O(1)||
+|28. Implement strStr() | [Go]({{< relref "/ChapterFour/0028.Implement-strStr.md" >}})| Easy | O(n)| O(1)||
+|30. Substring with Concatenation of All Words | [Go]({{< relref "/ChapterFour/0030.Substring-with-Concatenation-of-All-Words.md" >}})| Hard | O(n)| O(n)|❤️|
+|49. Group Anagrams | [Go]({{< relref "/ChapterFour/0049.Group-Anagrams.md" >}})| Medium | O(n log n)| O(n)||
+|71. Simplify Path | [Go]({{< relref "/ChapterFour/0071.Simplify-Path.md" >}})| Medium | O(n)| O(n)||
+|76. Minimum Window Substring | [Go]({{< relref "/ChapterFour/0076.Minimum-Window-Substring.md" >}})| Hard | O(n)| O(n)|❤️|
+|91. Decode Ways | [Go]({{< relref "/ChapterFour/0091.Decode-Ways.md" >}})| Medium | O(n)| O(n)||
+|93. Restore IP Addresses | [Go]({{< relref "/ChapterFour/0093.Restore-IP-Addresses.md" >}})| Medium | O(n)| O(n)|❤️|
+|125. Valid Palindrome | [Go]({{< relref "/ChapterFour/0125.Valid-Palindrome.md" >}})| Easy | O(n)| O(1)||
+|126. Word Ladder II | [Go]({{< relref "/ChapterFour/0126.Word-Ladder-II.md" >}})| Hard | O(n)| O(n^2)|❤️|
+|344. Reverse String | [Go]({{< relref "/ChapterFour/0344.Reverse-String.md" >}})| Easy | O(n)| O(1)||
+|345. Reverse Vowels of a String | [Go]({{< relref "/ChapterFour/0345.Reverse-Vowels-of-a-String.md" >}})| Easy | O(n)| O(1)||
+|767. Reorganize String | [Go]({{< relref "/ChapterFour/0767.Reorganize-String.md" >}})| Medium | O(n log n)| O(log n) |❤️|
+|842. Split Array into Fibonacci Sequence | [Go]({{< relref "/ChapterFour/0842.Split-Array-into-Fibonacci-Sequence.md" >}})| Medium | O(n^2)| O(1)|❤️|
+|856. Score of Parentheses | [Go]({{< relref "/ChapterFour/0856.Score-of-Parentheses.md" >}})| Medium | O(n)| O(n)||
+|925. Long Pressed Name | [Go]({{< relref "/ChapterFour/0925.Long-Pressed-Name.md" >}})| Easy | O(n)| O(1)||
+|1003. Check If Word Is Valid After Substitutions | [Go]({{< relref "/ChapterFour/1003.Check-If-Word-Is-Valid-After-Substitutions.md" >}})| Medium | O(n)| O(1)||
\ No newline at end of file
diff --git a/ctl/meta/Tree b/ctl/meta/Tree
new file mode 100644
index 000000000..ce2a837bb
--- /dev/null
+++ b/ctl/meta/Tree
@@ -0,0 +1,33 @@
+|94. Binary Tree Inorder Traversal | [Go]({{< relref "/ChapterFour/0094.Binary-Tree-Inorder-Traversal.md" >}})| Medium | O(n)| O(1)||
+|96. Unique Binary Search Trees | [Go]({{< relref "/ChapterFour/0096.Unique-Binary-Search-Trees.md" >}})| Medium | O(n^2)| O(n)||
+|98. Validate Binary Search Tree | [Go]({{< relref "/ChapterFour/0098.Validate-Binary-Search-Tree.md" >}})| Medium | O(n)| O(1)||
+|99. Recover Binary Search Tree | [Go]({{< relref "/ChapterFour/0099.Recover-Binary-Search-Tree.md" >}})| Hard | O(n)| O(1)||
+|100. Same Tree | [Go]({{< relref "/ChapterFour/0100.Same-Tree.md" >}})| Easy | O(n)| O(1)||
+|101. Symmetric Tree | [Go]({{< relref "/ChapterFour/0101.Symmetric-Tree.md" >}})| Easy | O(n)| O(1)||
+|102. Binary Tree Level Order Traversal | [Go]({{< relref "/ChapterFour/0102.Binary-Tree-Level-Order-Traversal.md" >}})| Medium | O(n)| O(1)||
+|103. Binary Tree Zigzag Level Order Traversal | [Go]({{< relref "/ChapterFour/0103.Binary-Tree-Zigzag-Level-Order-Traversal.md" >}})| Medium | O(n)| O(n)||
+|104. Maximum Depth of Binary Tree | [Go]({{< relref "/ChapterFour/0104.Maximum-Depth-of-Binary-Tree.md" >}})| Easy | O(n)| O(1)||
+|107. Binary Tree Level Order Traversal II | [Go]({{< relref "/ChapterFour/0107.Binary-Tree-Level-Order-Traversal-II.md" >}})| Easy | O(n)| O(1)||
+|108. Convert Sorted Array to Binary Search Tree | [Go]({{< relref "/ChapterFour/0108.Convert-Sorted-Array-to-Binary-Search-Tree.md" >}})| Easy | O(n)| O(1)||
+|110. Balanced Binary Tree | [Go]({{< relref "/ChapterFour/0110.Balanced-Binary-Tree.md" >}})| Easy | O(n)| O(1)||
+|111. Minimum Depth of Binary Tree | [Go]({{< relref "/ChapterFour/0111.Minimum-Depth-of-Binary-Tree.md" >}})| Easy | O(n)| O(1)||
+|112. Path Sum | [Go]({{< relref "/ChapterFour/0112.Path-Sum.md" >}})| Easy | O(n)| O(1)||
+|113. Path Sum II | [Go]({{< relref "/ChapterFour/0113.Path-Sum-II.md" >}})| Medium | O(n)| O(1)||
+|114. Flatten Binary Tree to Linked List | [Go]({{< relref "/ChapterFour/0114.Flatten-Binary-Tree-to-Linked-List.md" >}})| Medium | O(n)| O(1)||
+|124. Binary Tree Maximum Path Sum | [Go]({{< relref "/ChapterFour/0124.Binary-Tree-Maximum-Path-Sum.md" >}})| Hard | O(n)| O(1)||
+|129. Sum Root to Leaf Numbers | [Go]({{< relref "/ChapterFour/0129.Sum-Root-to-Leaf-Numbers.md" >}})| Medium | O(n)| O(1)||
+|144. Binary Tree Preorder Traversal | [Go]({{< relref "/ChapterFour/0144.Binary-Tree-Preorder-Traversal.md" >}})| Medium | O(n)| O(1)||
+|145. Binary Tree Postorder Traversal | [Go]({{< relref "/ChapterFour/0145.Binary-Tree-Postorder-Traversal.md" >}})| Hard | O(n)| O(1)||
+|173. Binary Search Tree Iterator | [Go]({{< relref "/ChapterFour/0173.Binary-Search-Tree-Iterator.md" >}})| Medium | O(n)| O(1)||
+|199. Binary Tree Right Side View | [Go]({{< relref "/ChapterFour/0199.Binary-Tree-Right-Side-View.md" >}})| Medium | O(n)| O(1)||
+|222. Count Complete Tree Nodes | [Go]({{< relref "/ChapterFour/0222.Count-Complete-Tree-Nodes.md" >}})| Medium | O(n)| O(1)||
+|226. Invert Binary Tree | [Go]({{< relref "/ChapterFour/0226.Invert-Binary-Tree.md" >}})| Easy | O(n)| O(1)||
+|230. Kth Smallest Element in a BST | [Go]({{< relref "/ChapterFour/0230.Kth-Smallest-Element-in-a-BST.md" >}})| Medium | O(n)| O(1)||
+|235. Lowest Common Ancestor of a Binary Search Tree | [Go]({{< relref "/ChapterFour/0235.Lowest-Common-Ancestor-of-a-Binary-Search-Tree.md" >}})| Easy | O(n)| O(1)||
+|236. Lowest Common Ancestor of a Binary Tree | [Go]({{< relref "/ChapterFour/0236.Lowest-Common-Ancestor-of-a-Binary-Tree.md" >}})| Medium | O(n)| O(1)||
+|257. Binary Tree Paths | [Go]({{< relref "/ChapterFour/0257.Binary-Tree-Paths.md" >}})| Easy | O(n)| O(1)||
+|404. Sum of Left Leaves | [Go]({{< relref "/ChapterFour/0404.Sum-of-Left-Leaves.md" >}})| Easy | O(n)| O(1)||
+|437. Path Sum III | [Go]({{< relref "/ChapterFour/0437.Path-Sum-III.md" >}})| Easy | O(n)| O(1)||
+|515. Find Largest Value in Each Tree Row | [Go]({{< relref "/ChapterFour/0515.Find-Largest-Value-in-Each-Tree-Row.md" >}})| Medium | O(n)| O(n)||
+|637. Average of Levels in Binary Tree | [Go]({{< relref "/ChapterFour/0637.Average-of-Levels-in-Binary-Tree.md" >}})| Easy | O(n)| O(n)||
+|993. Cousins in Binary Tree | [Go]({{< relref "/ChapterFour/0993.Cousins-in-Binary-Tree.md" >}})| Easy | O(n)| O(1)||
\ No newline at end of file
diff --git a/ctl/meta/Two_Pointers b/ctl/meta/Two_Pointers
new file mode 100644
index 000000000..2c238556f
--- /dev/null
+++ b/ctl/meta/Two_Pointers
@@ -0,0 +1,50 @@
+|3. Longest Substring Without Repeating Characters | [Go]({{< relref "/ChapterFour/0003.Longest-Substring-Without-Repeating-Characters.md" >}})| Medium | O(n)| O(1)|❤️|
+|11. Container With Most Water | [Go]({{< relref "/ChapterFour/0011.Container-With-Most-Water.md" >}})| Medium | O(n)| O(1)||
+|15. 3Sum | [Go]({{< relref "/ChapterFour/0015.3Sum.md" >}})| Medium | O(n^2)| O(n)|❤️|
+|16. 3Sum Closest | [Go]({{< relref "/ChapterFour/0016.3Sum-Closest.md" >}})| Medium | O(n^2)| O(1)|❤️|
+|18. 4Sum | [Go]({{< relref "/ChapterFour/0018.4Sum.md" >}})| Medium | O(n^3)| O(n^2)|❤️|
+|19. Remove Nth Node From End of List | [Go]({{< relref "/ChapterFour/0019.Remove-Nth-Node-From-End-of-List.md" >}})| Medium | O(n)| O(1)||
+|26. Remove Duplicates from Sorted Array | [Go]({{< relref "/ChapterFour/0026.Remove-Duplicates-from-Sorted-Array.md" >}})| Easy | O(n)| O(1)||
+|27. Remove Element | [Go]({{< relref "/ChapterFour/0027.Remove-Element.md" >}})| Easy | O(n)| O(1)||
+|28. Implement strStr() | [Go]({{< relref "/ChapterFour/0028.Implement-strStr.md" >}})| Easy | O(n)| O(1)||
+|30. Substring with Concatenation of All Words | [Go]({{< relref "/ChapterFour/0030.Substring-with-Concatenation-of-All-Words.md" >}})| Hard | O(n)| O(n)|❤️|
+|42. Trapping Rain Water | [Go]({{< relref "/ChapterFour/0042.Trapping-Rain-Water.md" >}})| Hard | O(n)| O(1)|❤️|
+|61. Rotate List | [Go]({{< relref "/ChapterFour/0061.Rotate-List.md" >}})| Medium | O(n)| O(1)||
+|75. Sort Colors | [Go]({{< relref "/ChapterFour/0075.Sort-Colors.md" >}})| Medium| O(n)| O(1)|❤️|
+|76. Minimum Window Substring | [Go]({{< relref "/ChapterFour/0076.Minimum-Window-Substring.md" >}})| Hard | O(n)| O(n)|❤️|
+|80. Remove Duplicates from Sorted Array II | [Go]({{< relref "/ChapterFour/0080.Remove-Duplicates-from-Sorted-Array-II.md" >}})| Medium | O(n)| O(1||
+|86. Partition List | [Go]({{< relref "/ChapterFour/0086.Partition-List.md" >}})| Medium | O(n)| O(1)|❤️|
+|88. Merge Sorted Array | [Go]({{< relref "/ChapterFour/0088.Merge-Sorted-Array.md" >}})| Easy | O(n)| O(1)|❤️|
+|125. Valid Palindrome | [Go]({{< relref "/ChapterFour/0125.Valid-Palindrome.md" >}})| Easy | O(n)| O(1)||
+|141. Linked List Cycle | [Go]({{< relref "/ChapterFour/0141.Linked-List-Cycle.md" >}})| Easy | O(n)| O(1)|❤️|
+|142. Linked List Cycle II | [Go]({{< relref "/ChapterFour/0142.Linked-List-Cycle-II.md" >}})| Medium | O(n)| O(1)|❤️|
+|167. Two Sum II - Input array is sorted | [Go]({{< relref "/ChapterFour/0167.Two-Sum-II---Input-array-is-sorted.md" >}})| Easy | O(n)| O(1)||
+|209. Minimum Size Subarray Sum | [Go]({{< relref "/ChapterFour/0209.Minimum-Size-Subarray-Sum.md" >}})| Medium | O(n)| O(1)||
+|234. Palindrome Linked List | [Go]({{< relref "/ChapterFour/0234.Palindrome-Linked-List.md" >}})| Easy | O(n)| O(1)||
+|283. Move Zeroes | [Go]({{< relref "/ChapterFour/0283.Move-Zeroes.md" >}})| Easy | O(n)| O(1)||
+|287. Find the Duplicate Number | [Go]({{< relref "/ChapterFour/0287.Find-the-Duplicate-Number.md" >}})| Easy | O(n)| O(1)|❤️|
+|344. Reverse String | [Go]({{< relref "/ChapterFour/0344.Reverse-String.md" >}})| Easy | O(n)| O(1)||
+|345. Reverse Vowels of a String | [Go]({{< relref "/ChapterFour/0345.Reverse-Vowels-of-a-String.md" >}})| Easy | O(n)| O(1)||
+|349. Intersection of Two Arrays | [Go]({{< relref "/ChapterFour/0349.Intersection-of-Two-Arrays.md" >}})| Easy | O(n)| O(n) ||
+|350. Intersection of Two Arrays II | [Go]({{< relref "/ChapterFour/0350.Intersection-of-Two-Arrays-II.md" >}})| Easy | O(n)| O(n) ||
+|424. Longest Repeating Character Replacement | [Go]({{< relref "/ChapterFour/0424.Longest-Repeating-Character-Replacement.md" >}})| Medium | O(n)| O(1) ||
+|524. Longest Word in Dictionary through Deleting | [Go]({{< relref "/ChapterFour/0524.Longest-Word-in-Dictionary-through-Deleting.md" >}})| Medium | O(n)| O(1) ||
+|532. K-diff Pairs in an Array | [Go]({{< relref "/ChapterFour/0532.K-diff-Pairs-in-an-Array.md" >}})| Easy | O(n)| O(n)||
+|567. Permutation in String | [Go]({{< relref "/ChapterFour/0567.Permutation-in-String.md" >}})| Medium | O(n)| O(1)|❤️|
+|713. Subarray Product Less Than K | [Go]({{< relref "/ChapterFour/0713.Subarray-Product-Less-Than-K.md" >}})| Medium | O(n)| O(1)||
+|763. Partition Labels | [Go]({{< relref "/ChapterFour/0763.Partition-Labels.md" >}})| Medium | O(n)| O(1)|❤️|
+|826. Most Profit Assigning Work | [Go]({{< relref "/ChapterFour/0826.Most-Profit-Assigning-Work.md" >}})| Medium | O(n log n)| O(n)||
+|828. Count Unique Characters of All Substrings of a Given String | [Go]({{< relref "/ChapterFour/0828.Count-Unique-Characters-of-All-Substrings-of-a-Given-String.md" >}})| Hard | O(n)| O(1)|❤️|
+|838. Push Dominoes | [Go]({{< relref "/ChapterFour/0838.Push-Dominoes.md" >}})| Medium | O(n)| O(n)||
+|844. Backspace String Compare | [Go]({{< relref "/ChapterFour/0844.Backspace-String-Compare.md" >}})| Easy | O(n)| O(n) ||
+|845. Longest Mountain in Array | [Go]({{< relref "/ChapterFour/0845.Longest-Mountain-in-Array.md" >}})| Medium | O(n)| O(1) ||
+|881. Boats to Save People | [Go]({{< relref "/ChapterFour/0881.Boats-to-Save-People.md" >}})| Medium | O(n log n)| O(1) ||
+|904. Fruit Into Baskets | [Go]({{< relref "/ChapterFour/0904.Fruit-Into-Baskets.md" >}})| Medium | O(n log n)| O(1) ||
+|923. 3Sum With Multiplicity | [Go]({{< relref "/ChapterFour/0923.3Sum-With-Multiplicity.md" >}})| Medium | O(n^2)| O(n) ||
+|925. Long Pressed Name | [Go]({{< relref "/ChapterFour/0925.Long-Pressed-Name.md" >}})| Easy | O(n)| O(1)||
+|930. Binary Subarrays With Sum | [Go]({{< relref "/ChapterFour/0930.Binary-Subarrays-With-Sum.md" >}})| Medium | O(n)| O(n) |❤️|
+|977. Squares of a Sorted Array | [Go]({{< relref "/ChapterFour/0977.Squares-of-a-Sorted-Array.md" >}})| Easy | O(n)| O(1)||
+|986. Interval List Intersections | [Go]({{< relref "/ChapterFour/0986.Interval-List-Intersections.md" >}})| Medium | O(n)| O(1)||
+|992. Subarrays with K Different Integers | [Go]({{< relref "/ChapterFour/0992.Subarrays-with-K-Different-Integers.md" >}})| Hard | O(n)| O(n)|❤️|
+|1004. Max Consecutive Ones III | [Go]({{< relref "/ChapterFour/1004.Max-Consecutive-Ones-III.md" >}})| Medium | O(n)| O(1) ||
+|1093. Statistics from a Large Sample | [Go]({{< relref "/ChapterFour/1093.Statistics-from-a-Large-Sample.md" >}})| Medium | O(n)| O(1) ||
\ No newline at end of file
diff --git a/ctl/meta/Union_Find b/ctl/meta/Union_Find
new file mode 100644
index 000000000..66424cf4a
--- /dev/null
+++ b/ctl/meta/Union_Find
@@ -0,0 +1,18 @@
+|128. Longest Consecutive Sequence | [Go]({{< relref "/ChapterFour/0128.Longest-Consecutive-Sequence.md" >}})| Hard | O(n)| O(n)|❤️|
+|130. Surrounded Regions | [Go]({{< relref "/ChapterFour/0130.Surrounded-Regions.md" >}})| Medium | O(m\*n)| O(m\*n)||
+|200. Number of Islands | [Go]({{< relref "/ChapterFour/0200.Number-of-Islands.md" >}})| Medium | O(m\*n)| O(m\*n)||
+|399. Evaluate Division | [Go]({{< relref "/ChapterFour/0399.Evaluate-Division.md" >}})| Medium | O(n)| O(n)||
+|547. Number of Provinces | [Go]({{< relref "/ChapterFour/0547.Number-of-Provinces.md" >}})| Medium | O(n^2)| O(n)||
+|684. Redundant Connection | [Go]({{< relref "/ChapterFour/0684.Redundant-Connection.md" >}})| Medium | O(n)| O(n)||
+|685. Redundant Connection II | [Go]({{< relref "/ChapterFour/0685.Redundant-Connection-II.md" >}})| Hard | O(n)| O(n)||
+|721. Accounts Merge | [Go]({{< relref "/ChapterFour/0721.Accounts-Merge.md" >}})| Medium | O(n)| O(n)|❤️|
+|765. Couples Holding Hands | [Go]({{< relref "/ChapterFour/0765.Couples-Holding-Hands.md" >}})| Hard | O(n)| O(n)|❤️|
+|778. Swim in Rising Water | [Go]({{< relref "/ChapterFour/0778.Swim-in-Rising-Water.md" >}})| Hard | O(n^2)| O(n)|❤️|
+|803. Bricks Falling When Hit | [Go]({{< relref "/ChapterFour/0803.Bricks-Falling-When-Hit.md" >}})| Hard | O(n^2)| O(n)|❤️|
+|839. Similar String Groups | [Go]({{< relref "/ChapterFour/0839.Similar-String-Groups.md" >}})| Hard | O(n^2)| O(n)||
+|924. Minimize Malware Spread | [Go]({{< relref "/ChapterFour/0924.Minimize-Malware-Spread.md" >}})| Hard | O(m\*n)| O(n)||
+|928. Minimize Malware Spread II | [Go]({{< relref "/ChapterFour/0928.Minimize-Malware-Spread-II.md" >}})| Hard | O(m\*n)| O(n)|❤️|
+|947. Most Stones Removed with Same Row or Column | [Go]({{< relref "/ChapterFour/0947.Most-Stones-Removed-with-Same-Row-or-Column.md" >}})| Medium | O(n)| O(n)||
+|952. Largest Component Size by Common Factor | [Go]({{< relref "/ChapterFour/0952.Largest-Component-Size-by-Common-Factor.md" >}})| Hard | O(n)| O(n)|❤️|
+|959. Regions Cut By Slashes | [Go]({{< relref "/ChapterFour/0959.Regions-Cut-By-Slashes.md" >}})| Medium | O(n^2)| O(n^2)|❤️|
+|990. Satisfiability of Equality Equations | [Go]({{< relref "/ChapterFour/0990.Satisfiability-of-Equality-Equations.md" >}})| Medium | O(n)| O(n)||
\ No newline at end of file
diff --git a/ctl/meta/meta b/ctl/meta/meta
new file mode 100644
index 000000000..a28e1a67e
--- /dev/null
+++ b/ctl/meta/meta
@@ -0,0 +1,2 @@
+| Title | Solution | Difficulty | Time | Space |收藏|
+| ----- | :--------: | :----------: | :----: | :-----: | :-----: |
\ No newline at end of file
diff --git a/ctl/models/go.mod b/ctl/models/go.mod
new file mode 100644
index 000000000..2b1389a7f
--- /dev/null
+++ b/ctl/models/go.mod
@@ -0,0 +1,7 @@
+module github.com/halfrost/LeetCode-Go/ctl/models
+
+go 1.19
+
+replace github.com/halfrost/LeetCode-Go/ctl/models => ../util
+
+require github.com/halfrost/LeetCode-Go/ctl/util v0.0.0-20220910225043-e3bb5aff34d0
diff --git a/ctl/models/go.sum b/ctl/models/go.sum
new file mode 100644
index 000000000..2c3eec0c9
--- /dev/null
+++ b/ctl/models/go.sum
@@ -0,0 +1,2 @@
+github.com/halfrost/LeetCode-Go/ctl/util v0.0.0-20220910225043-e3bb5aff34d0 h1:WAOAj59szR52uAnEQljAt7ucpbGGOsy0xgR/NeP4Xbc=
+github.com/halfrost/LeetCode-Go/ctl/util v0.0.0-20220910225043-e3bb5aff34d0/go.mod h1:+cA8KYcbGxP2Itd3NG+QJVGL/MEZISKlei0tvgDeEag=
diff --git a/ctl/models/lcproblems.go b/ctl/models/lcproblems.go
new file mode 100644
index 000000000..e73537d64
--- /dev/null
+++ b/ctl/models/lcproblems.go
@@ -0,0 +1,104 @@
+package models
+
+import (
+ "fmt"
+ "strings"
+)
+
+// LeetCodeProblemAll define
+type LeetCodeProblemAll struct {
+ UserName string `json:"user_name"`
+ NumSolved int32 `json:"num_solved"`
+ NumTotal int32 `json:"num_total"`
+ AcEasy int32 `json:"ac_easy"`
+ AcMedium int32 `json:"ac_medium"`
+ AcHard int32 `json:"ac_hard"`
+ StatStatusPairs []StatStatusPairs `json:"stat_status_pairs"`
+ FrequencyHigh float64 `json:"frequency_high"`
+ FrequencyMid float64 `json:"frequency_mid"`
+ CategorySlug string `json:"category_slug"`
+ AcEasyTotal int32
+ AcMediumTotal int32
+ AcHardTotal int32
+}
+
+// ConvertUserInfoModel define
+func ConvertUserInfoModel(lpa LeetCodeProblemAll) UserInfo {
+ info := UserInfo{}
+ info.UserName = lpa.UserName
+ info.NumSolved = lpa.NumSolved
+ info.NumTotal = lpa.NumTotal
+ info.AcEasy = lpa.AcEasy
+ info.AcMedium = lpa.AcMedium
+ info.AcHard = lpa.AcHard
+ info.FrequencyHigh = lpa.FrequencyHigh
+ info.FrequencyMid = lpa.FrequencyMid
+ info.CategorySlug = lpa.CategorySlug
+ return info
+}
+
+// StatStatusPairs define
+type StatStatusPairs struct {
+ Stat Stat `json:"stat"`
+ Status string `json:"status"`
+ Difficulty Difficulty `json:"difficulty"`
+ PaidOnly bool `json:"paid_only"`
+ IsFavor bool `json:"is_favor"`
+ Frequency float64 `json:"frequency"`
+ Progress float64 `json:"progress"`
+}
+
+// ConvertMdModelFromSsp define
+func ConvertMdModelFromSsp(problems []StatStatusPairs) []Mdrow {
+ mdrows := []Mdrow{}
+ for _, problem := range problems {
+ res := Mdrow{}
+ res.FrontendQuestionID = problem.Stat.FrontendQuestionID
+ res.QuestionTitle = strings.TrimSpace(problem.Stat.QuestionTitle)
+ res.QuestionTitleSlug = strings.TrimSpace(problem.Stat.QuestionTitleSlug)
+ res.Acceptance = fmt.Sprintf("%.1f%%", (problem.Stat.TotalAcs/problem.Stat.TotalSubmitted)*100)
+ res.Difficulty = DifficultyMap[problem.Difficulty.Level]
+ res.Frequency = fmt.Sprintf("%f", problem.Frequency)
+ mdrows = append(mdrows, res)
+ }
+ return mdrows
+}
+
+// ConvertMdModelFromIds define
+func ConvertMdModelFromIds(problemsMap map[int]StatStatusPairs, ids []int) []Mdrow {
+ mdrows := []Mdrow{}
+ for _, v := range ids {
+ res, problem := Mdrow{}, problemsMap[v]
+ res.FrontendQuestionID = problem.Stat.FrontendQuestionID
+ res.QuestionTitle = strings.TrimSpace(problem.Stat.QuestionTitle)
+ res.QuestionTitleSlug = strings.TrimSpace(problem.Stat.QuestionTitleSlug)
+ res.Acceptance = fmt.Sprintf("%.1f%%", (problem.Stat.TotalAcs/problem.Stat.TotalSubmitted)*100)
+ res.Difficulty = DifficultyMap[problem.Difficulty.Level]
+ res.Frequency = fmt.Sprintf("%f", problem.Frequency)
+ mdrows = append(mdrows, res)
+ }
+ return mdrows
+}
+
+// Stat define
+type Stat struct {
+ QuestionTitle string `json:"question__title"`
+ QuestionTitleSlug string `json:"question__title_slug"`
+ TotalAcs float64 `json:"total_acs"`
+ TotalSubmitted float64 `json:"total_submitted"`
+ Acceptance string
+ Difficulty string
+ FrontendQuestionID int32 `json:"frontend_question_id"`
+}
+
+// Difficulty define
+type Difficulty struct {
+ Level int32 `json:"level"`
+}
+
+// DifficultyMap define
+var DifficultyMap = map[int32]string{
+ 1: "Easy",
+ 2: "Medium",
+ 3: "Hard",
+}
diff --git a/ctl/models/mdrow.go b/ctl/models/mdrow.go
new file mode 100644
index 000000000..5ad90ec0e
--- /dev/null
+++ b/ctl/models/mdrow.go
@@ -0,0 +1,90 @@
+package models
+
+import (
+ "fmt"
+ "strings"
+)
+
+// Mdrow define
+type Mdrow struct {
+ FrontendQuestionID int32 `json:"question_id"`
+ QuestionTitle string `json:"question__title"`
+ QuestionTitleSlug string `json:"question__title_slug"`
+ SolutionPath string `json:"solution_path"`
+ Acceptance string `json:"acceptance"`
+ Difficulty string `json:"difficulty"`
+ Frequency string `json:"frequency"`
+}
+
+// GenerateMdRows define
+func GenerateMdRows(solutionIds []int, mdrows []Mdrow) {
+ mdMap := map[int]Mdrow{}
+ for _, row := range mdrows {
+ mdMap[int(row.FrontendQuestionID)] = row
+ }
+ for i := 0; i < len(solutionIds); i++ {
+ if row, ok := mdMap[solutionIds[i]]; ok {
+ s7 := standardizedTitle(row.QuestionTitle, row.FrontendQuestionID)
+ mdMap[solutionIds[i]] = Mdrow{
+ FrontendQuestionID: row.FrontendQuestionID,
+ QuestionTitle: strings.TrimSpace(row.QuestionTitle),
+ QuestionTitleSlug: row.QuestionTitleSlug,
+ SolutionPath: fmt.Sprintf("[Go](https://github.com/halfrost/leetcode-go/tree/master/leetcode/%v)", fmt.Sprintf("%04d.%v", solutionIds[i], s7)),
+ Acceptance: row.Acceptance,
+ Difficulty: row.Difficulty,
+ Frequency: row.Frequency,
+ }
+ } else {
+ fmt.Printf("序号不存在 len(solutionIds) = %v len(mdrows) = %v len(solutionIds) = %v solutionIds[i] = %v QuestionTitle = %v\n", len(solutionIds), len(mdrows), len(solutionIds), solutionIds[i], mdrows[solutionIds[i]-1].QuestionTitle)
+ }
+ }
+ for i := range mdrows {
+ mdrows[i] = Mdrow{
+ FrontendQuestionID: mdrows[i].FrontendQuestionID,
+ QuestionTitle: strings.TrimSpace(mdrows[i].QuestionTitle),
+ QuestionTitleSlug: mdrows[i].QuestionTitleSlug,
+ SolutionPath: mdMap[int(mdrows[i].FrontendQuestionID)].SolutionPath,
+ Acceptance: mdrows[i].Acceptance,
+ Difficulty: mdrows[i].Difficulty,
+ Frequency: mdrows[i].Frequency,
+ }
+ }
+ // fmt.Printf("mdrows = %v\n\n", mdrows)
+}
+
+// | 0001 | Two Sum | [Go](https://github.com/halfrost/leetcode-go/tree/master/leetcode/0001.Two-Sum)| 45.6% | Easy | |
+func (m Mdrow) tableLine() string {
+ return fmt.Sprintf("|%04d|%v|%v|%v|%v||\n", m.FrontendQuestionID, m.QuestionTitle, m.SolutionPath, m.Acceptance, m.Difficulty)
+}
+
+// SortByQuestionID define
+type SortByQuestionID []Mdrow
+
+func (a SortByQuestionID) Len() int { return len(a) }
+func (a SortByQuestionID) Swap(i, j int) { a[i], a[j] = a[j], a[i] }
+func (a SortByQuestionID) Less(i, j int) bool {
+ return a[i].FrontendQuestionID < a[j].FrontendQuestionID
+}
+
+// Mdrows define
+type Mdrows struct {
+ Mdrows []Mdrow
+}
+
+// | No. | Title | Solution | Acceptance | Difficulty | Frequency |
+// |:--------:|:--------------------------------------------------------------|:--------:|:--------:|:--------:|:--------:|
+func (mds Mdrows) table() string {
+ res := "| No. | Title | Solution | Acceptance | Difficulty | Frequency |\n"
+ res += "|:--------:|:--------------------------------------------------------------|:--------:|:--------:|:--------:|:--------:|\n"
+ for _, p := range mds.Mdrows {
+ res += p.tableLine()
+ }
+ // 加这一行是为了撑开整个表格
+ res += "|------------|-------------------------------------------------------|-------| ----------------| ---------------|-------------|"
+ return res
+}
+
+// AvailableTable define
+func (mds Mdrows) AvailableTable() string {
+ return mds.table()
+}
diff --git a/ctl/models/tagproblem.go b/ctl/models/tagproblem.go
new file mode 100644
index 000000000..5bc04ab8c
--- /dev/null
+++ b/ctl/models/tagproblem.go
@@ -0,0 +1,284 @@
+package models
+
+import (
+ "encoding/json"
+ "fmt"
+ "strconv"
+ "strings"
+
+ "github.com/halfrost/LeetCode-Go/ctl/util"
+)
+
+// Graphql define
+type Graphql struct {
+ OperationName string `json:"operationName"`
+ Variables struct {
+ TitleSlug string `json:"titleSlug"`
+ } `json:"variables"`
+ Query string `json:"query"`
+}
+
+// GraphQLResp define
+type GraphQLResp struct {
+ Data struct {
+ TopicTag TopicTag `json:"topicTag"`
+ FavoritesLists FavoritesLists `json:"favoritesLists"`
+ } `json:"data"`
+}
+
+// TopicTag define
+type TopicTag struct {
+ Name string `json:"name"`
+ TranslatedName string `json:"translatedName"`
+ Slug string `json:"slug"`
+ Questions []Question `json:"questions"`
+ Frequencies string `json:"frequencies"`
+ Typename string `json:"__typename"`
+}
+
+// Question define
+type Question struct {
+ Status string `json:"status"`
+ QuestionID string `json:"questionId"`
+ QuestionFrontendID string `json:"questionFrontendId"`
+ Title string `json:"title"`
+ TitleSlug string `json:"titleSlug"`
+ TranslatedTitle string `json:"translatedTitle"`
+ Stats string `json:"stats"`
+ Difficulty string `json:"difficulty"`
+ TopicTags []TopicTags `json:"topicTags"`
+ CompanyTags interface{} `json:"companyTags"`
+ Typename string `json:"__typename"`
+}
+
+// TopicTags define
+type TopicTags struct {
+ Name string `json:"name"`
+ TranslatedName string `json:"translatedName"`
+ Slug string `json:"slug"`
+ Typename string `json:"__typename"`
+}
+
+func (q Question) generateTagStatus() (TagStatus, error) {
+ var ts TagStatus
+ err := json.Unmarshal([]byte(q.Stats), &ts)
+ if err != nil {
+ fmt.Println(err)
+ return ts, err
+ }
+ return ts, nil
+}
+
+// TagStatus define
+type TagStatus struct {
+ TotalAccepted string `json:"totalAccepted"`
+ TotalSubmission string `json:"totalSubmission"`
+ TotalAcceptedRaw int32 `json:"totalAcceptedRaw"`
+ TotalSubmissionRaw int32 `json:"totalSubmissionRaw"`
+ AcRate string `json:"acRate"`
+}
+
+// ConvertMdModelFromQuestions define
+func ConvertMdModelFromQuestions(questions []Question) []Mdrow {
+ mdrows := []Mdrow{}
+ for _, question := range questions {
+ res := Mdrow{}
+ v, _ := strconv.Atoi(question.QuestionFrontendID)
+ res.FrontendQuestionID = int32(v)
+ res.QuestionTitle = strings.TrimSpace(question.Title)
+ res.QuestionTitleSlug = strings.TrimSpace(question.TitleSlug)
+ q, err := question.generateTagStatus()
+ if err != nil {
+ fmt.Println(err)
+ }
+ res.Acceptance = q.AcRate
+ res.Difficulty = question.Difficulty
+ mdrows = append(mdrows, res)
+ }
+ return mdrows
+}
+
+// TagList define
+type TagList struct {
+ FrontendQuestionID int32 `json:"question_id"`
+ QuestionTitle string `json:"question__title"`
+ SolutionPath string `json:"solution_path"`
+ Acceptance string `json:"acceptance"`
+ Difficulty string `json:"difficulty"`
+ TimeComplexity string `json:"time_complexity"`
+ SpaceComplexity string `json:"space_complexity"`
+ Favorite string `json:"favorite"`
+}
+
+// | 0001 | Two Sum | [Go]({{< relref "/ChapterFour/0001.Two-Sum.md" >}})| Easy | O(n)| O(n)|❤️|50%|
+func (t TagList) tableLine() string {
+ return fmt.Sprintf("|%04d|%v|%v|%v|%v|%v|%v|%v|\n", t.FrontendQuestionID, t.QuestionTitle, t.SolutionPath, t.Difficulty, t.TimeComplexity, t.SpaceComplexity, t.Favorite, t.Acceptance)
+}
+
+func standardizedTitle(orig string, frontendQuestionID int32) string {
+ s0 := strings.TrimSpace(orig)
+ s1 := strings.Replace(s0, " ", "-", -1)
+ s2 := strings.Replace(s1, "'", "", -1)
+ s3 := strings.Replace(s2, "%", "", -1)
+ s4 := strings.Replace(s3, "(", "", -1)
+ s5 := strings.Replace(s4, ")", "", -1)
+ s6 := strings.Replace(s5, ",", "", -1)
+ s7 := strings.Replace(s6, "?", "", -1)
+ count := 0
+ // 去掉 --- 这种情况,这种情况是由于题目标题中包含 - ,左右有空格,左右一填充,造成了 ---,3 个 -
+ for i := 0; i < len(s7)-2; i++ {
+ if s7[i] == '-' && s7[i+1] == '-' && s7[i+2] == '-' {
+ fmt.Printf("【需要修正 --- 的标题是 %v】\n", fmt.Sprintf("%04d.%v", int(frontendQuestionID), s7))
+ s7 = s7[:i+1] + s7[i+3:]
+ count++
+ }
+ }
+ if count > 0 {
+ fmt.Printf("总共修正了 %v 个标题\n", count)
+ }
+ // 去掉 -- 这种情况,这种情况是由于题目标题中包含负号 -
+ for i := 0; i < len(s7)-2; i++ {
+ if s7[i] == '-' && s7[i+1] == '-' {
+ fmt.Printf("【需要修正 -- 的标题是 %v】\n", fmt.Sprintf("%04d.%v", int(frontendQuestionID), s7))
+ s7 = s7[:i+1] + s7[i+2:]
+ count++
+ }
+ }
+ if count > 0 {
+ fmt.Printf("总共修正了 %v 个标题\n", count)
+ }
+ return s7
+}
+
+// GenerateTagMdRows define
+func GenerateTagMdRows(solutionIds []int, metaMap map[int]TagList, mdrows []Mdrow, internal bool) []TagList {
+ tl := []TagList{}
+ for _, row := range mdrows {
+ if util.BinarySearch(solutionIds, int(row.FrontendQuestionID)) != -1 {
+ tmp := TagList{}
+ tmp.FrontendQuestionID = row.FrontendQuestionID
+ tmp.QuestionTitle = strings.TrimSpace(row.QuestionTitle)
+ s7 := standardizedTitle(row.QuestionTitle, row.FrontendQuestionID)
+ if internal {
+ tmp.SolutionPath = fmt.Sprintf("[Go]({{< relref \"/ChapterFour/%v/%v.md\" >}})", util.GetChpaterFourFileNum(int(row.FrontendQuestionID)), fmt.Sprintf("%04d.%v", int(row.FrontendQuestionID), s7))
+ } else {
+ tmp.SolutionPath = fmt.Sprintf("[Go](https://books.halfrost.com/leetcode/ChapterFour/%v/%v)", util.GetChpaterFourFileNum(int(row.FrontendQuestionID)), fmt.Sprintf("%04d.%v", int(row.FrontendQuestionID), s7))
+ }
+ tmp.Acceptance = row.Acceptance
+ tmp.Difficulty = row.Difficulty
+ tmp.TimeComplexity = metaMap[int(row.FrontendQuestionID)].TimeComplexity
+ tmp.SpaceComplexity = metaMap[int(row.FrontendQuestionID)].SpaceComplexity
+ tmp.Favorite = metaMap[int(row.FrontendQuestionID)].Favorite
+ tl = append(tl, tmp)
+ }
+ }
+ return tl
+}
+
+// TagLists define
+type TagLists struct {
+ TagLists []TagList
+}
+
+// | No. | Title | Solution | Difficulty | TimeComplexity | SpaceComplexity |Favorite| Acceptance |
+// |:--------:|:------- | :--------: | :----------: | :----: | :-----: | :-----: |:-----: |
+func (tls TagLists) table() string {
+ res := "| No. | Title | Solution | Difficulty | TimeComplexity | SpaceComplexity |Favorite| Acceptance |\n"
+ res += "|:--------:|:------- | :--------: | :----------: | :----: | :-----: | :-----: |:-----: |\n"
+ for _, p := range tls.TagLists {
+ res += p.tableLine()
+ }
+ // 加这一行是为了撑开整个表格
+ res += "|------------|-------------------------------------------------------|-------| ----------------| ---------------|-------------|-------------|-------------|"
+ return res
+}
+
+// AvailableTagTable define
+func (tls TagLists) AvailableTagTable() string {
+ return tls.table()
+}
+
+// FavoritesLists define
+type FavoritesLists struct {
+ PublicFavorites []int `json:"publicFavorites"`
+ PrivateFavorites []struct {
+ IDHash string `json:"idHash"`
+ ID string `json:"id"`
+ Name string `json:"name"`
+ IsPublicFavorite bool `json:"isPublicFavorite"`
+ ViewCount int `json:"viewCount"`
+ Creator string `json:"creator"`
+ IsWatched bool `json:"isWatched"`
+ Questions []struct {
+ QuestionID string `json:"questionId"`
+ Title string `json:"title"`
+ TitleSlug string `json:"titleSlug"`
+ Typename string `json:"__typename"`
+ } `json:"questions"`
+ Typename string `json:"__typename"`
+ } `json:"privateFavorites"`
+ Typename string `json:"__typename"`
+}
+
+// Gproblem define
+type Gproblem struct {
+ QuestionID string `json:"questionId"`
+ QuestionFrontendID string `json:"questionFrontendId"`
+ BoundTopicID int `json:"boundTopicId"`
+ Title string `json:"title"`
+ TitleSlug string `json:"titleSlug"`
+ Content string `json:"content"`
+ TranslatedTitle string `json:"translatedTitle"`
+ TranslatedContent string `json:"translatedContent"`
+ IsPaidOnly bool `json:"isPaidOnly"`
+ Difficulty string `json:"difficulty"`
+ Likes int `json:"likes"`
+ Dislikes int `json:"dislikes"`
+ IsLiked interface{} `json:"isLiked"`
+ SimilarQuestions string `json:"similarQuestions"`
+ Contributors []interface{} `json:"contributors"`
+ LangToValidPlayground string `json:"langToValidPlayground"`
+ TopicTags []struct {
+ Name string `json:"name"`
+ Slug string `json:"slug"`
+ TranslatedName string `json:"translatedName"`
+ Typename string `json:"__typename"`
+ } `json:"topicTags"`
+ CompanyTagStats interface{} `json:"companyTagStats"`
+ CodeSnippets []GcodeSnippet `json:"codeSnippets"`
+ Stats string `json:"stats"`
+ Hints []interface{} `json:"hints"`
+ Solution interface{} `json:"solution"`
+ Status interface{} `json:"status"`
+ SampleTestCase string `json:"sampleTestCase"`
+ MetaData string `json:"metaData"`
+ JudgerAvailable bool `json:"judgerAvailable"`
+ JudgeType string `json:"judgeType"`
+ MysqlSchemas []interface{} `json:"mysqlSchemas"`
+ EnableRunCode bool `json:"enableRunCode"`
+ EnableTestMode bool `json:"enableTestMode"`
+ EnvInfo string `json:"envInfo"`
+ Typename string `json:"__typename"`
+}
+
+// Gstat define
+type Gstat struct {
+ TotalAcs int `json:"total_acs"`
+ QuestionTitle string `json:"question__title"`
+ IsNewQuestion bool `json:"is_new_question"`
+ QuestionArticleSlug string `json:"question__article__slug"`
+ TotalSubmitted int `json:"total_submitted"`
+ FrontendQuestionID int `json:"frontend_question_id"`
+ QuestionTitleSlug string `json:"question__title_slug"`
+ QuestionArticleLive bool `json:"question__article__live"`
+ QuestionHide bool `json:"question__hide"`
+ QuestionID int `json:"question_id"`
+}
+
+// GcodeSnippet define
+type GcodeSnippet struct {
+ Lang string `json:"lang"`
+ LangSlug string `json:"langSlug"`
+ Code string `json:"code"`
+ Typename string `json:"__typename"`
+}
diff --git a/ctl/models/user.go b/ctl/models/user.go
new file mode 100644
index 000000000..d79dc6d5f
--- /dev/null
+++ b/ctl/models/user.go
@@ -0,0 +1,44 @@
+package models
+
+import (
+ "fmt"
+)
+
+// UserInfo define
+type UserInfo struct {
+ UserName string `json:"user_name"`
+ NumSolved int32 `json:"num_solved"`
+ NumTotal int32 `json:"num_total"`
+ AcEasy int32 `json:"ac_easy"`
+ AcMedium int32 `json:"ac_medium"`
+ AcHard int32 `json:"ac_hard"`
+ EasyTotal int32
+ MediumTotal int32
+ HardTotal int32
+ OptimizingEasy int32
+ OptimizingMedium int32
+ OptimizingHard int32
+ FrequencyHigh float64 `json:"frequency_high"`
+ FrequencyMid float64 `json:"frequency_mid"`
+ CategorySlug string `json:"category_slug"`
+}
+
+// | | Easy | Medium | Hard | Total | optimizing |
+// |:--------:|:--------------------------------------------------------------|:--------:|:--------:|:--------:|:--------:|
+func (ui UserInfo) table() string {
+ res := "| | Easy | Medium | Hard | Total |\n"
+ res += "|:--------:|:--------:|:--------:|:--------:|:--------:|\n"
+ res += fmt.Sprintf("|Optimizing|%v|%v|%v|%v|\n", ui.OptimizingEasy, ui.OptimizingMedium, ui.OptimizingHard, ui.OptimizingEasy+ui.OptimizingMedium+ui.OptimizingHard)
+ res += fmt.Sprintf("|Accepted|**%v**|**%v**|**%v**|**%v**|\n", ui.AcEasy, ui.AcMedium, ui.AcHard, ui.AcEasy+ui.AcMedium+ui.AcHard)
+ res += fmt.Sprintf("|Total|%v|%v|%v|%v|\n", ui.EasyTotal, ui.MediumTotal, ui.HardTotal, ui.EasyTotal+ui.MediumTotal+ui.HardTotal)
+ res += fmt.Sprintf("|Perfection Rate|%.1f%%|%.1f%%|%.1f%%|%.1f%%|\n", (1-float64(ui.OptimizingEasy)/float64(ui.AcEasy))*100, (1-float64(ui.OptimizingMedium)/float64(ui.AcMedium))*100, (1-float64(ui.OptimizingHard)/float64(ui.AcHard))*100, (1-float64(ui.OptimizingEasy+ui.OptimizingMedium+ui.OptimizingHard)/float64(ui.AcEasy+ui.AcMedium+ui.AcHard))*100)
+ res += fmt.Sprintf("|Completion Rate|%.1f%%|%.1f%%|%.1f%%|%.1f%%|\n", float64(ui.AcEasy)/float64(ui.EasyTotal)*100, float64(ui.AcMedium)/float64(ui.MediumTotal)*100, float64(ui.AcHard)/float64(ui.HardTotal)*100, float64(ui.AcEasy+ui.AcMedium+ui.AcHard)/float64(ui.EasyTotal+ui.MediumTotal+ui.HardTotal)*100)
+ // 加这一行是为了撑开整个表格
+ res += "|------------|----------------------------|----------------------------|----------------------------|----------------------------|"
+ return res
+}
+
+// PersonalData define
+func (ui UserInfo) PersonalData() string {
+ return ui.table()
+}
diff --git a/ctl/pdf.go b/ctl/pdf.go
new file mode 100644
index 000000000..d481df4c5
--- /dev/null
+++ b/ctl/pdf.go
@@ -0,0 +1,224 @@
+package main
+
+import (
+ "bufio"
+ "fmt"
+ "io"
+ "io/ioutil"
+ "os"
+ "regexp"
+ "strconv"
+ "strings"
+
+ "github.com/halfrost/LeetCode-Go/ctl/util"
+ "github.com/spf13/cobra"
+)
+
+var (
+ cleanString1 = "{{< columns >}}"
+ cleanString2 = "<--->"
+ cleanString3 = "{{< /columns >}}"
+ cleanString4 = "
"
+ pdfPreface = `
+
+
+# 说明
+
+此版本是 https://books.halfrost.com/leetcode 网页的离线版,由于网页版实时会更新,所以此 PDF 版难免会有一些排版或者错别字。如果读者遇到了,可以到网页版相应页面,点击页面 edit 按钮,提交 pr 进行更改。此 PDF 版本号是 V%v.%v.%v。PDF 永久更新地址是 https://github.com/halfrost/leetcode-go/releases/,以版本号区分不同版本。笔者还是强烈推荐看在线版,有任何错误都会立即更新。如果觉得此书对刷题有一点点帮助,可以给此书点一个 star,鼓励一下笔者早点更新更多题解。
+
+> 版本号说明,V%v.%v.%v,%v 是大版本号,%v 代表当前题解中有几百题,目前是 %v 题,所以第二个版本号是 %v,%v 代表当前题解中有几十题,目前是 %v 题,所以第三个版本号是 %v 。
+
+# 目录
+
+[toc]
+
+`
+
+ majorVersion = 1
+ midVersion = 0
+ lastVersion = 0
+ totalSolutions = 0
+)
+
+func newPDFCommand() *cobra.Command {
+ cmd := &cobra.Command{
+ Use: "pdf",
+ Short: "PDF related commands",
+ Run: func(cmd *cobra.Command, args []string) {
+ generatePDF()
+ },
+ }
+ // cmd.Flags().StringVar(&alias, "alias", "", "alias")
+ // cmd.Flags().StringVar(&appId, "appid", "", "appid")
+ return cmd
+}
+
+func generatePDF() {
+ var (
+ pdf, tmp []byte
+ err error
+ )
+ // 先删除 pre-next
+ delPreNext()
+
+ chapterFourFileOrder, _ := util.LoadChapterFourDir()
+ totalSolutions = len(chapterFourFileOrder)
+ midVersion = totalSolutions / 100
+ lastVersion = totalSolutions % 100
+ fmt.Printf("[当前的版本号是 V%v.%v.%v]\n", majorVersion, midVersion, lastVersion)
+ // 删除原始文档中的头部,并创建临时文件夹
+ prepare(fmt.Sprintf("../PDF v%v.%v.%v.md", majorVersion, midVersion, lastVersion))
+ // PDF 前言
+ pdf = append(pdf, []byte(fmt.Sprintf(pdfPreface, majorVersion, midVersion, lastVersion, majorVersion, midVersion, lastVersion, majorVersion, midVersion, totalSolutions, midVersion, lastVersion, totalSolutions, lastVersion))...)
+ // PDF 第一章
+ tmp, err = loadChapter(chapterOneFileOrder, "./pdftemp", "ChapterOne")
+ pdf = append(pdf, tmp...)
+ // PDF 第二章
+ tmp, err = loadChapter(chapterTwoFileOrder, "./pdftemp", "ChapterTwo")
+ pdf = append(pdf, tmp...)
+ // PDF 第三章
+ tmp, err = loadChapter(chapterThreeFileOrder, "./pdftemp", "ChapterThree")
+ pdf = append(pdf, tmp...)
+ // PDF 第四章
+ tmp, err = util.LoadFile("./pdftemp/ChapterFour/_index.md")
+ pdf = append(pdf, tmp...)
+ tmp, err = loadChapter(chapterFourFileOrder, "../website/content", "ChapterFour")
+ pdf = append(pdf, tmp...)
+ if err != nil {
+ fmt.Println(err)
+ }
+ // 生成 PDF
+ util.WriteFile(fmt.Sprintf("../PDF v%v.%v.%v.md", majorVersion, midVersion, lastVersion), pdf)
+ // 还原现场
+ addPreNext()
+ util.DestoryDir("./pdftemp")
+}
+
+func loadChapter(order []string, path, chapter string) ([]byte, error) {
+ var (
+ res, tmp []byte
+ err error
+ )
+ for index, v := range order {
+ if chapter == "ChapterOne" && index == 0 {
+ // 清理不支持的特殊 MarkDown 语法
+ tmp, err = clean(fmt.Sprintf("%v/%v/%v.md", path, chapter, v))
+ } else {
+ if chapter == "ChapterFour" {
+ if v[4] == '.' {
+ num, err := strconv.Atoi(v[:4])
+ if err != nil {
+ fmt.Println(err)
+ }
+ tmp, err = util.LoadFile(fmt.Sprintf("%v/%v/%v/%v.md", path, chapter, util.GetChpaterFourFileNum(num), v))
+ }
+ } else {
+ tmp, err = util.LoadFile(fmt.Sprintf("%v/%v/%v.md", path, chapter, v))
+ }
+ }
+ if err != nil {
+ fmt.Println(err)
+ return []byte{}, err
+ }
+ res = append(res, tmp...)
+ }
+ return res, err
+}
+
+func prepare(path string) {
+ err := os.Remove(path)
+ if err != nil {
+ fmt.Println("pdf 还没有创建")
+ fmt.Println(err)
+ }
+ fmt.Println("pdf 删除成功,开始构建全新版本")
+
+ err = os.MkdirAll("./pdftemp/ChapterOne", os.ModePerm)
+ if err != nil {
+ fmt.Println(err)
+ }
+ for _, v := range chapterOneFileOrder {
+ removeHeader(fmt.Sprintf("../website/content/ChapterOne/%v.md", v), fmt.Sprintf("./pdftemp/ChapterOne/%v.md", v), 5)
+ }
+
+ err = os.MkdirAll("./pdftemp/ChapterTwo", os.ModePerm)
+ if err != nil {
+ fmt.Println(err)
+ }
+ // 生成外部链接的 ChapterTwo
+ buildChapterTwo(false)
+ util.CopyFile("./pdftemp/ChapterTwo/_index.md", "../website/content/ChapterTwo/_index.md")
+
+ for _, v := range chapterTwoFileOrder {
+ removeHeader(fmt.Sprintf("./pdftemp/ChapterTwo/%v.md", v), fmt.Sprintf("./pdftemp/ChapterTwo/%v.md", v), 5)
+ }
+
+ err = os.MkdirAll("./pdftemp/ChapterThree", os.ModePerm)
+ if err != nil {
+ fmt.Println(err)
+ }
+ for _, v := range chapterThreeFileOrder {
+ removeHeader(fmt.Sprintf("../website/content/ChapterThree/%v.md", v), fmt.Sprintf("./pdftemp/ChapterThree/%v.md", v), 5)
+ }
+
+ err = os.MkdirAll("./pdftemp/ChapterFour", os.ModePerm)
+ if err != nil {
+ fmt.Println(err)
+ }
+ removeHeader(fmt.Sprintf("../website/content/ChapterFour/_index.md"), fmt.Sprintf("./pdftemp/ChapterFour/_index.md"), 5)
+}
+
+func clean(filePath string) ([]byte, error) {
+ f, err := os.OpenFile(filePath, os.O_RDONLY, 0644)
+ if err != nil {
+ return nil, err
+ }
+ defer f.Close()
+ reader, output := bufio.NewReader(f), []byte{}
+ for {
+ line, _, err := reader.ReadLine()
+ if err != nil {
+ if err == io.EOF {
+ return output, nil
+ }
+ return nil, err
+ }
+ if ok, _ := regexp.Match(cleanString1, line); ok {
+ reg := regexp.MustCompile(cleanString1)
+ newByte := reg.ReplaceAll(line, []byte(""))
+ output = append(output, newByte...)
+ output = append(output, []byte("\n")...)
+ } else if ok, _ := regexp.Match(cleanString2, line); ok {
+ reg := regexp.MustCompile(cleanString2)
+ newByte := reg.ReplaceAll(line, []byte(""))
+ output = append(output, newByte...)
+ output = append(output, []byte("\n")...)
+ } else if ok, _ := regexp.Match(cleanString3, line); ok {
+ reg := regexp.MustCompile(cleanString3)
+ newByte := reg.ReplaceAll(line, []byte(""))
+ output = append(output, newByte...)
+ output = append(output, []byte("\n")...)
+ } else if ok, _ := regexp.Match(cleanString4, line); ok {
+ reg := regexp.MustCompile(cleanString4)
+ newByte := reg.ReplaceAll(line, []byte(""))
+ output = append(output, newByte...)
+ output = append(output, []byte("\n")...)
+ } else {
+ output = append(output, line...)
+ output = append(output, []byte("\n")...)
+ }
+ }
+}
+
+func removeHeader(path, newPath string, lineNumber int) {
+ file, err := ioutil.ReadFile(path)
+ if err != nil {
+ panic(err)
+ }
+ info, _ := os.Stat(path)
+ mode := info.Mode()
+ array := strings.Split(string(file), "\n")
+ array = array[lineNumber:]
+ ioutil.WriteFile(newPath, []byte(strings.Join(array, "\n")), mode)
+ //fmt.Println("remove line successful")
+}
diff --git a/ctl/rangking.go b/ctl/rangking.go
new file mode 100644
index 000000000..3e8196913
--- /dev/null
+++ b/ctl/rangking.go
@@ -0,0 +1,36 @@
+package main
+
+import (
+ "fmt"
+ "strconv"
+ "strings"
+)
+
+// getRanking 让这个方法优雅一点
+func getRanking() int {
+ // 获取网页数据
+ URL := fmt.Sprintf("https://leetcode.com/%s/", getConfig().Username)
+ data := getRaw(URL)
+ str := string(data)
+ // 通过不断裁剪 str 获取排名信息
+ fmt.Println(str)
+ i := strings.Index(str, "ng-init")
+ j := i + strings.Index(str[i:], "ng-cloak")
+ str = str[i:j]
+ i = strings.Index(str, "(")
+ j = strings.Index(str, ")")
+ str = str[i:j]
+ // fmt.Println("2\n", str)
+ strs := strings.Split(str, ",")
+ str = strs[6]
+ // fmt.Println("1\n", str)
+ i = strings.Index(str, "'")
+ j = 2 + strings.Index(str[2:], "'")
+ // fmt.Println("0\n", str)
+ str = str[i+1 : j]
+ r, err := strconv.Atoi(str)
+ if err != nil {
+ fmt.Printf("无法把 %s 转换成数字Ranking", str)
+ }
+ return r
+}
diff --git a/ctl/refresh.go b/ctl/refresh.go
new file mode 100644
index 000000000..501031a6a
--- /dev/null
+++ b/ctl/refresh.go
@@ -0,0 +1,27 @@
+package main
+
+import (
+ "github.com/spf13/cobra"
+)
+
+func newRefresh() *cobra.Command {
+ cmd := &cobra.Command{
+ Use: "refresh",
+ Short: "Refresh all document",
+ Run: func(cmd *cobra.Command, args []string) {
+ refresh()
+ },
+ }
+ // cmd.Flags().StringVar(&alias, "alias", "", "alias")
+ // cmd.Flags().StringVar(&appId, "appid", "", "appid")
+ return cmd
+}
+
+func refresh() {
+ //buildBookMenu()
+ copyLackFile()
+ delPreNext()
+ buildREADME()
+ buildChapterTwo(true)
+ addPreNext()
+}
diff --git a/ctl/render.go b/ctl/render.go
new file mode 100644
index 000000000..3e62a36eb
--- /dev/null
+++ b/ctl/render.go
@@ -0,0 +1,367 @@
+package main
+
+import (
+ "bufio"
+ "encoding/json"
+ "fmt"
+ "io"
+ "os"
+ "regexp"
+ "sort"
+ "strconv"
+ "strings"
+
+ m "github.com/halfrost/LeetCode-Go/ctl/models"
+ "github.com/halfrost/LeetCode-Go/ctl/util"
+ "github.com/spf13/cobra"
+)
+
+var (
+ chapterTwoList = []string{"Array", "String", "Two Pointers", "Linked List", "Stack", "Tree", "Dynamic Programming", "Backtracking", "Depth First Search", "Breadth First Search",
+ "Binary Search", "Math", "Hash Table", "Sorting", "Bit Manipulation", "Union Find", "Sliding Window", "Segment Tree", "Binary Indexed Tree"}
+ chapterTwoFileName = []string{"Array", "String", "Two_Pointers", "Linked_List", "Stack", "Tree", "Dynamic_Programming", "Backtracking", "Depth_First_Search", "Breadth_First_Search",
+ "Binary_Search", "Math", "Hash_Table", "Sorting", "Bit_Manipulation", "Union_Find", "Sliding_Window", "Segment_Tree", "Binary_Indexed_Tree"}
+ chapterTwoSlug = []string{"array", "string", "two-pointers", "linked-list", "stack", "tree", "dynamic-programming", "backtracking", "depth-first-search", "breadth-first-search",
+ "binary-search", "math", "hash-table", "sorting", "bit-manipulation", "union-find", "sliding-window", "segment-tree", "binary-indexed-tree"}
+)
+
+func newBuildCommand() *cobra.Command {
+ mc := &cobra.Command{
+ Use: "build
+
+{{.BookMenu}}
+
+
diff --git a/ctl/template/template.markdown b/ctl/template/template.markdown
new file mode 100644
index 000000000..c0b24343e
--- /dev/null
+++ b/ctl/template/template.markdown
@@ -0,0 +1,645 @@
+
+# LeetCode in Go
+[LeetCode Online Judge](https://leetcode.com/) is a website containing many **algorithm questions**. Most of them are real interview questions of **Google, Facebook, LinkedIn, Apple**, etc. and it always help to sharp our algorithm Skills. Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview. This repo shows my solutions in Go with the code style strictly follows the [Google Golang Style Guide](https://github.com/golang/go/wiki/CodeReviewComments). Please feel free to reference and **STAR** to support this repo, thank you!
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+* [Array](#array)
+* [String](#string)
+* [✅ Two Pointers](#two-pointers)
+* [✅ Linked List](#linked-list)
+* [✅ Stack](#stack)
+* [Tree](#tree)
+* [Dynamic programming](#dynamic-programming)
+* [✅ Backtracking](#backtracking)
+* [Depth First Search](#depth-first-search)
+* [Breadth First Search](#breadth-first-search)
+* [Binary Search](#binary-search)
+* [Math](#math)
+* [Hash Table](#hash-table)
+* [✅ Sort](#sort)
+* [✅ Bit Manipulation](#bit-manipulation)
+* [✅ Union Find](#union-find)
+* [✅ Sliding Window](#sliding-window)
+* [✅ Segment Tree](#segment-tree)
+* [✅ Binary Indexed Tree](#binary-indexed-tree)
+
+
+
+
+| 数据结构 | 变种 | 相关题目 | 讲解文章 |
+|:-------:|:-------|:------|:------|
+|顺序线性表:向量||||
+|单链表|1. 双向链表
2. 静态链表
3. 对称矩阵
4. 稀疏矩阵|||
+|哈希表|1. 散列函数
2. 解决碰撞/填充因子
|||
+|栈和队列|1. 广义栈
2. 双端队列
|||
+|队列|1. 链表实现
2. 循环数组实现
3. 双端队列|||
+|字符串|1. KMP算法
2. 有限状态自动机
3. 模式匹配有限状态自动机
4. BM 模式匹配算法
5. BM-KMP 算法
6. BF 算法|||
+|树|1. 二叉树
2. 并查集
3. Huffman 树|||
+|数组实现的堆|1. 极大堆和极小堆
2. 极大极小堆
3. 双端堆
4. d 叉堆|||
+|树实现的堆|1. 左堆
2. 扁堆
3. 二项式堆
4. 斐波那契堆
5. 配对堆|||
+|查找|1. 哈希表
2. 跳跃表
3. 排序二叉树
4. AVL 树
5. B 树 / B+ 树 / B* 树
6. AA 树
7. 红黑树
8. 排序二叉堆
9. Splay 树
10. 双链树
11. Trie 树
12. R 树|||
+|--------------------------------------------|--------------------------------------------------------------------------------------------|---------------------------|-----------------------------------|
+
+
+## Algorithm
+
+
+| 算法 | 具体类型 | 相关题目 | 讲解文章 |
+|:-------:|:-------|:------|:------|
+|排序算法|1. 冒泡排序
2. 插入排序
3. 选择排序
4. 希尔 Shell 排序
5. 快速排序
6. 归并排序
7. 堆排序
8. 线性排序算法
9. 自省排序
10. 间接排序
11. 计数排序
12. 基数排序
13. 桶排序
14. 外部排序 - k 路归并败者树
15. 外部排序 - 最佳归并树|||
+|递归与分治||1. 二分搜索/查找
2. 大整数的乘法
3. Strassen 矩阵乘法
4. 棋盘覆盖
5. 合并排序
6. 快速排序
7. 线性时间选择
8. 最接近点对问题
9. 循环赛日程表
||
+|动态规划||1. 矩阵连乘问题
2. 最长公共子序列
3. 最大子段和
4. 凸多边形最优三角剖分
5. 多边形游戏
6. 图像压缩
7. 电路布线
8. 流水作业调度
9. 0-1 背包问题/背包九讲
10. 最优二叉搜索树
11. 动态规划加速原理
12. 树型 DP
||
+|贪心||1. 活动安排问题
2. 最优装载
3. 哈夫曼编码
4. 单源最短路径
5. 最小生成树
6. 多机调度问题
||
+|回溯法||1. 装载问题
2. 批处理作业调度
3. 符号三角形问题
4. n 后问题
5. 0-1 背包问题
6. 最大团问题
7. 图的 m 着色问题
8. 旅行售货员问题
9. 圆排列问题
10. 电路板排列问题
11. 连续邮资问题
||
+|搜索|1. 枚举
2. DFS
3. BFS
4. 启发式搜索
|||
+|随机化|1. 随机数
2. 数值随机化算法
3. Sherwood 舍伍德算法
4. Las Vegas 拉斯维加斯算法
5. Monte Carlo 蒙特卡罗算法
|1. 计算 π 值
2. 计算定积分
3. 解非线性方程组
4. 线性时间选择算法
5. 跳跃表
6. n 后问题
7. 整数因子分解
8. 主元素问题
9. 素数测试
||
+|图论|1. 遍历 DFS / BFS
2. AOV / AOE 网络
3. Kruskal 算法(最小生成树)
4. Prim 算法(最小生成树)
5. Boruvka 算法(最小生成树)
6. Dijkstra 算法(单源最短路径)
7. Bellman-Ford 算法(单源最短路径)
8. SPFA 算法(单源最短路径)
9. Floyd 算法(多源最短路径)
10. Johnson 算法(多源最短路径)
11. Fleury 算法(欧拉回路)
12. Ford-Fulkerson 算法(最大网络流增广路)
13. Edmonds-Karp 算法(最大网络流)
14. Dinic 算法(最大网络流)
15. 一般预流推进算法
16. 最高标号预流推进 HLPP 算法
17. Primal-Dual 原始对偶算法(最小费用流)18. Kosaraju 算法(有向图强连通分量)
19. Tarjan 算法(有向图强连通分量)
20. Gabow 算法(有向图强连通分量)
21. 匈牙利算法(二分图匹配)
22. Hopcroft-Karp 算法(二分图匹配)
23. kuhn munkras 算法(二分图最佳匹配)
24. Edmonds’ Blossom-Contraction 算法(一般图匹配)
|1. 图遍历
2. 有向图和无向图的强弱连通性
3. 割点/割边
3. AOV 网络和拓扑排序
4. AOE 网络和关键路径
5. 最小代价生成树/次小生成树
6. 最短路径问题/第 K 短路问题
7. 最大网络流问题
8. 最小费用流问题
9. 图着色问题
10. 差分约束系统
11. 欧拉回路
12. 中国邮递员问题
13. 汉密尔顿回路
14. 最佳边割集/最佳点割集/最小边割集/最小点割集/最小路径覆盖/最小点集覆盖
15. 边覆盖集
16. 二分图完美匹配和最大匹配问题
17. 仙人掌图
18. 弦图
19. 稳定婚姻问题
20. 最大团问题
||
+|数论||1. 最大公约数
2. 最小公倍数
3. 分解质因数
4. 素数判定
5. 进制转换
6. 高精度计算
7. 整除问题
8. 同余问题
9. 欧拉函数
10. 扩展欧几里得
11. 置换群
12. 母函数
13. 离散变换
14. 康托展开
15. 矩阵
16. 向量
17. 线性方程组
18. 线性规划
||
+|几何||1. 凸包 - Gift wrapping
2. 凸包 - Graham scan
3. 线段问题
4. 多边形和多面体相关问题
||
+|NP 完全|1. 计算模型
2. P 类与 NP 类问题
3. NP 完全问题
4. NP 完全问题的近似算法
|1. 随机存取机 RAM
2. 随机存取存储程序机 RASP
3. 图灵机
4. 非确定性图灵机
5. P 类与 NP 类语言
6. 多项式时间验证
7. 多项式时间变换
8. Cook定理
9. 合取范式的可满足性问题 CNF-SAT
10. 3 元合取范式的可满足性问题 3-SAT
11. 团问题 CLIQUE
12. 顶点覆盖问题 VERTEX-COVER
13. 子集和问题 SUBSET-SUM
14. 哈密顿回路问题 HAM-CYCLE
15. 旅行售货员问题 TSP
16. 顶点覆盖问题的近似算法
17. 旅行售货员问题近似算法
18. 具有三角不等式性质的旅行售货员问题
19. 一般的旅行售货员问题
20. 集合覆盖问题的近似算法
21. 子集和问题的近似算法
22. 子集和问题的指数时间算法
23. 子集和问题的多项式时间近似格式
||
+|------------|------------------------------------------------------------------|-----------------------------------------------------------------|--------------------|
+
+
+## LeetCode Problems
+
+## 一. 个人数据
+
+{{.PersonalData}}
+
+## 二. 目录
+
+{{.TotalNum}}
+
+{{.AvailableTable}}
+
+------------------------------------------------------------------
+
+下面这些是免费的算法题,但是暂时还不能使用 Go 解答的:
+
+暂无
+
+------------------------------------------------------------------
+
+
+## 三.分类
+
+## Array
+
+
+Problems List in [there](https://books.halfrost.com/leetcode/ChapterTwo/Array/)
+
+
+
+## String
+
+Problems List in [there](https://books.halfrost.com/leetcode/ChapterTwo/String/)
+
+
+## Two Pointers
+
+
+
+- 双指针滑动窗口的经典写法。右指针不断往右移,移动到不能往右移动为止(具体条件根据题目而定)。当右指针到最右边以后,开始挪动左指针,释放窗口左边界。第 3 题,第 76 题,第 209 题,第 424 题,第 438 题,第 567 题,第 713 题,第 763 题,第 845 题,第 881 题,第 904 题,第 978 题,第 992 题,第 1004 题,第 1040 题,第 1052 题。
+
+```c
+ left, right := 0, -1
+
+ for left < len(s) {
+ if right+1 < len(s) && freq[s[right+1]-'a'] == 0 {
+ freq[s[right+1]-'a']++
+ right++
+ } else {
+ freq[s[left]-'a']--
+ left++
+ }
+ result = max(result, right-left+1)
+ }
+```
+
+- 快慢指针可以查找重复数字,时间复杂度 O(n),第 287 题。
+- 替换字母以后,相同字母能出现连续最长的长度。第 424 题。
+- SUM 问题集。第 1 题,第 15 题,第 16 题,第 18 题,第 167 题,第 923 题,第 1074 题。
+
+
+Problems List in [there](https://books.halfrost.com/leetcode/ChapterTwo/Two_Pointers/)
+
+
+## Linked List
+
+
+
+
+- 巧妙的构造虚拟头结点。可以使遍历处理逻辑更加统一。
+- 灵活使用递归。构造递归条件,使用递归可以巧妙的解题。不过需要注意有些题目不能使用递归,因为递归深度太深会导致超时和栈溢出。
+- 链表区间逆序。第 92 题。
+- 链表寻找中间节点。第 876 题。链表寻找倒数第 n 个节点。第 19 题。只需要一次遍历就可以得到答案。
+- 合并 K 个有序链表。第 21 题,第 23 题。
+- 链表归类。第 86 题,第 328 题。
+- 链表排序,时间复杂度要求 O(n * log n),空间复杂度 O(1)。只有一种做法,归并排序,至顶向下归并。第 148 题。
+- 判断链表是否存在环,如果有环,输出环的交叉点的下标;判断 2 个链表是否有交叉点,如果有交叉点,输出交叉点。第 141 题,第 142 题,第 160 题。
+
+
+Problems List in [there](https://books.halfrost.com/leetcode/ChapterTwo/Linked_List/)
+
+
+
+
+## Stack
+
+
+
+- 括号匹配问题及类似问题。第 20 题,第 921 题,第 1021 题。
+- 栈的基本 pop 和 push 操作。第 71 题,第 150 题,第 155 题,第 224 题,第 225 题,第 232 题,第 946 题,第 1047 题。
+- 利用栈进行编码问题。第 394 题,第 682 题,第 856 题,第 880 题。
+- **单调栈**。**利用栈维护一个单调递增或者递减的下标数组**。第 84 题,第 456 题,第 496 题,第 503 题,第 739 题,第 901 题,第 907 题,第 1019 题。
+
+Problems List in [there](https://books.halfrost.com/leetcode/ChapterTwo/Stack/)
+
+
+
+## Tree
+
+
+Problems List in [there](https://books.halfrost.com/leetcode/ChapterTwo/Tree/)
+
+
+
+
+
+## Dynamic Programming
+
+Problems List in [there](https://books.halfrost.com/leetcode/ChapterTwo/Dynamic_Programming/)
+
+
+
+## Backtracking
+
+
+
+- 排列问题 Permutations。第 46 题,第 47 题。第 60 题,第 526 题,第 996 题。
+- 组合问题 Combination。第 39 题,第 40 题,第 77 题,第 216 题。
+- 排列和组合杂交问题。第 1079 题。
+- N 皇后终极解法(二进制解法)。第 51 题,第 52 题。
+- 数独问题。第 37 题。
+- 四个方向搜索。第 79 题,第 212 题,第 980 题。
+- 子集合问题。第 78 题,第 90 题。
+- Trie。第 208 题,第 211 题。
+- BFS 优化。第 126 题,第 127 题。
+- DFS 模板。(只是一个例子,不对应任何题)
+
+```go
+func combinationSum2(candidates []int, target int) [][]int {
+ if len(candidates) == 0 {
+ return [][]int{}
+ }
+ c, res := []int{}, [][]int{}
+ sort.Ints(candidates)
+ findcombinationSum2(candidates, target, 0, c, &res)
+ return res
+}
+
+func findcombinationSum2(nums []int, target, index int, c []int, res *[][]int) {
+ if target == 0 {
+ b := make([]int, len(c))
+ copy(b, c)
+ *res = append(*res, b)
+ return
+ }
+ for i := index; i < len(nums); i++ {
+ if i > index && nums[i] == nums[i-1] { // 这里是去重的关键逻辑
+ continue
+ }
+ if target >= nums[i] {
+ c = append(c, nums[i])
+ findcombinationSum2(nums, target-nums[i], i+1, c, res)
+ c = c[:len(c)-1]
+ }
+ }
+}
+```
+- BFS 模板。(只是一个例子,不对应任何题)
+
+```go
+func updateMatrix_BFS(matrix [][]int) [][]int {
+ res := make([][]int, len(matrix))
+ if len(matrix) == 0 || len(matrix[0]) == 0 {
+ return res
+ }
+ queue := make([][]int, 0)
+ for i, _ := range matrix {
+ res[i] = make([]int, len(matrix[0]))
+ for j, _ := range res[i] {
+ if matrix[i][j] == 0 {
+ res[i][j] = -1
+ queue = append(queue, []int{i, j})
+ }
+ }
+ }
+ level := 1
+ for len(queue) > 0 {
+ size := len(queue)
+ for size > 0 {
+ size -= 1
+ node := queue[0]
+ queue = queue[1:]
+ i, j := node[0], node[1]
+ for _, direction := range [][]int{{-1, 0}, {1, 0}, {0, 1}, {0, -1}} {
+ x := i + direction[0]
+ y := j + direction[1]
+ if x < 0 || x >= len(matrix) || y < 0 || y >= len(matrix[0]) || res[x][y] < 0 || res[x][y] > 0 {
+ continue
+ }
+ res[x][y] = level
+ queue = append(queue, []int{x, y})
+ }
+ }
+ level++
+ }
+ for i, row := range res {
+ for j, cell := range row {
+ if cell == -1 {
+ res[i][j] = 0
+ }
+ }
+ }
+ return res
+}
+```
+
+
+Problems List in [there](https://books.halfrost.com/leetcode/ChapterTwo/Backtracking/)
+
+
+## Depth First Search
+
+
+Problems List in [there](https://books.halfrost.com/leetcode/ChapterTwo/Depth_First_Search/)
+
+
+
+
+## Breadth First Search
+
+
+
+Problems List in [there](https://books.halfrost.com/leetcode/ChapterTwo/Breadth_First_Search/)
+
+
+
+
+
+## Binary Search
+
+![]()
+
+- 二分搜索的经典写法。需要注意的三点:
+ 1. 循环退出条件,注意是 low <= high,而不是 low < high。
+ 2. mid 的取值,mid := low + (high-low)>>1
+ 3. low 和 high 的更新。low = mid + 1,high = mid - 1。
+
+```go
+func binarySearchMatrix(nums []int, target int) int {
+ low, high := 0, len(nums)-1
+ for low <= high {
+ mid := low + (high-low)>>1
+ if nums[mid] == target {
+ return mid
+ } else if nums[mid] > target {
+ high = mid - 1
+ } else {
+ low = mid + 1
+ }
+ }
+ return -1
+}
+```
+
+- 二分搜索的变种写法。有 4 个基本变种:
+ 1. 查找第一个与 target 相等的元素,时间复杂度 O(logn)
+ 2. 查找最后一个与 target 相等的元素,时间复杂度 O(logn)
+ 3. 查找第一个大于等于 target 的元素,时间复杂度 O(logn)
+ 4. 查找最后一个小于等于 target 的元素,时间复杂度 O(logn)
+
+```go
+// 二分查找第一个与 target 相等的元素,时间复杂度 O(logn)
+func searchFirstEqualElement(nums []int, target int) int {
+ low, high := 0, len(nums)-1
+ for low <= high {
+ mid := low + ((high - low) >> 1)
+ if nums[mid] > target {
+ high = mid - 1
+ } else if nums[mid] < target {
+ low = mid + 1
+ } else {
+ if (mid == 0) || (nums[mid-1] != target) { // 找到第一个与 target 相等的元素
+ return mid
+ }
+ high = mid - 1
+ }
+ }
+ return -1
+}
+
+// 二分查找最后一个与 target 相等的元素,时间复杂度 O(logn)
+func searchLastEqualElement(nums []int, target int) int {
+ low, high := 0, len(nums)-1
+ for low <= high {
+ mid := low + ((high - low) >> 1)
+ if nums[mid] > target {
+ high = mid - 1
+ } else if nums[mid] < target {
+ low = mid + 1
+ } else {
+ if (mid == len(nums)-1) || (nums[mid+1] != target) { // 找到最后一个与 target 相等的元素
+ return mid
+ }
+ low = mid + 1
+ }
+ }
+ return -1
+}
+
+// 二分查找第一个大于等于 target 的元素,时间复杂度 O(logn)
+func searchFirstGreaterElement(nums []int, target int) int {
+ low, high := 0, len(nums)-1
+ for low <= high {
+ mid := low + ((high - low) >> 1)
+ if nums[mid] >= target {
+ if (mid == 0) || (nums[mid-1] < target) { // 找到第一个大于等于 target 的元素
+ return mid
+ }
+ high = mid - 1
+ } else {
+ low = mid + 1
+ }
+ }
+ return -1
+}
+
+// 二分查找最后一个小于等于 target 的元素,时间复杂度 O(logn)
+func searchLastLessElement(nums []int, target int) int {
+ low, high := 0, len(nums)-1
+ for low <= high {
+ mid := low + ((high - low) >> 1)
+ if nums[mid] <= target {
+ if (mid == len(nums)-1) || (nums[mid+1] > target) { // 找到最后一个小于等于 target 的元素
+ return mid
+ }
+ low = mid + 1
+ } else {
+ high = mid - 1
+ }
+ }
+ return -1
+}
+```
+
+- 在基本有序的数组中用二分搜索。经典解法可以解,变种写法也可以写,常见的题型,在山峰数组中找山峰,在旋转有序数组中找分界点。第 33 题,第 81 题,第 153 题,第 154 题,第 162 题,第 852 题
+
+```go
+func peakIndexInMountainArray(A []int) int {
+ low, high := 0, len(A)-1
+ for low < high {
+ mid := low + (high-low)>>1
+ // 如果 mid 较大,则左侧存在峰值,high = m,如果 mid + 1 较大,则右侧存在峰值,low = mid + 1
+ if A[mid] > A[mid+1] {
+ high = mid
+ } else {
+ low = mid + 1
+ }
+ }
+ return low
+}
+```
+
+- max-min 最大值最小化问题。求在最小满足条件的情况下的最大值。第 410 题,第 875 题,第 1011 题,第 1283 题。
+
+Problems List in [there](https://books.halfrost.com/leetcode/ChapterTwo/Binary_Search/)
+
+
+
+## Math
+
+
+Problems List in [there](https://books.halfrost.com/leetcode/ChapterTwo/Math/)
+
+
+
+
+## Hash Table
+
+
+Problems List in [there](https://books.halfrost.com/leetcode/ChapterTwo/Hash_Table/)
+
+
+
+## Sort
+
+
+
+- 深刻的理解多路快排。第 75 题。
+- 链表的排序,插入排序(第 147 题)和归并排序(第 148 题)
+- 桶排序和基数排序。第 164 题。
+- "摆动排序"。第 324 题。
+- 两两不相邻的排序。第 767 题,第 1054 题。
+- "饼子排序"。第 969 题。
+
+Problems List in [there](https://books.halfrost.com/leetcode/ChapterTwo/Sort/)
+
+
+## Bit Manipulation
+
+
+
+- 异或的特性。第 136 题,第 268 题,第 389 题,第 421 题,
+
+```go
+x ^ 0 = x
+x ^ 11111……1111 = ~x
+x ^ (~x) = 11111……1111
+x ^ x = 0
+a ^ b = c => a ^ c = b => b ^ c = a (交换律)
+a ^ b ^ c = a ^ (b ^ c) = (a ^ b)^ c (结合律)
+```
+
+- 构造特殊 Mask,将特殊位置放 0 或 1。
+
+```go
+将 x 最右边的 n 位清零, x & ( ~0 << n )
+获取 x 的第 n 位值(0 或者 1),(x >> n) & 1
+获取 x 的第 n 位的幂值,x & (1 << (n - 1))
+仅将第 n 位置为 1,x | (1 << n)
+仅将第 n 位置为 0,x & (~(1 << n))
+将 x 最高位至第 n 位(含)清零,x & ((1 << n) - 1)
+将第 n 位至第 0 位(含)清零,x & (~((1 << (n + 1)) - 1))
+```
+
+- 有特殊意义的 & 位操作运算。第 260 题,第 201 题,第 318 题,第 371 题,第 397 题,第 461 题,第 693 题,
+
+```go
+X & 1 == 1 判断是否是奇数(偶数)
+X & = (X - 1) 将最低位(LSB)的 1 清零
+X & -X 得到最低位(LSB)的 1
+X & ~X = 0
+```
+
+Problems List in [there](https://books.halfrost.com/leetcode/ChapterTwo/Bit_Manipulation/)
+
+
+## Union Find
+
+
+
+- 灵活使用并查集的思想,熟练掌握并查集的[模板](https://github.com/halfrost/leetcode-go/blob/master/template/UnionFind.go),模板中有两种并查集的实现方式,一种是路径压缩 + 秩优化的版本,另外一种是计算每个集合中元素的个数 + 最大集合元素个数的版本,这两种版本都有各自使用的地方。能使用第一类并查集模板的题目有:第 128 题,第 130 题,第 547 题,第 684 题,第 721 题,第 765 题,第 778 题,第 839 题,第 924 题,第 928 题,第 947 题,第 952 题,第 959 题,第 990 题。能使用第二类并查集模板的题目有:第 803 题,第 952 题。第 803 题秩优化和统计集合个数这些地方会卡时间,如果不优化,会 TLE。
+- 并查集是一种思想,有些题需要灵活使用这种思想,而不是死套模板,如第 399 题,这一题是 stringUnionFind,利用并查集思想实现的。这里每个节点是基于字符串和 map 的,而不是单纯的用 int 节点编号实现的。
+- 有些题死套模板反而做不出来,比如第 685 题,这一题不能路径压缩和秩优化,因为题目中涉及到有向图,需要知道节点的前驱节点,如果路径压缩了,这一题就没法做了。这一题不需要路径压缩和秩优化。
+- 灵活的抽象题目给的信息,将给定的信息合理的编号,使用并查集解题,并用 map 降低时间复杂度,如第 721 题,第 959 题。
+- 关于地图,砖块,网格的题目,可以新建一个特殊节点,将四周边缘的砖块或者网格都 union() 到这个特殊节点上。第 130 题,第 803 题。
+- 能用并查集的题目,一般也可以用 DFS 和 BFS 解答,只不过时间复杂度会高一点。
+
+
+Problems List in [there](https://books.halfrost.com/leetcode/ChapterTwo/Union_Find/)
+
+
+
+## Sliding Window
+
+
+
+- 双指针滑动窗口的经典写法。右指针不断往右移,移动到不能往右移动为止(具体条件根据题目而定)。当右指针到最右边以后,开始挪动左指针,释放窗口左边界。第 3 题,第 76 题,第 209 题,第 424 题,第 438 题,第 567 题,第 713 题,第 763 题,第 845 题,第 881 题,第 904 题,第 978 题,第 992 题,第 1004 题,第 1040 题,第 1052 题。
+
+```c
+ left, right := 0, -1
+
+ for left < len(s) {
+ if right+1 < len(s) && freq[s[right+1]-'a'] == 0 {
+ freq[s[right+1]-'a']++
+ right++
+ } else {
+ freq[s[left]-'a']--
+ left++
+ }
+ result = max(result, right-left+1)
+ }
+```
+- 滑动窗口经典题。第 239 题,第 480 题。
+
+Problems List in [there](https://books.halfrost.com/leetcode/ChapterTwo/Sliding_Window/)
+
+
+## Segment Tree
+
+
+
+- 线段树的经典数组实现写法。将合并两个节点 pushUp 逻辑抽象出来了,可以实现任意操作(常见的操作有:加法,取 max,min 等等)。第 218 题,第 303 题,第 307 题,第 699 题。
+- 计数线段树的经典写法。第 315 题,第 327 题,第 493 题。
+- 线段树的树的实现写法。第 715 题,第 732 题。
+- 区间懒惰更新。第 218 题,第 699 题。
+- 离散化。离散化需要注意一个特殊情况:假如三个区间为 [1,10] [1,4] [6,10],离散化后 x[1]=1,x[2]=4,x[3]=6,x[4]=10。第一个区间为 [1,4],第二个区间为 [1,2],第三个区间为 [3,4],这样一来,区间一 = 区间二 + 区间三,这和离散前的模型不符,离散前,很明显,区间一 > 区间二 + 区间三。正确的做法是:在相差大于 1 的数间加一个数,例如在上面 1 4 6 10 中间加 5,即可 x[1]=1,x[2]=4,x[3]=5,x[4]=6,x[5]=10。这样处理之后,区间一是 1-5 ,区间二是 1-2 ,区间三是 4-5 。
+- 灵活构建线段树。线段树节点可以存储多条信息,合并两个节点的 pushUp 操作也可以是多样的。第 850 题,第 1157 题。
+
+
+线段树[题型](https://blog.csdn.net/xuechelingxiao/article/details/38313105)从简单到困难:
+
+1. 单点更新:
+ [HDU 1166 敌兵布阵](http://acm.hdu.edu.cn/showproblem.php?pid=1166) update:单点增减 query:区间求和
+ [HDU 1754 I Hate It](http://acm.hdu.edu.cn/showproblem.php?pid=1754) update:单点替换 query:区间最值
+ [HDU 1394 Minimum Inversion Number](http://acm.hdu.edu.cn/showproblem.php?pid=1394) update:单点增减 query:区间求和
+ [HDU 2795 Billboard](http://acm.hdu.edu.cn/showproblem.php?pid=2795) query:区间求最大值的位子(直接把update的操作在query里做了)
+2. 区间更新:
+ [HDU 1698 Just a Hook](http://acm.hdu.edu.cn/showproblem.php?pid=1698) update:成段替换 (由于只query一次总区间,所以可以直接输出 1 结点的信息)
+ [POJ 3468 A Simple Problem with Integers](http://poj.org/problem?id=3468) update:成段增减 query:区间求和
+ [POJ 2528 Mayor’s posters](http://poj.org/problem?id=2528) 离散化 + update:成段替换 query:简单hash
+ [POJ 3225 Help with Intervals](http://poj.org/problem?id=3225) update:成段替换,区间异或 query:简单hash
+3. 区间合并(这类题目会询问区间中满足条件的连续最长区间,所以PushUp的时候需要对左右儿子的区间进行合并):
+ [POJ 3667 Hotel](http://poj.org/problem?id=3667) update:区间替换 query:询问满足条件的最左端点
+4. 扫描线(这类题目需要将一些操作排序,然后从左到右用一根扫描线扫过去最典型的就是矩形面积并,周长并等题):
+ [HDU 1542 Atlantis](http://acm.hdu.edu.cn/showproblem.php?pid=1542) update:区间增减 query:直接取根节点的值
+ [HDU 1828 Picture](http://acm.hdu.edu.cn/showproblem.php?pid=1828) update:区间增减 query:直接取根节点的值
+
+Problems List in [there](https://books.halfrost.com/leetcode/ChapterTwo/Segment_Tree/)
+
+
+## Binary Indexed Tree
+
+
+
+Problems List in [there](https://books.halfrost.com/leetcode/ChapterTwo/Binary_Indexed_Tree/)
+
+
+----------------------------------------------------------------------------------------
+
+
+
+Thank you for reading here. This is bonus. You can download my [《ACM-ICPC Algorithm Template》](https://github.com/halfrost/leetcode-go/releases/tag/Special/)
+
+
+
+## ♥️ Thanks
+
+Thanks for your Star!
+
+[](https://starchart.cc/halfrost/LeetCode-Go)
+
diff --git a/ctl/template_render.go b/ctl/template_render.go
new file mode 100644
index 000000000..01c65f28f
--- /dev/null
+++ b/ctl/template_render.go
@@ -0,0 +1,39 @@
+package main
+
+import (
+ "bytes"
+ "fmt"
+ "html/template"
+ "io/ioutil"
+ "os"
+
+ m "github.com/halfrost/LeetCode-Go/ctl/models"
+ "github.com/halfrost/LeetCode-Go/ctl/util"
+)
+
+func makeReadmeFile(mdrows m.Mdrows) {
+ file := "./README.md"
+ os.Remove(file)
+ var b bytes.Buffer
+ tmpl := template.Must(template.New("readme").Parse(readTMPL("template.markdown")))
+ err := tmpl.Execute(&b, mdrows)
+ if err != nil {
+ fmt.Println(err)
+ }
+ // 保存 README.md 文件
+ util.WriteFile(file, b.Bytes())
+}
+
+func readTMPL(path string) string {
+ file, err := os.Open(path)
+ if err != nil {
+ fmt.Println(err)
+ }
+ defer file.Close()
+
+ data, err := ioutil.ReadAll(file)
+ if err != nil {
+ fmt.Println(err)
+ }
+ return string(data)
+}
diff --git a/ctl/util/go.mod b/ctl/util/go.mod
new file mode 100644
index 000000000..6127aeea8
--- /dev/null
+++ b/ctl/util/go.mod
@@ -0,0 +1,3 @@
+module github.com/halfrost/LeetCode-Go/ctl/util
+
+go 1.19
diff --git a/ctl/util/util.go b/ctl/util/util.go
new file mode 100644
index 000000000..4fcf5b025
--- /dev/null
+++ b/ctl/util/util.go
@@ -0,0 +1,185 @@
+package util
+
+import (
+ "bufio"
+ "fmt"
+ "io"
+ "io/ioutil"
+ "os"
+ "path/filepath"
+ "sort"
+ "strconv"
+ "strings"
+)
+
+// LoadSolutionsDir define
+func LoadSolutionsDir() ([]int, []string, int) {
+ solutionIds, soNames, total := loadFile("../leetcode/")
+ fmt.Printf("读取了 %v 道题的题解,当前目录下有 %v 个文件(可能包含 .DS_Store),目录中有 %v 道题在尝试中\n", len(solutionIds), total, total-len(solutionIds))
+ return solutionIds, soNames, total - len(solutionIds)
+}
+
+func loadFile(path string) ([]int, []string, int) {
+ files, err := ioutil.ReadDir(path)
+ if err != nil {
+ fmt.Println(err)
+ }
+ solutionIds, soNames, solutionsMap := []int{}, []string{}, map[int]string{}
+ for _, f := range files {
+ if f.Name()[4] == '.' {
+ tmp, err := strconv.Atoi(f.Name()[:4])
+ if err != nil {
+ fmt.Println(err)
+ }
+ solutionIds = append(solutionIds, tmp)
+ solutionsMap[tmp] = f.Name()
+ }
+ }
+ sort.Ints(solutionIds)
+ for _, v := range solutionIds {
+ if name, ok := solutionsMap[v]; ok {
+ soNames = append(soNames, name)
+ }
+ }
+ return solutionIds, soNames, len(files)
+}
+
+// GetAllFile define
+func GetAllFile(pathname string, fileList *[]string) ([]string, error) {
+ rd, err := ioutil.ReadDir(pathname)
+ for _, fi := range rd {
+ if fi.IsDir() {
+ //fmt.Printf("[%s]\n", pathname+"\\"+fi.Name())
+ GetAllFile(pathname+fi.Name()+"/", fileList)
+ } else {
+ //fmt.Println(fi.Name())
+ *fileList = append(*fileList, fi.Name())
+ }
+ }
+ return *fileList, err
+}
+
+// LoadChapterFourDir define
+func LoadChapterFourDir() ([]string, []int) {
+ files, err := GetAllFile("../website/content/ChapterFour/", &[]string{})
+ // files, err := ioutil.ReadDir("../website/content/ChapterFour/")
+ if err != nil {
+ fmt.Println(err)
+ }
+ solutions, solutionIds, solutionsMap := []string{}, []int{}, map[int]string{}
+ for _, f := range files {
+ if f[4] == '.' {
+ tmp, err := strconv.Atoi(f[:4])
+ if err != nil {
+ fmt.Println(err)
+ }
+ solutionIds = append(solutionIds, tmp)
+ // len(f.Name())-3 = 文件名去掉 .md 后缀
+ solutionsMap[tmp] = f[:len(f)-3]
+ }
+ }
+ sort.Ints(solutionIds)
+ fmt.Printf("读取了第四章的 %v 道题的题解\n", len(solutionIds))
+ for _, v := range solutionIds {
+ if name, ok := solutionsMap[v]; ok {
+ solutions = append(solutions, name)
+ }
+ }
+ return solutions, solutionIds
+}
+
+// WriteFile define
+func WriteFile(fileName string, content []byte) {
+ file, err := os.OpenFile(fileName, os.O_RDWR|os.O_CREATE, 0777)
+ if err != nil {
+ fmt.Println(err)
+ }
+ defer file.Close()
+
+ _, err = file.Write(content)
+ if err != nil {
+ fmt.Println(err)
+ }
+ //fmt.Println("write file successful")
+}
+
+// LoadFile define
+func LoadFile(filePath string) ([]byte, error) {
+ f, err := os.OpenFile(filePath, os.O_RDONLY, 0644)
+ if err != nil {
+ return nil, err
+ }
+ defer f.Close()
+ reader, output := bufio.NewReader(f), []byte{}
+ for {
+ line, _, err := reader.ReadLine()
+ if err != nil {
+ if err == io.EOF {
+ return output, nil
+ }
+ return nil, err
+ }
+ output = append(output, line...)
+ output = append(output, []byte("\n")...)
+ }
+}
+
+// DestoryDir define
+func DestoryDir(path string) {
+ filepath.Walk(path, func(path string, fi os.FileInfo, err error) error {
+ if nil == fi {
+ return err
+ }
+ if !fi.IsDir() {
+ return nil
+ }
+ name := fi.Name()
+ if strings.Contains(name, "temp") {
+ fmt.Println("temp file name:", path)
+ err := os.RemoveAll(path)
+ if err != nil {
+ fmt.Println("delet dir error:", err)
+ }
+ }
+ return nil
+ })
+}
+
+// CopyFile define
+func CopyFile(dstName, srcName string) (written int64, err error) {
+ src, err := os.Open(srcName)
+ if err != nil {
+ return
+ }
+ defer src.Close()
+ dst, err := os.OpenFile(dstName, os.O_WRONLY|os.O_CREATE, 0644)
+ if err != nil {
+ return
+ }
+ defer dst.Close()
+ return io.Copy(dst, src)
+}
+
+// BinarySearch define
+func BinarySearch(nums []int, target int) int {
+ low, high := 0, len(nums)-1
+ for low <= high {
+ mid := low + (high-low)>>1
+ if nums[mid] == target {
+ return mid
+ } else if nums[mid] > target {
+ high = mid - 1
+ } else {
+ low = mid + 1
+ }
+ }
+ return -1
+}
+
+// GetChpaterFourFileNum define
+func GetChpaterFourFileNum(num int) string {
+ if num < 100 {
+ return fmt.Sprintf("%04d~%04d", (num/100)*100+1, (num/100)*100+99)
+ }
+ return fmt.Sprintf("%04d~%04d", (num/100)*100, (num/100)*100+99)
+}
diff --git a/ctl/version.go b/ctl/version.go
new file mode 100644
index 000000000..c996a651a
--- /dev/null
+++ b/ctl/version.go
@@ -0,0 +1,18 @@
+package main
+
+import (
+ "fmt"
+
+ "github.com/spf13/cobra"
+)
+
+var (
+ version = "v1.0"
+ versionCmd = &cobra.Command{
+ Use: "version",
+ Short: "Prints the version of tacoctl",
+ Run: func(cmd *cobra.Command, args []string) {
+ fmt.Println("tacoctl version:", version)
+ },
+ }
+)
diff --git a/go.mod b/go.mod
new file mode 100644
index 000000000..3b163f0e1
--- /dev/null
+++ b/go.mod
@@ -0,0 +1,30 @@
+module github.com/halfrost/LeetCode-Go
+
+go 1.19
+
+replace github.com/halfrost/LeetCode-Go/structures => ./structures
+
+replace github.com/halfrost/LeetCode-Go/template => ./template
+
+replace github.com/halfrost/LeetCode-Go/ctl/util => ./ctl/util
+
+replace github.com/halfrost/LeetCode-Go/ctl/models => ./ctl/models
+
+require (
+ github.com/BurntSushi/toml v1.2.0
+ github.com/halfrost/LeetCode-Go/ctl/models v0.0.0-20220910225043-e3bb5aff34d0
+ github.com/halfrost/LeetCode-Go/ctl/util v0.0.0-20220910225043-e3bb5aff34d0
+ github.com/halfrost/LeetCode-Go/structures v0.0.0-20220910233101-aa0e2c897b18
+ github.com/halfrost/LeetCode-Go/template v0.0.0-20220910233504-e2a72e6212ce
+ github.com/mozillazg/request v0.8.0
+ github.com/spf13/cobra v1.5.0
+)
+
+require (
+ github.com/bitly/go-simplejson v0.5.0 // indirect
+ github.com/bmizerany/assert v0.0.0-20160611221934-b7ed37b82869 // indirect
+ github.com/inconshreveable/mousetrap v1.0.0 // indirect
+ github.com/kr/pretty v0.3.0 // indirect
+ github.com/spf13/pflag v1.0.5 // indirect
+ golang.org/x/net v0.7.0 // indirect
+)
diff --git a/go.sum b/go.sum
new file mode 100644
index 000000000..d1e5e64b1
--- /dev/null
+++ b/go.sum
@@ -0,0 +1,36 @@
+github.com/BurntSushi/toml v1.2.0 h1:Rt8g24XnyGTyglgET/PRUNlrUeu9F5L+7FilkXfZgs0=
+github.com/BurntSushi/toml v1.2.0/go.mod h1:CxXYINrC8qIiEnFrOxCa7Jy5BFHlXnUU2pbicEuybxQ=
+github.com/bitly/go-simplejson v0.5.0 h1:6IH+V8/tVMab511d5bn4M7EwGXZf9Hj6i2xSwkNEM+Y=
+github.com/bitly/go-simplejson v0.5.0/go.mod h1:cXHtHw4XUPsvGaxgjIAn8PhEWG9NfngEKAMDJEczWVA=
+github.com/bmizerany/assert v0.0.0-20160611221934-b7ed37b82869 h1:DDGfHa7BWjL4YnC6+E63dPcxHo2sUxDIu8g3QgEJdRY=
+github.com/bmizerany/assert v0.0.0-20160611221934-b7ed37b82869/go.mod h1:Ekp36dRnpXw/yCqJaO+ZrUyxD+3VXMFFr56k5XYrpB4=
+github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o=
+github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
+github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
+github.com/inconshreveable/mousetrap v1.0.0 h1:Z8tu5sraLXCXIcARxBp/8cbvlwVa7Z1NHg9XEKhtSvM=
+github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8=
+github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
+github.com/kr/pretty v0.3.0 h1:WgNl7dwNpEZ6jJ9k1snq4pZsg7DOEN8hP9Xw0Tsjwk0=
+github.com/kr/pretty v0.3.0/go.mod h1:640gp4NfQd8pI5XOwp5fnNeVWj67G7CFk/SaSQn7NBk=
+github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
+github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
+github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
+github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
+github.com/mozillazg/request v0.8.0 h1:TbXeQUdBWr1J1df5Z+lQczDFzX9JD71kTCl7Zu/9rNM=
+github.com/mozillazg/request v0.8.0/go.mod h1:weoQ/mVFNbWgRBtivCGF1tUT9lwneFesues+CleXMWc=
+github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
+github.com/rogpeppe/go-internal v1.6.1 h1:/FiVV8dS/e+YqF2JvO3yXRFbBLTIuSDkuC7aBOAvL+k=
+github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc=
+github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
+github.com/spf13/cobra v1.5.0 h1:X+jTBEBqF0bHN+9cSMgmfuvv2VHJ9ezmFNf9Y/XstYU=
+github.com/spf13/cobra v1.5.0/go.mod h1:dWXEIy2H428czQCjInthrTRUg7yKbok+2Qi/yBIJoUM=
+github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA=
+github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
+github.com/stretchr/testify v1.8.0 h1:pSgiaMZlXftHpm5L7V1+rVB+AZJydKsMxsQBIJw4PKk=
+golang.org/x/net v0.7.0 h1:rJrUqqhjsgNp7KqAIc25s9pZnjU7TUcSY7HcVZjdn1g=
+golang.org/x/net v0.7.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs=
+gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
+gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
+gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI=
+gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ=
+gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
diff --git a/leetcode/0003.Longest-Substring-Without-Repeating-Characters/3. Longest Substring Without Repeating Characters.go b/leetcode/0003.Longest-Substring-Without-Repeating-Characters/3. Longest Substring Without Repeating Characters.go
index 672dbdb54..541f868de 100644
--- a/leetcode/0003.Longest-Substring-Without-Repeating-Characters/3. Longest Substring Without Repeating Characters.go
+++ b/leetcode/0003.Longest-Substring-Without-Repeating-Characters/3. Longest Substring Without Repeating Characters.go
@@ -8,7 +8,7 @@ func lengthOfLongestSubstring(s string) int {
var bitSet [256]bool
result, left, right := 0, 0, 0
for left < len(s) {
- // 右侧字符对应的bitSet被标记true,说明此字符在X位置重复,需要左侧向前移动,直到将X标记为false
+ // 右侧字符对应的 bitSet 被标记 true,说明此字符在 X 位置重复,需要左侧向前移动,直到将 X 标记为 false
if bitSet[s[right]] {
bitSet[s[left]] = false
left++
@@ -27,19 +27,20 @@ func lengthOfLongestSubstring(s string) int {
}
// 解法二 滑动窗口
-func lengthOfLongestSubstring_(s string) int {
+func lengthOfLongestSubstring1(s string) int {
if len(s) == 0 {
return 0
}
- var freq [256]int
+ var freq [127]int
result, left, right := 0, 0, -1
for left < len(s) {
- if right+1 < len(s) && freq[s[right+1]-'a'] == 0 {
- freq[s[right+1]-'a']++
+ if right+1 < len(s) && freq[s[right+1]] == 0 {
+ freq[s[right+1]]++
right++
+
} else {
- freq[s[left]-'a']--
+ freq[s[left]]--
left++
}
result = max(result, right-left+1)
@@ -47,6 +48,21 @@ func lengthOfLongestSubstring_(s string) int {
return result
}
+// 解法三 滑动窗口-哈希桶
+func lengthOfLongestSubstring2(s string) int {
+ right, left, res := 0, 0, 0
+ indexes := make(map[byte]int, len(s))
+ for left < len(s) {
+ if idx, ok := indexes[s[left]]; ok && idx >= right {
+ right = idx + 1
+ }
+ indexes[s[left]] = left
+ left++
+ res = max(res, left-right)
+ }
+ return res
+}
+
func max(a int, b int) int {
if a > b {
return a
diff --git a/leetcode/0003.Longest-Substring-Without-Repeating-Characters/3. Longest Substring Without Repeating Characters_test.go b/leetcode/0003.Longest-Substring-Without-Repeating-Characters/3. Longest Substring Without Repeating Characters_test.go
index 5dc9bcd2a..7eebdbfa8 100644
--- a/leetcode/0003.Longest-Substring-Without-Repeating-Characters/3. Longest Substring Without Repeating Characters_test.go
+++ b/leetcode/0003.Longest-Substring-Without-Repeating-Characters/3. Longest Substring Without Repeating Characters_test.go
@@ -51,7 +51,7 @@ func Test_Problem3(t *testing.T) {
for _, q := range qs {
_, p := q.ans3, q.para3
- fmt.Printf("【input】:%v 【output】:%v\n", p, lengthOfLongestSubstring_(p.s))
+ fmt.Printf("【input】:%v 【output】:%v\n", p, lengthOfLongestSubstring(p.s))
}
fmt.Printf("\n\n\n")
}
diff --git a/leetcode/0003.Longest-Substring-Without-Repeating-Characters/README.md b/leetcode/0003.Longest-Substring-Without-Repeating-Characters/README.md
index 15ecc0ebe..9f80ab4a5 100644
--- a/leetcode/0003.Longest-Substring-Without-Repeating-Characters/README.md
+++ b/leetcode/0003.Longest-Substring-Without-Repeating-Characters/README.md
@@ -34,7 +34,7 @@ Explanation: The answer is "wke", with the length of 3.
## 题目大意
-在一个字符串重寻找没有重复字母的最长子串。
+在一个字符串中寻找没有重复字母的最长子串。
## 解题思路
diff --git a/leetcode/0004.Median-of-Two-Sorted-Arrays/README.md b/leetcode/0004.Median-of-Two-Sorted-Arrays/README.md
index c6537dbcd..1840f2833 100755
--- a/leetcode/0004.Median-of-Two-Sorted-Arrays/README.md
+++ b/leetcode/0004.Median-of-Two-Sorted-Arrays/README.md
@@ -39,7 +39,7 @@ You may assume **nums1** and **nums2** cannot be both empty.
- 给出两个有序数组,要求找出这两个数组合并以后的有序数组中的中位数。要求时间复杂度为 O(log (m+n))。
-- 这一题最容易想到的办法是把两个数组合并,然后取出中位数。但是合并有序数组的操作是 `O(max(n,m))` 的,不符合题意。看到题目给的 `log` 的时间复杂度,很容易联想到二分搜索。
+- 这一题最容易想到的办法是把两个数组合并,然后取出中位数。但是合并有序数组的操作是 `O(m+n)` 的,不符合题意。看到题目给的 `log` 的时间复杂度,很容易联想到二分搜索。
- 由于要找到最终合并以后数组的中位数,两个数组的总大小也知道,所以中间这个位置也是知道的。只需要二分搜索一个数组中切分的位置,另一个数组中切分的位置也能得到。为了使得时间复杂度最小,所以二分搜索两个数组中长度较小的那个数组。
- 关键的问题是如何切分数组 1 和数组 2 。其实就是如何切分数组 1 。先随便二分产生一个 `midA`,切分的线何时算满足了中位数的条件呢?即,线左边的数都小于右边的数,即,`nums1[midA-1] ≤ nums2[midB] && nums2[midB-1] ≤ nums1[midA]` 。如果这些条件都不满足,切分线就需要调整。如果 `nums1[midA] < nums2[midB-1]`,说明 `midA` 这条线划分出来左边的数小了,切分线应该右移;如果 `nums1[midA-1] > nums2[midB]`,说明 midA 这条线划分出来左边的数大了,切分线应该左移。经过多次调整以后,切分线总能找到满足条件的解。
- 假设现在找到了切分的两条线了,`数组 1` 在切分线两边的下标分别是 `midA - 1` 和 `midA`。`数组 2` 在切分线两边的下标分别是 `midB - 1` 和 `midB`。最终合并成最终数组,如果数组长度是奇数,那么中位数就是 `max(nums1[midA-1], nums2[midB-1])`。如果数组长度是偶数,那么中间位置的两个数依次是:`max(nums1[midA-1], nums2[midB-1])` 和 `min(nums1[midA], nums2[midB])`,那么中位数就是 `(max(nums1[midA-1], nums2[midB-1]) + min(nums1[midA], nums2[midB])) / 2`。图示见下图:
diff --git a/leetcode/0005.Longest-Palindromic-Substring/5. Longest Palindromic Substring.go b/leetcode/0005.Longest-Palindromic-Substring/5. Longest Palindromic Substring.go
new file mode 100644
index 000000000..4ede2f1a5
--- /dev/null
+++ b/leetcode/0005.Longest-Palindromic-Substring/5. Longest Palindromic Substring.go
@@ -0,0 +1,117 @@
+package leetcode
+
+// 解法一 Manacher's algorithm,时间复杂度 O(n),空间复杂度 O(n)
+func longestPalindrome(s string) string {
+ if len(s) < 2 {
+ return s
+ }
+ newS := make([]rune, 0)
+ newS = append(newS, '#')
+ for _, c := range s {
+ newS = append(newS, c)
+ newS = append(newS, '#')
+ }
+ // dp[i]: 以预处理字符串下标 i 为中心的回文半径(奇数长度时不包括中心)
+ // maxRight: 通过中心扩散的方式能够扩散的最右边的下标
+ // center: 与 maxRight 对应的中心字符的下标
+ // maxLen: 记录最长回文串的半径
+ // begin: 记录最长回文串在起始串 s 中的起始下标
+ dp, maxRight, center, maxLen, begin := make([]int, len(newS)), 0, 0, 1, 0
+ for i := 0; i < len(newS); i++ {
+ if i < maxRight {
+ // 这一行代码是 Manacher 算法的关键所在
+ dp[i] = min(maxRight-i, dp[2*center-i])
+ }
+ // 中心扩散法更新 dp[i]
+ left, right := i-(1+dp[i]), i+(1+dp[i])
+ for left >= 0 && right < len(newS) && newS[left] == newS[right] {
+ dp[i]++
+ left--
+ right++
+ }
+ // 更新 maxRight,它是遍历过的 i 的 i + dp[i] 的最大者
+ if i+dp[i] > maxRight {
+ maxRight = i + dp[i]
+ center = i
+ }
+ // 记录最长回文子串的长度和相应它在原始字符串中的起点
+ if dp[i] > maxLen {
+ maxLen = dp[i]
+ begin = (i - maxLen) / 2 // 这里要除以 2 因为有我们插入的辅助字符 #
+ }
+ }
+ return s[begin : begin+maxLen]
+}
+
+func min(x, y int) int {
+ if x < y {
+ return x
+ }
+ return y
+}
+
+// 解法二 滑动窗口,时间复杂度 O(n^2),空间复杂度 O(1)
+func longestPalindrome1(s string) string {
+ if len(s) == 0 {
+ return ""
+ }
+ left, right, pl, pr := 0, -1, 0, 0
+ for left < len(s) {
+ // 移动到相同字母的最右边(如果有相同字母)
+ for right+1 < len(s) && s[left] == s[right+1] {
+ right++
+ }
+ // 找到回文的边界
+ for left-1 >= 0 && right+1 < len(s) && s[left-1] == s[right+1] {
+ left--
+ right++
+ }
+ if right-left > pr-pl {
+ pl, pr = left, right
+ }
+ // 重置到下一次寻找回文的中心
+ left = (left+right)/2 + 1
+ right = left
+ }
+ return s[pl : pr+1]
+}
+
+// 解法三 中心扩散法,时间复杂度 O(n^2),空间复杂度 O(1)
+func longestPalindrome2(s string) string {
+ res := ""
+ for i := 0; i < len(s); i++ {
+ res = maxPalindrome(s, i, i, res)
+ res = maxPalindrome(s, i, i+1, res)
+ }
+ return res
+}
+
+func maxPalindrome(s string, i, j int, res string) string {
+ sub := ""
+ for i >= 0 && j < len(s) && s[i] == s[j] {
+ sub = s[i : j+1]
+ i--
+ j++
+ }
+ if len(res) < len(sub) {
+ return sub
+ }
+ return res
+}
+
+// 解法四 DP,时间复杂度 O(n^2),空间复杂度 O(n^2)
+func longestPalindrome3(s string) string {
+ res, dp := "", make([][]bool, len(s))
+ for i := 0; i < len(s); i++ {
+ dp[i] = make([]bool, len(s))
+ }
+ for i := len(s) - 1; i >= 0; i-- {
+ for j := i; j < len(s); j++ {
+ dp[i][j] = (s[i] == s[j]) && ((j-i < 3) || dp[i+1][j-1])
+ if dp[i][j] && (res == "" || j-i+1 > len(res)) {
+ res = s[i : j+1]
+ }
+ }
+ }
+ return res
+}
diff --git a/leetcode/0005.Longest-Palindromic-Substring/5. Longest Palindromic Substring_test.go b/leetcode/0005.Longest-Palindromic-Substring/5. Longest Palindromic Substring_test.go
new file mode 100644
index 000000000..de64571bd
--- /dev/null
+++ b/leetcode/0005.Longest-Palindromic-Substring/5. Longest Palindromic Substring_test.go
@@ -0,0 +1,67 @@
+package leetcode
+
+import (
+ "fmt"
+ "testing"
+)
+
+type question5 struct {
+ para5
+ ans5
+}
+
+// para 是参数
+// one 代表第一个参数
+type para5 struct {
+ s string
+}
+
+// ans 是答案
+// one 代表第一个答案
+type ans5 struct {
+ one string
+}
+
+func Test_Problem5(t *testing.T) {
+
+ qs := []question5{
+
+ {
+ para5{"babad"},
+ ans5{"bab"},
+ },
+
+ {
+ para5{"cbbd"},
+ ans5{"bb"},
+ },
+
+ {
+ para5{"a"},
+ ans5{"a"},
+ },
+
+ {
+ para5{"ac"},
+ ans5{"a"},
+ },
+
+ {
+ para5{"aa"},
+ ans5{"aa"},
+ },
+
+ {
+ para5{"ajgiljtperkvubjmdsefcylksrxtftqrehoitdgdtttswwttmfuvwgwrruuqmxttzsbmuhgfaoueumvbhajqsaxkkihjwevzzedizmrsmpxqavyryklbotwzngxscvyuqjkkaotitddlhhnutmotupwuwyltebtsdfssbwayuxrbgihmtphshdslktvsjadaykyjivbzhwujcdvzdxxfiixnzrmusqvwujjmxhbqbdpauacnzojnzxxgrkmupadfcsujkcwajsgintahwgbjnvjqubcxajdyyapposrkpqtpqfjcvbhlmwfutgognqxgaukpmdyaxghgoqkqnigcllachmwzrazwhpppmsodvxilrccfqgpkmdqhoorxpyjsrtbeeidsinpeyxxpsjnymxkouskyhenzgieybwkgzrhhrzgkwbyeigznehyksuokxmynjspxxyepnisdieebtrsjypxroohqdmkpgqfccrlixvdosmppphwzarzwmhcallcginqkqoghgxaydmpkuagxqngogtufwmlhbvcjfqptqpkrsoppayydjaxcbuqjvnjbgwhatnigsjawckjuscfdapumkrgxxznjozncauapdbqbhxmjjuwvqsumrznxiifxxdzvdcjuwhzbvijykyadajsvtklsdhshptmhigbrxuyawbssfdstbetlywuwputomtunhhlddtitoakkjquyvcsxgnzwtoblkyryvaqxpmsrmzidezzvewjhikkxasqjahbvmueuoafghumbszttxmquurrwgwvufmttwwstttdgdtioherqtftxrsklycfesdmjbuvkreptjligja"},
+ ans5{"ajgiljtperkvubjmdsefcylksrxtftqrehoitdgdtttswwttmfuvwgwrruuqmxttzsbmuhgfaoueumvbhajqsaxkkihjwevzzedizmrsmpxqavyryklbotwzngxscvyuqjkkaotitddlhhnutmotupwuwyltebtsdfssbwayuxrbgihmtphshdslktvsjadaykyjivbzhwujcdvzdxxfiixnzrmusqvwujjmxhbqbdpauacnzojnzxxgrkmupadfcsujkcwajsgintahwgbjnvjqubcxajdyyapposrkpqtpqfjcvbhlmwfutgognqxgaukpmdyaxghgoqkqnigcllachmwzrazwhpppmsodvxilrccfqgpkmdqhoorxpyjsrtbeeidsinpeyxxpsjnymxkouskyhenzgieybwkgzrhhrzgkwbyeigznehyksuokxmynjspxxyepnisdieebtrsjypxroohqdmkpgqfccrlixvdosmppphwzarzwmhcallcginqkqoghgxaydmpkuagxqngogtufwmlhbvcjfqptqpkrsoppayydjaxcbuqjvnjbgwhatnigsjawckjuscfdapumkrgxxznjozncauapdbqbhxmjjuwvqsumrznxiifxxdzvdcjuwhzbvijykyadajsvtklsdhshptmhigbrxuyawbssfdstbetlywuwputomtunhhlddtitoakkjquyvcsxgnzwtoblkyryvaqxpmsrmzidezzvewjhikkxasqjahbvmueuoafghumbszttxmquurrwgwvufmttwwstttdgdtioherqtftxrsklycfesdmjbuvkreptjligja"},
+ },
+ }
+
+ fmt.Printf("------------------------Leetcode Problem 5------------------------\n")
+
+ for _, q := range qs {
+ _, p := q.ans5, q.para5
+ fmt.Printf("【input】:%v 【output】:%v\n", p, longestPalindrome(p.s))
+ }
+ fmt.Printf("\n\n\n")
+}
diff --git a/leetcode/0005.Longest-Palindromic-Substring/README.md b/leetcode/0005.Longest-Palindromic-Substring/README.md
new file mode 100644
index 000000000..e02c14561
--- /dev/null
+++ b/leetcode/0005.Longest-Palindromic-Substring/README.md
@@ -0,0 +1,186 @@
+# [5. Longest Palindromic Substring](https://leetcode.com/problems/longest-palindromic-substring/)
+
+
+## 题目
+
+Given a string `s`, return *the longest palindromic substring* in `s`.
+
+**Example 1:**
+
+```
+Input: s = "babad"
+Output: "bab"
+Note: "aba" is also a valid answer.
+
+```
+
+**Example 2:**
+
+```
+Input: s = "cbbd"
+Output: "bb"
+
+```
+
+**Example 3:**
+
+```
+Input: s = "a"
+Output: "a"
+
+```
+
+**Example 4:**
+
+```
+Input: s = "ac"
+Output: "a"
+
+```
+
+**Constraints:**
+
+- `1 <= s.length <= 1000`
+- `s` consist of only digits and English letters (lower-case and/or upper-case),
+
+## 题目大意
+
+给你一个字符串 `s`,找到 `s` 中最长的回文子串。
+
+## 解题思路
+
+- 此题非常经典,并且有多种解法。
+- 解法一,动态规划。定义 `dp[i][j]` 表示从字符串第 `i` 个字符到第 `j` 个字符这一段子串是否是回文串。由回文串的性质可以得知,回文串去掉一头一尾相同的字符以后,剩下的还是回文串。所以状态转移方程是 `dp[i][j] = (s[i] == s[j]) && ((j-i < 3) || dp[i+1][j-1])`,注意特殊的情况,`j - i == 1` 的时候,即只有 2 个字符的情况,只需要判断这 2 个字符是否相同即可。`j - i == 2` 的时候,即只有 3 个字符的情况,只需要判断除去中心以外对称的 2 个字符是否相等。每次循环动态维护保存最长回文串即可。时间复杂度 O(n^2),空间复杂度 O(n^2)。
+- 解法二,中心扩散法。动态规划的方法中,我们将任意起始,终止范围内的字符串都判断了一遍。其实没有这个必要,如果不是最长回文串,无需判断并保存结果。所以动态规划的方法在空间复杂度上还有优化空间。判断回文有一个核心问题是找到“轴心”。如果长度是偶数,那么轴心是中心虚拟的,如果长度是奇数,那么轴心正好是正中心的那个字母。中心扩散法的思想是枚举每个轴心的位置。然后做两次假设,假设最长回文串是偶数,那么以虚拟中心往 2 边扩散;假设最长回文串是奇数,那么以正中心的字符往 2 边扩散。扩散的过程就是对称判断两边字符是否相等的过程。这个方法时间复杂度和动态规划是一样的,但是空间复杂度降低了。时间复杂度 O(n^2),空间复杂度 O(1)。
+- 解法三,滑动窗口。这个写法其实就是中心扩散法变了一个写法。中心扩散是依次枚举每一个轴心。滑动窗口的方法稍微优化了一点,有些轴心两边字符不相等,下次就不会枚举这些不可能形成回文子串的轴心了。不过这点优化并没有优化时间复杂度,时间复杂度 O(n^2),空间复杂度 O(1)。
+- 解法四,马拉车算法。这个算法是本题的最优解,也是最复杂的解法。时间复杂度 O(n),空间复杂度 O(n)。中心扩散法有 2 处有重复判断,第一处是每次都往两边扩散,不同中心扩散多次,实际上有很多重复判断的字符,能否不重复判断?第二处,中心能否跳跃选择,不是每次都枚举,是否可以利用前一次的信息,跳跃选择下一次的中心?马拉车算法针对重复判断的问题做了优化,增加了一个辅助数组,将时间复杂度从 O(n^2) 优化到了 O(n),空间换了时间,空间复杂度增加到 O(n)。
+
+ 
+
+- 首先是预处理,向字符串的头尾以及每两个字符中间添加一个特殊字符 `#`,比如字符串 `aaba` 处理后会变成 `#a#a#b#a#`。那么原先长度为偶数的回文字符串 `aa` 会变成长度为奇数的回文字符串 `#a#a#`,而长度为奇数的回文字符串 `aba` 会变成长度仍然为奇数的回文字符串 `#a#b#a#`,经过预处理以后,都会变成长度为奇数的字符串。**注意这里的特殊字符不需要是没有出现过的字母,也可以使用任何一个字符来作为这个特殊字符。**这是因为,当我们只考虑长度为奇数的回文字符串时,每次我们比较的两个字符奇偶性一定是相同的,所以原来字符串中的字符不会与插入的特殊字符互相比较,不会因此产生问题。**预处理以后,以某个中心扩散的步数和实际字符串长度是相等的。**因为半径里面包含了插入的特殊字符,又由于左右对称的性质,所以扩散半径就等于原来回文子串的长度。
+
+ 
+
+- 核心部分是如何通过左边已经扫描过的数据推出右边下一次要扩散的中心。这里定义下一次要扩散的中心下标是 `i`。如果 `i` 比 `maxRight` 要小,只能继续中心扩散。如果 `i` 比 `maxRight` 大,这是又分为 3 种情况。三种情况见上图。将上述 3 种情况总结起来,就是 :`dp[i] = min(maxRight-i, dp[2*center-i])`,其中,`mirror` 相对于 `center` 是和 `i` 中心对称的,所以它的下标可以计算出来是 `2*center-i`。更新完 `dp[i]` 以后,就要进行中心扩散了。中心扩散以后动态维护最长回文串并相应的更新 `center`,`maxRight`,并且记录下原始字符串的起始位置 `begin` 和 `maxLen`。
+
+## 代码
+
+```go
+package leetcode
+
+// 解法一 Manacher's algorithm,时间复杂度 O(n),空间复杂度 O(n)
+func longestPalindrome(s string) string {
+ if len(s) < 2 {
+ return s
+ }
+ newS := make([]rune, 0)
+ newS = append(newS, '#')
+ for _, c := range s {
+ newS = append(newS, c)
+ newS = append(newS, '#')
+ }
+ // dp[i]: 以预处理字符串下标 i 为中心的回文半径(奇数长度时不包括中心)
+ // maxRight: 通过中心扩散的方式能够扩散的最右边的下标
+ // center: 与 maxRight 对应的中心字符的下标
+ // maxLen: 记录最长回文串的半径
+ // begin: 记录最长回文串在起始串 s 中的起始下标
+ dp, maxRight, center, maxLen, begin := make([]int, len(newS)), 0, 0, 1, 0
+ for i := 0; i < len(newS); i++ {
+ if i < maxRight {
+ // 这一行代码是 Manacher 算法的关键所在
+ dp[i] = min(maxRight-i, dp[2*center-i])
+ }
+ // 中心扩散法更新 dp[i]
+ left, right := i-(1+dp[i]), i+(1+dp[i])
+ for left >= 0 && right < len(newS) && newS[left] == newS[right] {
+ dp[i]++
+ left--
+ right++
+ }
+ // 更新 maxRight,它是遍历过的 i 的 i + dp[i] 的最大者
+ if i+dp[i] > maxRight {
+ maxRight = i + dp[i]
+ center = i
+ }
+ // 记录最长回文子串的长度和相应它在原始字符串中的起点
+ if dp[i] > maxLen {
+ maxLen = dp[i]
+ begin = (i - maxLen) / 2 // 这里要除以 2 因为有我们插入的辅助字符 #
+ }
+ }
+ return s[begin : begin+maxLen]
+}
+
+func min(x, y int) int {
+ if x < y {
+ return x
+ }
+ return y
+}
+
+// 解法二 滑动窗口,时间复杂度 O(n^2),空间复杂度 O(1)
+func longestPalindrome1(s string) string {
+ if len(s) == 0 {
+ return ""
+ }
+ left, right, pl, pr := 0, -1, 0, 0
+ for left < len(s) {
+ // 移动到相同字母的最右边(如果有相同字母)
+ for right+1 < len(s) && s[left] == s[right+1] {
+ right++
+ }
+ // 找到回文的边界
+ for left-1 >= 0 && right+1 < len(s) && s[left-1] == s[right+1] {
+ left--
+ right++
+ }
+ if right-left > pr-pl {
+ pl, pr = left, right
+ }
+ // 重置到下一次寻找回文的中心
+ left = (left+right)/2 + 1
+ right = left
+ }
+ return s[pl : pr+1]
+}
+
+// 解法三 中心扩散法,时间复杂度 O(n^2),空间复杂度 O(1)
+func longestPalindrome2(s string) string {
+ res := ""
+ for i := 0; i < len(s); i++ {
+ res = maxPalindrome(s, i, i, res)
+ res = maxPalindrome(s, i, i+1, res)
+ }
+ return res
+}
+
+func maxPalindrome(s string, i, j int, res string) string {
+ sub := ""
+ for i >= 0 && j < len(s) && s[i] == s[j] {
+ sub = s[i : j+1]
+ i--
+ j++
+ }
+ if len(res) < len(sub) {
+ return sub
+ }
+ return res
+}
+
+// 解法四 DP,时间复杂度 O(n^2),空间复杂度 O(n^2)
+func longestPalindrome3(s string) string {
+ res, dp := "", make([][]bool, len(s))
+ for i := 0; i < len(s); i++ {
+ dp[i] = make([]bool, len(s))
+ }
+ for i := len(s) - 1; i >= 0; i-- {
+ for j := i; j < len(s); j++ {
+ dp[i][j] = (s[i] == s[j]) && ((j-i < 3) || dp[i+1][j-1])
+ if dp[i][j] && (res == "" || j-i+1 > len(res)) {
+ res = s[i : j+1]
+ }
+ }
+ }
+ return res
+}
+```
\ No newline at end of file
diff --git a/leetcode/0006.ZigZag-Conversion/6. ZigZag Conversion.go b/leetcode/0006.ZigZag-Conversion/6. ZigZag Conversion.go
new file mode 100644
index 000000000..e35454ab2
--- /dev/null
+++ b/leetcode/0006.ZigZag-Conversion/6. ZigZag Conversion.go
@@ -0,0 +1,26 @@
+package leetcode
+
+func convert(s string, numRows int) string {
+ matrix, down, up := make([][]byte, numRows, numRows), 0, numRows-2
+ for i := 0; i != len(s); {
+ if down != numRows {
+ matrix[down] = append(matrix[down], byte(s[i]))
+ down++
+ i++
+ } else if up > 0 {
+ matrix[up] = append(matrix[up], byte(s[i]))
+ up--
+ i++
+ } else {
+ up = numRows - 2
+ down = 0
+ }
+ }
+ solution := make([]byte, 0, len(s))
+ for _, row := range matrix {
+ for _, item := range row {
+ solution = append(solution, item)
+ }
+ }
+ return string(solution)
+}
diff --git a/leetcode/0006.ZigZag-Conversion/6. ZigZag Conversion_test.go b/leetcode/0006.ZigZag-Conversion/6. ZigZag Conversion_test.go
new file mode 100644
index 000000000..c6bbd8242
--- /dev/null
+++ b/leetcode/0006.ZigZag-Conversion/6. ZigZag Conversion_test.go
@@ -0,0 +1,53 @@
+package leetcode
+
+import (
+ "fmt"
+ "testing"
+)
+
+type question6 struct {
+ para6
+ ans6
+}
+
+// para 是参数
+// one 代表第一个参数
+type para6 struct {
+ s string
+ numRows int
+}
+
+// ans 是答案
+// one 代表第一个答案
+type ans6 struct {
+ one string
+}
+
+func Test_Problem6(t *testing.T) {
+
+ qs := []question6{
+
+ {
+ para6{"PAYPALISHIRING", 3},
+ ans6{"PAHNAPLSIIGYIR"},
+ },
+
+ {
+ para6{"PAYPALISHIRING", 4},
+ ans6{"PINALSIGYAHRPI"},
+ },
+
+ {
+ para6{"A", 1},
+ ans6{"A"},
+ },
+ }
+
+ fmt.Printf("------------------------Leetcode Problem 6------------------------\n")
+
+ for _, q := range qs {
+ _, p := q.ans6, q.para6
+ fmt.Printf("【input】:%v 【output】:%v\n", p, convert(p.s, p.numRows))
+ }
+ fmt.Printf("\n\n\n")
+}
diff --git a/leetcode/0006.ZigZag-Conversion/README.md b/leetcode/0006.ZigZag-Conversion/README.md
new file mode 100644
index 000000000..b281e084c
--- /dev/null
+++ b/leetcode/0006.ZigZag-Conversion/README.md
@@ -0,0 +1,107 @@
+# [6. ZigZag Conversion](https://leetcode.com/problems/zigzag-conversion/)
+
+
+## 题目
+
+The string `"PAYPALISHIRING"` is written in a zigzag pattern on a given number of rows like this: (you may want to display this pattern in a fixed font for better legibility)
+
+```
+P A H N
+A P L S I I G
+Y I R
+```
+
+And then read line by line: `"PAHNAPLSIIGYIR"`
+
+Write the code that will take a string and make this conversion given a number of rows:
+
+```
+string convert(string s, int numRows);
+```
+
+**Example 1:**
+
+```
+Input: s = "PAYPALISHIRING", numRows = 3
+Output: "PAHNAPLSIIGYIR"
+```
+
+**Example 2:**
+
+```
+Input: s = "PAYPALISHIRING", numRows = 4
+Output: "PINALSIGYAHRPI"
+Explanation:
+P I N
+A L S I G
+Y A H R
+P I
+```
+
+**Example 3:**
+
+```
+Input: s = "A", numRows = 1
+Output: "A"
+```
+
+**Constraints:**
+
+- `1 <= s.length <= 1000`
+- `s` consists of English letters (lower-case and upper-case), `','` and `'.'`.
+- `1 <= numRows <= 1000`
+
+## 题目大意
+
+将一个给定字符串 `s` 根据给定的行数 `numRows` ,以从上往下、从左到右进行 Z 字形排列。
+
+比如输入字符串为 `"PAYPALISHIRING"` 行数为 3 时,排列如下:
+
+```go
+P A H N
+A P L S I I G
+Y I R
+```
+
+之后,你的输出需要从左往右逐行读取,产生出一个新的字符串,比如:`"PAHNAPLSIIGYIR"`。
+
+请你实现这个将字符串进行指定行数变换的函数:
+
+```go
+string convert(string s, int numRows);
+```
+
+## 解题思路
+
+- 这一题没有什么算法思想,考察的是对程序控制的能力。用 2 个变量保存方向,当垂直输出的行数达到了规定的目标行数以后,需要从下往上转折到第一行,循环中控制好方向ji
+
+## 代码
+
+```go
+package leetcode
+
+func convert(s string, numRows int) string {
+ matrix, down, up := make([][]byte, numRows, numRows), 0, numRows-2
+ for i := 0; i != len(s); {
+ if down != numRows {
+ matrix[down] = append(matrix[down], byte(s[i]))
+ down++
+ i++
+ } else if up > 0 {
+ matrix[up] = append(matrix[up], byte(s[i]))
+ up--
+ i++
+ } else {
+ up = numRows - 2
+ down = 0
+ }
+ }
+ solution := make([]byte, 0, len(s))
+ for _, row := range matrix {
+ for _, item := range row {
+ solution = append(solution, item)
+ }
+ }
+ return string(solution)
+}
+```
\ No newline at end of file
diff --git a/leetcode/0008.String-to-Integer-atoi/8. String to Integer atoi.go b/leetcode/0008.String-to-Integer-atoi/8. String to Integer atoi.go
new file mode 100644
index 000000000..24a04676d
--- /dev/null
+++ b/leetcode/0008.String-to-Integer-atoi/8. String to Integer atoi.go
@@ -0,0 +1,56 @@
+package leetcode
+
+func myAtoi(s string) int {
+ maxInt, signAllowed, whitespaceAllowed, sign, digits := int64(2<<30), true, true, 1, []int{}
+ for _, c := range s {
+ if c == ' ' && whitespaceAllowed {
+ continue
+ }
+ if signAllowed {
+ if c == '+' {
+ signAllowed = false
+ whitespaceAllowed = false
+ continue
+ } else if c == '-' {
+ sign = -1
+ signAllowed = false
+ whitespaceAllowed = false
+ continue
+ }
+ }
+ if c < '0' || c > '9' {
+ break
+ }
+ whitespaceAllowed, signAllowed = false, false
+ digits = append(digits, int(c-48))
+ }
+ var num, place int64
+ place, num = 1, 0
+ lastLeading0Index := -1
+ for i, d := range digits {
+ if d == 0 {
+ lastLeading0Index = i
+ } else {
+ break
+ }
+ }
+ if lastLeading0Index > -1 {
+ digits = digits[lastLeading0Index+1:]
+ }
+ var rtnMax int64
+ if sign > 0 {
+ rtnMax = maxInt - 1
+ } else {
+ rtnMax = maxInt
+ }
+ digitsCount := len(digits)
+ for i := digitsCount - 1; i >= 0; i-- {
+ num += int64(digits[i]) * place
+ place *= 10
+ if digitsCount-i > 10 || num > rtnMax {
+ return int(int64(sign) * rtnMax)
+ }
+ }
+ num *= int64(sign)
+ return int(num)
+}
diff --git a/leetcode/0008.String-to-Integer-atoi/8. String to Integer atoi_test.go b/leetcode/0008.String-to-Integer-atoi/8. String to Integer atoi_test.go
new file mode 100644
index 000000000..92b769ed4
--- /dev/null
+++ b/leetcode/0008.String-to-Integer-atoi/8. String to Integer atoi_test.go
@@ -0,0 +1,62 @@
+package leetcode
+
+import (
+ "fmt"
+ "testing"
+)
+
+type question8 struct {
+ para8
+ ans8
+}
+
+// para 是参数
+// one 代表第一个参数
+type para8 struct {
+ one string
+}
+
+// ans 是答案
+// one 代表第一个答案
+type ans8 struct {
+ one int
+}
+
+func Test_Problem8(t *testing.T) {
+
+ qs := []question8{
+
+ {
+ para8{"42"},
+ ans8{42},
+ },
+
+ {
+ para8{" -42"},
+ ans8{-42},
+ },
+
+ {
+ para8{"4193 with words"},
+ ans8{4193},
+ },
+
+ {
+ para8{"words and 987"},
+ ans8{0},
+ },
+
+ {
+ para8{"-91283472332"},
+ ans8{-2147483648},
+ },
+ }
+
+ fmt.Printf("------------------------Leetcode Problem 8------------------------\n")
+
+ for _, q := range qs {
+ _, p := q.ans8, q.para8
+ fmt.Printf("【input】:%v 【output】:%v\n", p.one, myAtoi(p.one))
+ }
+ fmt.Printf("\n\n\n")
+}
diff --git a/leetcode/0008.String-to-Integer-atoi/README.md b/leetcode/0008.String-to-Integer-atoi/README.md
new file mode 100644
index 000000000..677ed3340
--- /dev/null
+++ b/leetcode/0008.String-to-Integer-atoi/README.md
@@ -0,0 +1,192 @@
+# [8. String to Integer (atoi)](https://leetcode.com/problems/string-to-integer-atoi/)
+
+
+## 题目
+
+Implement the `myAtoi(string s)` function, which converts a string to a 32-bit signed integer (similar to C/C++'s `atoi` function).
+
+The algorithm for `myAtoi(string s)` is as follows:
+
+1. Read in and ignore any leading whitespace.
+2. Check if the next character (if not already at the end of the string) is `'-'` or `'+'`. Read this character in if it is either. This determines if the final result is negative or positive respectively. Assume the result is positive if neither is present.
+3. Read in next the characters until the next non-digit charcter or the end of the input is reached. The rest of the string is ignored.
+4. Convert these digits into an integer (i.e. `"123" -> 123`, `"0032" -> 32`). If no digits were read, then the integer is `0`. Change the sign as necessary (from step 2).
+5. If the integer is out of the 32-bit signed integer range `[-231, 231 - 1]`, then clamp the integer so that it remains in the range. Specifically, integers less than `231` should be clamped to `231`, and integers greater than `231 - 1` should be clamped to `231 - 1`.
+6. Return the integer as the final result.
+
+**Note:**
+
+- Only the space character `' '` is considered a whitespace character.
+- **Do not ignore** any characters other than the leading whitespace or the rest of the string after the digits.
+
+**Example 1:**
+
+```
+Input: s = "42"
+Output: 42
+Explanation: The underlined characters are what is read in, the caret is the current reader position.
+Step 1: "42" (no characters read because there is no leading whitespace)
+ ^
+Step 2: "42" (no characters read because there is neither a '-' nor '+')
+ ^
+Step 3: "42" ("42" is read in)
+ ^
+The parsed integer is 42.
+Since 42 is in the range [-231, 231 - 1], the final result is 42.
+
+```
+
+**Example 2:**
+
+```
+Input: s = " -42"
+Output: -42
+Explanation:
+Step 1: " -42" (leading whitespace is read and ignored)
+ ^
+Step 2: " -42" ('-' is read, so the result should be negative)
+ ^
+Step 3: " -42" ("42" is read in)
+ ^
+The parsed integer is -42.
+Since -42 is in the range [-231, 231 - 1], the final result is -42.
+
+```
+
+**Example 3:**
+
+```
+Input: s = "4193 with words"
+Output: 4193
+Explanation:
+Step 1: "4193 with words" (no characters read because there is no leading whitespace)
+ ^
+Step 2: "4193 with words" (no characters read because there is neither a '-' nor '+')
+ ^
+Step 3: "4193 with words" ("4193" is read in; reading stops because the next character is a non-digit)
+ ^
+The parsed integer is 4193.
+Since 4193 is in the range [-231, 231 - 1], the final result is 4193.
+
+```
+
+**Example 4:**
+
+```
+Input: s = "words and 987"
+Output: 0
+Explanation:
+Step 1: "words and 987" (no characters read because there is no leading whitespace)
+ ^
+Step 2: "words and 987" (no characters read because there is neither a '-' nor '+')
+ ^
+Step 3: "words and 987" (reading stops immediately because there is a non-digit 'w')
+ ^
+The parsed integer is 0 because no digits were read.
+Since 0 is in the range [-231, 231 - 1], the final result is 0.
+
+```
+
+**Example 5:**
+
+```
+Input: s = "-91283472332"
+Output: -2147483648
+Explanation:
+Step 1: "-91283472332" (no characters read because there is no leading whitespace)
+ ^
+Step 2: "-91283472332" ('-' is read, so the result should be negative)
+ ^
+Step 3: "-91283472332" ("91283472332" is read in)
+ ^
+The parsed integer is -91283472332.
+Since -91283472332 is less than the lower bound of the range [-231, 231 - 1], the final result is clamped to -231 = -2147483648.
+```
+
+**Constraints:**
+
+- `0 <= s.length <= 200`
+- `s` consists of English letters (lower-case and upper-case), digits (`0-9`), `' '`, `'+'`
+
+## 题目大意
+
+请你来实现一个 myAtoi(string s) 函数,使其能将字符串转换成一个 32 位有符号整数(类似 C/C++ 中的 atoi 函数)。
+
+函数 myAtoi(string s) 的算法如下:
+
+- 读入字符串并丢弃无用的前导空格
+- 检查下一个字符(假设还未到字符末尾)为正还是负号,读取该字符(如果有)。 确定最终结果是负数还是正数。 如果两者都不存在,则假定结果为正。
+- 读入下一个字符,直到到达下一个非数字字符或到达输入的结尾。字符串的其余部分将被忽略。
+- 将前面步骤读入的这些数字转换为整数(即,"123" -> 123, "0032" -> 32)。如果没有读入数字,则整数为 0 。必要时更改符号(从步骤 2 开始)。
+- 如果整数数超过 32 位有符号整数范围 [−231, 231 − 1] ,需要截断这个整数,使其保持在这个范围内。具体来说,小于 −231 的整数应该被固定为 −231 ,大于 231 − 1 的整数应该被固定为 231 − 1 。
+- 返回整数作为最终结果。
+
+注意:
+
+- 本题中的空白字符只包括空格字符 ' ' 。
+- 除前导空格或数字后的其余字符串外,请勿忽略 任何其他字符。
+
+## 解题思路
+
+- 这题是简单题。题目要求实现类似 `C++` 中 `atoi` 函数的功能。这个函数功能是将字符串类型的数字转成 `int` 类型数字。先去除字符串中的前导空格,并判断记录数字的符号。数字需要去掉前导 `0` 。最后将数字转换成数字类型,判断是否超过 `int` 类型的上限 `[-2^31, 2^31 - 1]`,如果超过上限,需要输出边界,即 `-2^31`,或者 `2^31 - 1`。
+
+## 代码
+
+```go
+package leetcode
+
+func myAtoi(s string) int {
+ maxInt, signAllowed, whitespaceAllowed, sign, digits := int64(2<<30), true, true, 1, []int{}
+ for _, c := range s {
+ if c == ' ' && whitespaceAllowed {
+ continue
+ }
+ if signAllowed {
+ if c == '+' {
+ signAllowed = false
+ whitespaceAllowed = false
+ continue
+ } else if c == '-' {
+ sign = -1
+ signAllowed = false
+ whitespaceAllowed = false
+ continue
+ }
+ }
+ if c < '0' || c > '9' {
+ break
+ }
+ whitespaceAllowed, signAllowed = false, false
+ digits = append(digits, int(c-48))
+ }
+ var num, place int64
+ place, num = 1, 0
+ lastLeading0Index := -1
+ for i, d := range digits {
+ if d == 0 {
+ lastLeading0Index = i
+ } else {
+ break
+ }
+ }
+ if lastLeading0Index > -1 {
+ digits = digits[lastLeading0Index+1:]
+ }
+ var rtnMax int64
+ if sign > 0 {
+ rtnMax = maxInt - 1
+ } else {
+ rtnMax = maxInt
+ }
+ digitsCount := len(digits)
+ for i := digitsCount - 1; i >= 0; i-- {
+ num += int64(digits[i]) * place
+ place *= 10
+ if digitsCount-i > 10 || num > rtnMax {
+ return int(int64(sign) * rtnMax)
+ }
+ }
+ num *= int64(sign)
+ return int(num)
+}
+```
\ No newline at end of file
diff --git a/leetcode/0009.Palindrome-Number/9. Palindrome Number.go b/leetcode/0009.Palindrome-Number/9. Palindrome Number.go
index dfc0935b3..f5c284eea 100644
--- a/leetcode/0009.Palindrome-Number/9. Palindrome Number.go
+++ b/leetcode/0009.Palindrome-Number/9. Palindrome Number.go
@@ -2,7 +2,33 @@ package leetcode
import "strconv"
+// 解法一
func isPalindrome(x int) bool {
+ if x < 0 {
+ return false
+ }
+ if x == 0 {
+ return true
+ }
+ if x%10 == 0 {
+ return false
+ }
+ arr := make([]int, 0, 32)
+ for x > 0 {
+ arr = append(arr, x%10)
+ x = x / 10
+ }
+ sz := len(arr)
+ for i, j := 0, sz-1; i <= j; i, j = i+1, j-1 {
+ if arr[i] != arr[j] {
+ return false
+ }
+ }
+ return true
+}
+
+// 解法二 数字转字符串
+func isPalindrome1(x int) bool {
if x < 0 {
return false
}
diff --git a/leetcode/0009.Palindrome-Number/README.md b/leetcode/0009.Palindrome-Number/README.md
index d01fc716d..168404fd2 100644
--- a/leetcode/0009.Palindrome-Number/README.md
+++ b/leetcode/0009.Palindrome-Number/README.md
@@ -49,7 +49,33 @@ package leetcode
import "strconv"
+// 解法一
func isPalindrome(x int) bool {
+ if x < 0 {
+ return false
+ }
+ if x == 0 {
+ return true
+ }
+ if x%10 == 0 {
+ return false
+ }
+ arr := make([]int, 0, 32)
+ for x > 0 {
+ arr = append(arr, x%10)
+ x = x / 10
+ }
+ sz := len(arr)
+ for i, j := 0, sz-1; i <= j; i, j = i+1, j-1 {
+ if arr[i] != arr[j] {
+ return false
+ }
+ }
+ return true
+}
+
+// 解法二 数字转字符串
+func isPalindrome1(x int) bool {
if x < 0 {
return false
}
@@ -66,4 +92,5 @@ func isPalindrome(x int) bool {
return true
}
+
```
\ No newline at end of file
diff --git a/leetcode/0012.Integer-to-Roman/12. Integer to Roman.go b/leetcode/0012.Integer-to-Roman/12. Integer to Roman.go
new file mode 100644
index 000000000..525e8aef1
--- /dev/null
+++ b/leetcode/0012.Integer-to-Roman/12. Integer to Roman.go
@@ -0,0 +1,15 @@
+package leetcode
+
+func intToRoman(num int) string {
+ values := []int{1000, 900, 500, 400, 100, 90, 50, 40, 10, 9, 5, 4, 1}
+ symbols := []string{"M", "CM", "D", "CD", "C", "XC", "L", "XL", "X", "IX", "V", "IV", "I"}
+ res, i := "", 0
+ for num != 0 {
+ for values[i] > num {
+ i++
+ }
+ num -= values[i]
+ res += symbols[i]
+ }
+ return res
+}
diff --git a/leetcode/0012.Integer-to-Roman/12. Integer to Roman_test.go b/leetcode/0012.Integer-to-Roman/12. Integer to Roman_test.go
new file mode 100644
index 000000000..c5fff602a
--- /dev/null
+++ b/leetcode/0012.Integer-to-Roman/12. Integer to Roman_test.go
@@ -0,0 +1,71 @@
+package leetcode
+
+import (
+ "fmt"
+ "testing"
+)
+
+type question12 struct {
+ para12
+ ans12
+}
+
+// para 是参数
+// one 代表第一个参数
+type para12 struct {
+ one int
+}
+
+// ans 是答案
+// one 代表第一个答案
+type ans12 struct {
+ one string
+}
+
+func Test_Problem12(t *testing.T) {
+
+ qs := []question12{
+
+ {
+ para12{3},
+ ans12{"III"},
+ },
+
+ {
+ para12{4},
+ ans12{"IV"},
+ },
+
+ {
+ para12{9},
+ ans12{"IX"},
+ },
+
+ {
+ para12{58},
+ ans12{"LVIII"},
+ },
+
+ {
+ para12{1994},
+ ans12{"MCMXCIV"},
+ },
+ {
+ para12{123},
+ ans12{"CXXIII"},
+ },
+
+ {
+ para12{120},
+ ans12{"CXX"},
+ },
+ }
+
+ fmt.Printf("------------------------Leetcode Problem 12------------------------\n")
+
+ for _, q := range qs {
+ _, p := q.ans12, q.para12
+ fmt.Printf("【input】:%v 【output】:%v\n", p.one, intToRoman(p.one))
+ }
+ fmt.Printf("\n\n\n")
+}
diff --git a/leetcode/0012.Integer-to-Roman/README.md b/leetcode/0012.Integer-to-Roman/README.md
new file mode 100644
index 000000000..5a2882d6a
--- /dev/null
+++ b/leetcode/0012.Integer-to-Roman/README.md
@@ -0,0 +1,102 @@
+# [12. Integer to Roman](https://leetcode.com/problems/integer-to-roman/)
+
+
+## 题目
+
+Roman numerals are represented by seven different symbols: `I`, `V`, `X`, `L`, `C`, `D` and `M`.
+
+```
+Symbol Value
+I 1
+V 5
+X 10
+L 50
+C 100
+D 500
+M 1000
+```
+
+For example, `2` is written as `II` in Roman numeral, just two one's added together. `12` is written as `XII`, which is simply `X + II`. The number `27` is written as `XXVII`, which is `XX + V + II`.
+
+Roman numerals are usually written largest to smallest from left to right. However, the numeral for four is not `IIII`. Instead, the number four is written as `IV`. Because the one is before the five we subtract it making four. The same principle applies to the number nine, which is written as `IX`. There are six instances where subtraction is used:
+
+- `I` can be placed before `V` (5) and `X` (10) to make 4 and 9.
+- `X` can be placed before `L` (50) and `C` (100) to make 40 and 90.
+- `C` can be placed before `D` (500) and `M` (1000) to make 400 and 900.
+
+Given an integer, convert it to a roman numeral.
+
+**Example 1:**
+
+```
+Input: num = 3
+Output: "III"
+```
+
+**Example 2:**
+
+```
+Input: num = 4
+Output: "IV"
+```
+
+**Example 3:**
+
+```
+Input: num = 9
+Output: "IX"
+```
+
+**Example 4:**
+
+```
+Input: num = 58
+Output: "LVIII"
+Explanation: L = 50, V = 5, III = 3.
+```
+
+**Example 5:**
+
+```
+Input: num = 1994
+Output: "MCMXCIV"
+Explanation: M = 1000, CM = 900, XC = 90 and IV = 4.
+```
+
+**Constraints:**
+
+- `1 <= num <= 3999`
+
+## 题目大意
+
+通常情况下,罗马数字中小的数字在大的数字的右边。但也存在特例,例如 4 不写做 IIII,而是 IV。数字 1 在数字 5 的左边,所表示的数等于大数 5 减小数 1 得到的数值 4 。同样地,数字 9 表示为 IX。这个特殊的规则只适用于以下六种情况:
+
+- I 可以放在 V (5) 和 X (10) 的左边,来表示 4 和 9。
+- X 可以放在 L (50) 和 C (100) 的左边,来表示 40 和 90。
+- C 可以放在 D (500) 和 M (1000) 的左边,来表示 400 和 900。
+
+给定一个整数,将其转为罗马数字。输入确保在 1 到 3999 的范围内。
+
+## 解题思路
+
+- 依照题意,优先选择大的数字,解题思路采用贪心算法。将 1-3999 范围内的罗马数字从大到小放在数组中,从头选择到尾,即可把整数转成罗马数字。
+
+## 代码
+
+```go
+package leetcode
+
+func intToRoman(num int) string {
+ values := []int{1000, 900, 500, 400, 100, 90, 50, 40, 10, 9, 5, 4, 1}
+ symbols := []string{"M", "CM", "D", "CD", "C", "XC", "L", "XL", "X", "IX", "V", "IV", "I"}
+ res, i := "", 0
+ for num != 0 {
+ for values[i] > num {
+ i++
+ }
+ num -= values[i]
+ res += symbols[i]
+ }
+ return res
+}
+```
\ No newline at end of file
diff --git a/leetcode/0014.Longest-Common-Prefix/14.Longest Common Prefix.go b/leetcode/0014.Longest-Common-Prefix/14.Longest Common Prefix.go
new file mode 100644
index 000000000..259c5c835
--- /dev/null
+++ b/leetcode/0014.Longest-Common-Prefix/14.Longest Common Prefix.go
@@ -0,0 +1,16 @@
+package leetcode
+
+func longestCommonPrefix(strs []string) string {
+ prefix := strs[0]
+
+ for i := 1; i < len(strs); i++ {
+ for j := 0; j < len(prefix); j++ {
+ if len(strs[i]) <= j || strs[i][j] != prefix[j] {
+ prefix = prefix[0:j]
+ break
+ }
+ }
+ }
+
+ return prefix
+}
diff --git a/leetcode/0014.Longest-Common-Prefix/14.Longest Common Prefix_test.go b/leetcode/0014.Longest-Common-Prefix/14.Longest Common Prefix_test.go
new file mode 100644
index 000000000..e7635d52f
--- /dev/null
+++ b/leetcode/0014.Longest-Common-Prefix/14.Longest Common Prefix_test.go
@@ -0,0 +1,50 @@
+package leetcode
+
+import (
+ "fmt"
+ "testing"
+)
+
+type question14 struct {
+ para14
+ ans14
+}
+
+// para 是参数
+type para14 struct {
+ strs []string
+}
+
+// ans 是答案
+type ans14 struct {
+ ans string
+}
+
+func Test_Problem14(t *testing.T) {
+
+ qs := []question14{
+
+ {
+ para14{[]string{"flower", "flow", "flight"}},
+ ans14{"fl"},
+ },
+
+ {
+ para14{[]string{"dog", "racecar", "car"}},
+ ans14{""},
+ },
+
+ {
+ para14{[]string{"ab", "a"}},
+ ans14{"a"},
+ },
+ }
+
+ fmt.Printf("------------------------Leetcode Problem 14------------------------\n")
+
+ for _, q := range qs {
+ _, p := q.ans14, q.para14
+ fmt.Printf("【input】:%v 【output】:%v\n", p.strs, longestCommonPrefix(p.strs))
+ }
+ fmt.Printf("\n\n\n")
+}
diff --git a/leetcode/0014.Longest-Common-Prefix/README.md b/leetcode/0014.Longest-Common-Prefix/README.md
new file mode 100644
index 000000000..26b9e03bf
--- /dev/null
+++ b/leetcode/0014.Longest-Common-Prefix/README.md
@@ -0,0 +1,57 @@
+# [14. Longest Common Prefix](https://leetcode.com/problems/longest-common-prefix/)
+
+## 题目
+
+Write a function to find the longest common prefix string amongst an array of strings.
+
+If there is no common prefix, return an empty string "".
+
+**Example 1**:
+
+ Input: strs = ["flower","flow","flight"]
+ Output: "fl"
+
+**Example 2**:
+
+ Input: strs = ["dog","racecar","car"]
+ Output: ""
+ Explanation: There is no common prefix among the input strings.
+
+**Constraints:**
+
+- 1 <= strs.length <= 200
+- 0 <= strs[i].length <= 200
+- strs[i] consists of only lower-case English letters.
+
+## 题目大意
+
+编写一个函数来查找字符串数组中的最长公共前缀。
+
+如果不存在公共前缀,返回空字符串 ""。
+
+## 解题思路
+
+- 对 strs 按照字符串长度进行升序排序,求出 strs 中长度最小字符串的长度 minLen
+- 逐个比较长度最小字符串与其它字符串中的字符,如果不相等就返回 commonPrefix,否则就把该字符加入 commonPrefix
+
+## 代码
+
+```go
+
+package leetcode
+
+func longestCommonPrefix(strs []string) string {
+ prefix := strs[0]
+
+ for i := 1; i < len(strs); i++ {
+ for j := 0; j < len(prefix); j++ {
+ if len(strs[i]) <= j || strs[i][j] != prefix[j] {
+ prefix = prefix[0:j]
+ break
+ }
+ }
+ }
+
+ return prefix
+}
+```
diff --git a/leetcode/0015.3Sum/15. 3Sum.go b/leetcode/0015.3Sum/15. 3Sum.go
index ea643c8c6..a8be09e8e 100644
--- a/leetcode/0015.3Sum/15. 3Sum.go
+++ b/leetcode/0015.3Sum/15. 3Sum.go
@@ -4,7 +4,41 @@ import (
"sort"
)
+// 解法一 最优解,双指针 + 排序
func threeSum(nums []int) [][]int {
+ sort.Ints(nums)
+ result, start, end, index, addNum, length := make([][]int, 0), 0, 0, 0, 0, len(nums)
+ for index = 1; index < length-1; index++ {
+ start, end = 0, length-1
+ if index > 1 && nums[index] == nums[index-1] {
+ start = index - 1
+ }
+ for start < index && end > index {
+ if start > 0 && nums[start] == nums[start-1] {
+ start++
+ continue
+ }
+ if end < length-1 && nums[end] == nums[end+1] {
+ end--
+ continue
+ }
+ addNum = nums[start] + nums[end] + nums[index]
+ if addNum == 0 {
+ result = append(result, []int{nums[start], nums[index], nums[end]})
+ start++
+ end--
+ } else if addNum > 0 {
+ end--
+ } else {
+ start++
+ }
+ }
+ }
+ return result
+}
+
+// 解法二
+func threeSum1(nums []int) [][]int {
res := [][]int{}
counter := map[int]int{}
for _, value := range nums {
diff --git a/leetcode/0016.3Sum-Closest/16. 3Sum Closest.go b/leetcode/0016.3Sum-Closest/16. 3Sum Closest.go
index 0beaac707..ed4465d17 100644
--- a/leetcode/0016.3Sum-Closest/16. 3Sum Closest.go
+++ b/leetcode/0016.3Sum-Closest/16. 3Sum Closest.go
@@ -11,6 +11,9 @@ func threeSumClosest(nums []int, target int) int {
if n > 2 {
sort.Ints(nums)
for i := 0; i < n-2; i++ {
+ if i > 0 && nums[i] == nums[i-1] {
+ continue
+ }
for j, k := i+1, n-1; j < k; {
sum := nums[i] + nums[j] + nums[k]
if abs(sum-target) < diff {
diff --git a/leetcode/0018.4Sum/18. 4Sum.go b/leetcode/0018.4Sum/18. 4Sum.go
index 38f8da3d5..be44e5c7f 100644
--- a/leetcode/0018.4Sum/18. 4Sum.go
+++ b/leetcode/0018.4Sum/18. 4Sum.go
@@ -2,7 +2,92 @@ package leetcode
import "sort"
-func fourSum(nums []int, target int) [][]int {
+// 解法一 双指针
+func fourSum(nums []int, target int) (quadruplets [][]int) {
+ sort.Ints(nums)
+ n := len(nums)
+ for i := 0; i < n-3 && nums[i]+nums[i+1]+nums[i+2]+nums[i+3] <= target; i++ {
+ if i > 0 && nums[i] == nums[i-1] || nums[i]+nums[n-3]+nums[n-2]+nums[n-1] < target {
+ continue
+ }
+ for j := i + 1; j < n-2 && nums[i]+nums[j]+nums[j+1]+nums[j+2] <= target; j++ {
+ if j > i+1 && nums[j] == nums[j-1] || nums[i]+nums[j]+nums[n-2]+nums[n-1] < target {
+ continue
+ }
+ for left, right := j+1, n-1; left < right; {
+ if sum := nums[i] + nums[j] + nums[left] + nums[right]; sum == target {
+ quadruplets = append(quadruplets, []int{nums[i], nums[j], nums[left], nums[right]})
+ for left++; left < right && nums[left] == nums[left-1]; left++ {
+ }
+ for right--; left < right && nums[right] == nums[right+1]; right-- {
+ }
+ } else if sum < target {
+ left++
+ } else {
+ right--
+ }
+ }
+ }
+ }
+ return
+}
+
+// 解法二 kSum
+func fourSum1(nums []int, target int) [][]int {
+ res, cur := make([][]int, 0), make([]int, 0)
+ sort.Ints(nums)
+ kSum(nums, 0, len(nums)-1, target, 4, cur, &res)
+ return res
+}
+
+func kSum(nums []int, left, right int, target int, k int, cur []int, res *[][]int) {
+ if right-left+1 < k || k < 2 || target < nums[left]*k || target > nums[right]*k {
+ return
+ }
+ if k == 2 {
+ // 2 sum
+ twoSum(nums, left, right, target, cur, res)
+ } else {
+ for i := left; i < len(nums); i++ {
+ if i == left || (i > left && nums[i-1] != nums[i]) {
+ next := make([]int, len(cur))
+ copy(next, cur)
+ next = append(next, nums[i])
+ kSum(nums, i+1, len(nums)-1, target-nums[i], k-1, next, res)
+ }
+ }
+ }
+
+}
+
+func twoSum(nums []int, left, right int, target int, cur []int, res *[][]int) {
+ for left < right {
+ sum := nums[left] + nums[right]
+ if sum == target {
+ cur = append(cur, nums[left], nums[right])
+ temp := make([]int, len(cur))
+ copy(temp, cur)
+ *res = append(*res, temp)
+ // reset cur to previous state
+ cur = cur[:len(cur)-2]
+ left++
+ right--
+ for left < right && nums[left] == nums[left-1] {
+ left++
+ }
+ for left < right && nums[right] == nums[right+1] {
+ right--
+ }
+ } else if sum < target {
+ left++
+ } else {
+ right--
+ }
+ }
+}
+
+// 解法三
+func fourSum2(nums []int, target int) [][]int {
res := [][]int{}
counter := map[int]int{}
for _, value := range nums {
diff --git a/leetcode/0019.Remove-Nth-Node-From-End-of-List/19. Remove Nth Node From End of List.go b/leetcode/0019.Remove-Nth-Node-From-End-of-List/19. Remove Nth Node From End of List.go
index a4d4d18f9..7c2855bbb 100644
--- a/leetcode/0019.Remove-Nth-Node-From-End-of-List/19. Remove Nth Node From End of List.go
+++ b/leetcode/0019.Remove-Nth-Node-From-End-of-List/19. Remove Nth Node From End of List.go
@@ -17,22 +17,18 @@ type ListNode = structures.ListNode
// 解法一
func removeNthFromEnd(head *ListNode, n int) *ListNode {
- var fast, slow *ListNode
- fast = head
- slow = head
- for i := 0; i < n; i++ {
- fast = fast.Next
- }
- if fast == nil {
- head = head.Next
- return head
- }
- for fast.Next != nil {
+ dummyHead := &ListNode{Next: head}
+ preSlow, slow, fast := dummyHead, head, head
+ for fast != nil {
+ if n <= 0 {
+ preSlow = slow
+ slow = slow.Next
+ }
+ n--
fast = fast.Next
- slow = slow.Next
}
- slow.Next = slow.Next.Next
- return head
+ preSlow.Next = slow.Next
+ return dummyHead.Next
}
// 解法二
diff --git a/leetcode/0019.Remove-Nth-Node-From-End-of-List/19. Remove Nth Node From End of List_test.go b/leetcode/0019.Remove-Nth-Node-From-End-of-List/19. Remove Nth Node From End of List_test.go
index e7be4810f..f112b55d3 100644
--- a/leetcode/0019.Remove-Nth-Node-From-End-of-List/19. Remove Nth Node From End of List_test.go
+++ b/leetcode/0019.Remove-Nth-Node-From-End-of-List/19. Remove Nth Node From End of List_test.go
@@ -29,6 +29,26 @@ func Test_Problem19(t *testing.T) {
qs := []question19{
+ {
+ para19{[]int{1}, 3},
+ ans19{[]int{1}},
+ },
+
+ {
+ para19{[]int{1, 2}, 2},
+ ans19{[]int{2}},
+ },
+
+ {
+ para19{[]int{1}, 1},
+ ans19{[]int{}},
+ },
+
+ {
+ para19{[]int{1, 2, 3, 4, 5}, 10},
+ ans19{[]int{1, 2, 3, 4, 5}},
+ },
+
{
para19{[]int{1, 2, 3, 4, 5}, 1},
ans19{[]int{1, 2, 3, 4}},
diff --git a/leetcode/0019.Remove-Nth-Node-From-End-of-List/README.md b/leetcode/0019.Remove-Nth-Node-From-End-of-List/README.md
index 807a6cbc1..090e74efd 100644
--- a/leetcode/0019.Remove-Nth-Node-From-End-of-List/README.md
+++ b/leetcode/0019.Remove-Nth-Node-From-End-of-List/README.md
@@ -2,16 +2,44 @@
## 题目
-Given a linked list, remove the n-th node from the end of list and return its head.
+Given the `head` of a linked list, remove the `nth` node from the end of the list and return its head.
-Example:
+**Follow up:** Could you do this in one pass?
+
+**Example 1:**
+
+
+
+```
+Input: head = [1,2,3,4,5], n = 2
+Output: [1,2,3,5]
```
-Given linked list: 1->2->3->4->5, and n = 2.
-After removing the second node from the end, the linked list becomes 1->2->3->5.
+**Example 2:**
+
+```
+Input: head = [1], n = 1
+Output: []
+
```
+**Example 3:**
+
+```
+Input: head = [1,2], n = 1
+Output: [1]
+
+```
+
+**Constraints:**
+
+- The number of nodes in the list is `sz`.
+- `1 <= sz <= 30`
+- `0 <= Node.val <= 100`
+- `1 <= n <= sz`
+
+
## 题目大意
删除链表中倒数第 n 个结点。
diff --git a/leetcode/0024.Swap-Nodes-in-Pairs/24. Swap Nodes in Pairs.go b/leetcode/0024.Swap-Nodes-in-Pairs/24. Swap Nodes in Pairs.go
index 1dc9e41de..ac1e7e09f 100644
--- a/leetcode/0024.Swap-Nodes-in-Pairs/24. Swap Nodes in Pairs.go
+++ b/leetcode/0024.Swap-Nodes-in-Pairs/24. Swap Nodes in Pairs.go
@@ -16,30 +16,9 @@ type ListNode = structures.ListNode
*/
func swapPairs(head *ListNode) *ListNode {
- if head == nil || head.Next == nil {
- return head
+ dummy := &ListNode{Next: head}
+ for pt := dummy; pt != nil && pt.Next != nil && pt.Next.Next != nil; {
+ pt, pt.Next, pt.Next.Next, pt.Next.Next.Next = pt.Next, pt.Next.Next, pt.Next.Next.Next, pt.Next
}
- s := head.Next
- var behind *ListNode
- for head.Next != nil {
- headNext := head.Next
- if behind != nil && behind.Next != nil {
- behind.Next = headNext
- }
- var next *ListNode
- if head.Next.Next != nil {
- next = head.Next.Next
- }
- if head.Next.Next != nil {
- head.Next = next
- } else {
- head.Next = nil
- }
- headNext.Next = head
- behind = head
- if head.Next != nil {
- head = next
- }
- }
- return s
+ return dummy.Next
}
diff --git a/leetcode/0027.Remove-Element/27. Remove Element.go b/leetcode/0027.Remove-Element/27. Remove Element.go
index f0233b6ad..1395d1086 100644
--- a/leetcode/0027.Remove-Element/27. Remove Element.go
+++ b/leetcode/0027.Remove-Element/27. Remove Element.go
@@ -9,10 +9,8 @@ func removeElement(nums []int, val int) int {
if nums[i] != val {
if i != j {
nums[i], nums[j] = nums[j], nums[i]
- j++
- } else {
- j++
}
+ j++
}
}
return j
diff --git a/leetcode/0028.Implement-strStr/28. Implement strStr().go b/leetcode/0028.Find-the-Index-of-the-First-Occurrence-in-a-String/28. Find the Index of the First Occurrence in a String.go
similarity index 100%
rename from leetcode/0028.Implement-strStr/28. Implement strStr().go
rename to leetcode/0028.Find-the-Index-of-the-First-Occurrence-in-a-String/28. Find the Index of the First Occurrence in a String.go
diff --git a/leetcode/0028.Implement-strStr/28. Implement strStr()_test.go b/leetcode/0028.Find-the-Index-of-the-First-Occurrence-in-a-String/28. Find the Index of the First Occurrence in a String_test.go
similarity index 100%
rename from leetcode/0028.Implement-strStr/28. Implement strStr()_test.go
rename to leetcode/0028.Find-the-Index-of-the-First-Occurrence-in-a-String/28. Find the Index of the First Occurrence in a String_test.go
diff --git a/leetcode/0028.Find-the-Index-of-the-First-Occurrence-in-a-String/README.md b/leetcode/0028.Find-the-Index-of-the-First-Occurrence-in-a-String/README.md
new file mode 100644
index 000000000..d1e643bd9
--- /dev/null
+++ b/leetcode/0028.Find-the-Index-of-the-First-Occurrence-in-a-String/README.md
@@ -0,0 +1,50 @@
+# [28. Find the Index of the First Occurrence in a String](https://leetcode.com/problems/find-the-index-of-the-first-occurrence-in-a-string/)
+
+## 题目
+
+Implement strStr().
+
+Return the index of the first occurrence of needle in haystack, or -1 if needle is not part of haystack.
+
+
+Example 1:
+
+```c
+Input: haystack = "hello", needle = "ll"
+Output: 2
+```
+
+Example 2:
+
+```c
+Input: haystack = "aaaaa", needle = "bba"
+Output: -1
+```
+
+Clarification:
+
+What should we return when needle is an empty string? This is a great question to ask during an interview.
+
+For the purpose of this problem, we will return 0 when needle is an empty string. This is consistent to C's strstr() and Java's indexOf().
+
+## 题目大意
+
+
+实现一个查找 substring 的函数。如果在母串中找到了子串,返回子串在母串中出现的下标,如果没有找到,返回 -1,如果子串是空串,则返回 0 。
+
+## 解题思路
+
+这一题比较简单,直接写即可。
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/leetcode/0028.Implement-strStr/README.md b/leetcode/0028.Implement-strStr/README.md
deleted file mode 100644
index 5fb575296..000000000
--- a/leetcode/0028.Implement-strStr/README.md
+++ /dev/null
@@ -1,50 +0,0 @@
-# [28. Implement strStr()](https://leetcode.com/problems/implement-strstr/)
-
-## 题目
-
-Implement strStr().
-
-Return the index of the first occurrence of needle in haystack, or -1 if needle is not part of haystack.
-
-
-Example 1:
-
-```c
-Input: haystack = "hello", needle = "ll"
-Output: 2
-```
-
-Example 2:
-
-```c
-Input: haystack = "aaaaa", needle = "bba"
-Output: -1
-```
-
-Clarification:
-
-What should we return when needle is an empty string? This is a great question to ask during an interview.
-
-For the purpose of this problem, we will return 0 when needle is an empty string. This is consistent to C's strstr() and Java's indexOf().
-
-## 题目大意
-
-
-实现一个查找 substring 的函数。如果在母串中找到了子串,返回子串在母串中出现的下标,如果没有找到,返回 -1,如果子串是空串,则返回 0 。
-
-## 解题思路
-
-这一题比较简单,直接写即可。
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/leetcode/0031.Next-Permutation/31. Next Permutation.go b/leetcode/0031.Next-Permutation/31. Next Permutation.go
new file mode 100644
index 000000000..04e07485e
--- /dev/null
+++ b/leetcode/0031.Next-Permutation/31. Next Permutation.go
@@ -0,0 +1,72 @@
+package leetcode
+
+// 解法一
+func nextPermutation(nums []int) {
+ i, j := 0, 0
+ for i = len(nums) - 2; i >= 0; i-- {
+ if nums[i] < nums[i+1] {
+ break
+ }
+ }
+ if i >= 0 {
+ for j = len(nums) - 1; j > i; j-- {
+ if nums[j] > nums[i] {
+ break
+ }
+ }
+ swap(&nums, i, j)
+ }
+ reverse(&nums, i+1, len(nums)-1)
+}
+
+func reverse(nums *[]int, i, j int) {
+ for i < j {
+ swap(nums, i, j)
+ i++
+ j--
+ }
+}
+
+func swap(nums *[]int, i, j int) {
+ (*nums)[i], (*nums)[j] = (*nums)[j], (*nums)[i]
+}
+
+// 解法二
+// [2,(3),6,5,4,1] -> 2,(4),6,5,(3),1 -> 2,4, 1,3,5,6
+func nextPermutation1(nums []int) {
+ var n = len(nums)
+ var pIdx = checkPermutationPossibility(nums)
+ if pIdx == -1 {
+ reverse(&nums, 0, n-1)
+ return
+ }
+
+ var rp = len(nums) - 1
+ // start from right most to leftward,find the first number which is larger than PIVOT
+ for rp > 0 {
+ if nums[rp] > nums[pIdx] {
+ swap(&nums, pIdx, rp)
+ break
+ } else {
+ rp--
+ }
+ }
+ // Finally, Reverse all elements which are right from pivot
+ reverse(&nums, pIdx+1, n-1)
+}
+
+// checkPermutationPossibility returns 1st occurrence Index where
+// value is in decreasing order(from right to left)
+// returns -1 if not found(it's already in its last permutation)
+func checkPermutationPossibility(nums []int) (idx int) {
+ // search right to left for 1st number(from right) that is not in increasing order
+ var rp = len(nums) - 1
+ for rp > 0 {
+ if nums[rp-1] < nums[rp] {
+ idx = rp - 1
+ return idx
+ }
+ rp--
+ }
+ return -1
+}
diff --git a/leetcode/0031.Next-Permutation/31. Next Permutation_test.go b/leetcode/0031.Next-Permutation/31. Next Permutation_test.go
new file mode 100644
index 000000000..f42ffab45
--- /dev/null
+++ b/leetcode/0031.Next-Permutation/31. Next Permutation_test.go
@@ -0,0 +1,58 @@
+package leetcode
+
+import (
+ "fmt"
+ "testing"
+)
+
+type question31 struct {
+ para31
+ ans31
+}
+
+// para 是参数
+// one 代表第一个参数
+type para31 struct {
+ nums []int
+}
+
+// ans 是答案
+// one 代表第一个答案
+type ans31 struct {
+ one []int
+}
+
+func Test_Problem31(t *testing.T) {
+
+ qs := []question31{
+
+ {
+ para31{[]int{1, 2, 3}},
+ ans31{[]int{1, 3, 2}},
+ },
+
+ {
+ para31{[]int{3, 2, 1}},
+ ans31{[]int{1, 2, 3}},
+ },
+
+ {
+ para31{[]int{1, 1, 5}},
+ ans31{[]int{1, 5, 1}},
+ },
+
+ {
+ para31{[]int{1}},
+ ans31{[]int{1}},
+ },
+ }
+
+ fmt.Printf("------------------------Leetcode Problem 31------------------------\n")
+ for _, q := range qs {
+ _, p := q.ans31, q.para31
+ fmt.Printf("【input】:%v ", p)
+ nextPermutation(p.nums)
+ fmt.Printf("【output】:%v\n", p.nums)
+ }
+ fmt.Printf("\n\n\n")
+}
diff --git a/leetcode/0031.Next-Permutation/README.md b/leetcode/0031.Next-Permutation/README.md
new file mode 100644
index 000000000..6ae4169a2
--- /dev/null
+++ b/leetcode/0031.Next-Permutation/README.md
@@ -0,0 +1,89 @@
+# [31. Next Permutation](https://leetcode.com/problems/next-permutation/)
+
+
+## 题目
+
+Implement **next permutation**, which rearranges numbers into the lexicographically next greater permutation of numbers.
+
+If such an arrangement is not possible, it must rearrange it as the lowest possible order (i.e., sorted in ascending order).
+
+The replacement must be **[in place](http://en.wikipedia.org/wiki/In-place_algorithm)** and use only constant extra memory.
+
+**Example 1:**
+
+```
+Input: nums = [1,2,3]
+Output: [1,3,2]
+```
+
+**Example 2:**
+
+```
+Input: nums = [3,2,1]
+Output: [1,2,3]
+```
+
+**Example 3:**
+
+```
+Input: nums = [1,1,5]
+Output: [1,5,1]
+```
+
+**Example 4:**
+
+```
+Input: nums = [1]
+Output: [1]
+```
+
+**Constraints:**
+
+- `1 <= nums.length <= 100`
+- `0 <= nums[i] <= 100`
+
+## 题目大意
+
+实现获取 下一个排列 的函数,算法需要将给定数字序列重新排列成字典序中下一个更大的排列。如果不存在下一个更大的排列,则将数字重新排列成最小的排列(即升序排列)。必须 原地 修改,只允许使用额外常数空间。
+
+## 解题思路
+
+- 题目有 3 个问题需要解决。如何找到下一个排列。不存在下一个排列的时候如何生成最小的排列。如何原地修改。先解决第一个问题,如何找到下一个排列。下一个排列是找到一个大于当前排序的字典序,且变大的幅度最小。那么只能将较小的数与较大数做一次原地交换。并且较小数的下标要尽量靠右,较大数也要尽可能小。原地交换以后,还需要将较大数右边的数按照升序重新排列。这样交换以后,才能生成下一个排列。以排列 [8,9,6,10,7,2] 为例:能找到的符合条件的一对「较小数」与「较大数」的组合为 6 与 7,满足「较小数」尽量靠右,而「较大数」尽可能小。当完成交换后排列变为 [8,9,7,10,6,2],此时我们可以重排「较小数」右边的序列,序列变为 [8,9,7,2,6,10]。
+- 第一步:在 `nums[i]` 中找到 `i` 使得 `nums[i] < nums[i+1]`,此时较小数为 `nums[i]`,并且 `[i+1, n)` 一定为下降区间。第二步:如果找到了这样的 `i` ,则在下降区间 `[i+1, n)` 中从后往前找到第一个 `j` ,使得 `nums[i] < nums[j]` ,此时较大数为 `nums[j]`。第三步,交换 `nums[i]` 和 `nums[j]`,此时区间 `[i+1, n)` 一定为降序区间。最后原地交换 `[i+1, n)` 区间内的元素,使其变为升序,无需对该区间进行排序。
+- 如果第一步找不到符合条件的下标 `i`,说明当前序列已经是一个最大的排列。那么应该直接执行第三步,生成最小的排列。
+
+## 代码
+
+```go
+package leetcode
+
+func nextPermutation(nums []int) {
+ i, j := 0, 0
+ for i = len(nums) - 2; i >= 0; i-- {
+ if nums[i] < nums[i+1] {
+ break
+ }
+ }
+ if i >= 0 {
+ for j = len(nums) - 1; j > i; j-- {
+ if nums[j] > nums[i] {
+ break
+ }
+ }
+ swap(&nums, i, j)
+ }
+ reverse(&nums, i+1, len(nums)-1)
+}
+
+func reverse(nums *[]int, i, j int) {
+ for i < j {
+ swap(nums, i, j)
+ i++
+ j--
+ }
+}
+
+func swap(nums *[]int, i, j int) {
+ (*nums)[i], (*nums)[j] = (*nums)[j], (*nums)[i]
+}
+```
\ No newline at end of file
diff --git a/leetcode/0032.Longest-Valid-Parentheses/32. Longest Valid Parentheses.go b/leetcode/0032.Longest-Valid-Parentheses/32. Longest Valid Parentheses.go
new file mode 100644
index 000000000..ae59da5ed
--- /dev/null
+++ b/leetcode/0032.Longest-Valid-Parentheses/32. Longest Valid Parentheses.go
@@ -0,0 +1,58 @@
+package leetcode
+
+// 解法一 栈
+func longestValidParentheses(s string) int {
+ stack, res := []int{}, 0
+ stack = append(stack, -1)
+ for i := 0; i < len(s); i++ {
+ if s[i] == '(' {
+ stack = append(stack, i)
+ } else {
+ stack = stack[:len(stack)-1]
+ if len(stack) == 0 {
+ stack = append(stack, i)
+ } else {
+ res = max(res, i-stack[len(stack)-1])
+ }
+ }
+ }
+ return res
+}
+
+func max(a, b int) int {
+ if a > b {
+ return a
+ }
+ return b
+}
+
+// 解法二 双指针
+func longestValidParentheses1(s string) int {
+ left, right, maxLength := 0, 0, 0
+ for i := 0; i < len(s); i++ {
+ if s[i] == '(' {
+ left++
+ } else {
+ right++
+ }
+ if left == right {
+ maxLength = max(maxLength, 2*right)
+ } else if right > left {
+ left, right = 0, 0
+ }
+ }
+ left, right = 0, 0
+ for i := len(s) - 1; i >= 0; i-- {
+ if s[i] == '(' {
+ left++
+ } else {
+ right++
+ }
+ if left == right {
+ maxLength = max(maxLength, 2*left)
+ } else if left > right {
+ left, right = 0, 0
+ }
+ }
+ return maxLength
+}
diff --git a/leetcode/0032.Longest-Valid-Parentheses/32. Longest Valid Parentheses_test.go b/leetcode/0032.Longest-Valid-Parentheses/32. Longest Valid Parentheses_test.go
new file mode 100644
index 000000000..4bdf8de2b
--- /dev/null
+++ b/leetcode/0032.Longest-Valid-Parentheses/32. Longest Valid Parentheses_test.go
@@ -0,0 +1,61 @@
+package leetcode
+
+import (
+ "fmt"
+ "testing"
+)
+
+type question32 struct {
+ para32
+ ans32
+}
+
+// para 是参数
+// one 代表第一个参数
+type para32 struct {
+ s string
+}
+
+// ans 是答案
+// one 代表第一个答案
+type ans32 struct {
+ one int
+}
+
+func Test_Problem32(t *testing.T) {
+
+ qs := []question32{
+
+ {
+ para32{"(()"},
+ ans32{2},
+ },
+
+ {
+ para32{")()())"},
+ ans32{4},
+ },
+
+ {
+ para32{"()(())"},
+ ans32{6},
+ },
+
+ {
+ para32{"()(())))"},
+ ans32{6},
+ },
+
+ {
+ para32{"()(()"},
+ ans32{2},
+ },
+ }
+
+ fmt.Printf("------------------------Leetcode Problem 32------------------------\n")
+ for _, q := range qs {
+ _, p := q.ans32, q.para32
+ fmt.Printf("【input】:%v 【output】:%v\n", p, longestValidParentheses(p.s))
+ }
+ fmt.Printf("\n\n\n")
+}
diff --git a/leetcode/0032.Longest-Valid-Parentheses/README.md b/leetcode/0032.Longest-Valid-Parentheses/README.md
new file mode 100644
index 000000000..50f6ec116
--- /dev/null
+++ b/leetcode/0032.Longest-Valid-Parentheses/README.md
@@ -0,0 +1,108 @@
+# [32. Longest Valid Parentheses](https://leetcode.com/problems/longest-valid-parentheses/)
+
+
+## 题目
+
+Given a string containing just the characters `'('` and `')'`, find the length of the longest valid (well-formed) parentheses substring.
+
+**Example 1:**
+
+```
+Input: s = "(()"
+Output: 2
+Explanation: The longest valid parentheses substring is "()".
+```
+
+**Example 2:**
+
+```
+Input: s = ")()())"
+Output: 4
+Explanation: The longest valid parentheses substring is "()()".
+```
+
+**Example 3:**
+
+```
+Input: s = ""
+Output: 0
+```
+
+**Constraints:**
+
+- `0 <= s.length <= 3 * 104`
+- `s[i]` is `'('`, or `')'`.
+
+## 题目大意
+
+给你一个只包含 '(' 和 ')' 的字符串,找出最长有效(格式正确且连续)括号子串的长度。
+
+## 解题思路
+
+- 提到括号匹配,第一时间能让人想到的就是利用栈。这里需要计算嵌套括号的总长度,所以栈里面不能单纯的存左括号,而应该存左括号在原字符串的下标,这样通过下标相减可以获取长度。那么栈如果是非空,栈底永远存的是当前遍历过的字符串中**上一个没有被匹配的右括号的下标**。**上一个没有被匹配的右括号的下标**可以理解为每段括号匹配之间的“隔板”。例如,`())((()))`,第三个右括号,即为左右 2 段正确的括号匹配中间的“隔板”。“隔板”的存在影响计算最长括号长度。如果不存在“隔板”,前后 2 段正确的括号匹配应该“融合”在一起,最长长度为 `2 + 6 = 8`,但是这里存在了“隔板”,所以最长长度仅为 `6`。
+- 具体算法实现,遇到每个 `'('` ,将它的下标压入栈中。对于遇到的每个 `')'`,先弹出栈顶元素表示匹配了当前右括号。如果栈为空,说明当前的右括号为没有被匹配的右括号,于是将其下标放入栈中来更新**上一个没有被匹配的右括号的下标**。如果栈不为空,当前右括号的下标减去栈顶元素即为以该右括号为结尾的最长有效括号的长度。需要注意初始化时,不存在**上一个没有被匹配的右括号的下标**,那么将 `-1` 放入栈中,充当下标为 `0` 的“隔板”。时间复杂度 O(n),空间复杂度 O(n)。
+- 在栈的方法中,实际用到的元素仅仅是栈底的**上一个没有被匹配的右括号的下标**。那么考虑能否把这个值存在一个变量中,这样可以省去栈 O(n) 的时间复杂度。利用两个计数器 left 和 right 。首先,从左到右遍历字符串,每当遇到 `'('`,增加 left 计数器,每当遇到 `')'` ,增加 right 计数器。每当 left 计数器与 right 计数器相等时,计算当前有效字符串的长度,并且记录目前为止找到的最长子字符串。当 right 计数器比 left 计数器大时,说明括号不匹配,于是将 left 和 right 计数器同时变回 0。这样的做法利用了贪心的思想,考虑了以当前字符下标结尾的有效括号长度,每次当右括号数量多于左括号数量的时候之前的字符就扔掉不再考虑,重新从下一个字符开始计算。
+- 但上面的做法会漏掉一种情况,就是遍历的时候左括号的数量始终大于右括号的数量,即 `(()` ,这种时候最长有效括号是求不出来的。解决办法是反向再计算一遍,如果从右往左计算,`(()` 先计算匹配的括号,最后只剩下 `'('`,这样依旧可以算出最长匹配的括号长度。反过来计算的方法和上述从左往右计算的方法一致:当 left 计数器比 right 计数器大时,将 left 和 right 计数器同时变回 0;当 left 计数器与 right 计数器相等时,计算当前有效字符串的长度,并且记录目前为止找到的最长子字符串。这种方法的时间复杂度是 O(n),空间复杂度 O(1)。
+
+## 代码
+
+```go
+package leetcode
+
+// 解法一 栈
+func longestValidParentheses(s string) int {
+ stack, res := []int{}, 0
+ stack = append(stack, -1)
+ for i := 0; i < len(s); i++ {
+ if s[i] == '(' {
+ stack = append(stack, i)
+ } else {
+ stack = stack[:len(stack)-1]
+ if len(stack) == 0 {
+ stack = append(stack, i)
+ } else {
+ res = max(res, i-stack[len(stack)-1])
+ }
+ }
+ }
+ return res
+}
+
+func max(a, b int) int {
+ if a > b {
+ return a
+ }
+ return b
+}
+
+// 解法二 双指针
+func longestValidParentheses1(s string) int {
+ left, right, maxLength := 0, 0, 0
+ for i := 0; i < len(s); i++ {
+ if s[i] == '(' {
+ left++
+ } else {
+ right++
+ }
+ if left == right {
+ maxLength = max(maxLength, 2*right)
+ } else if right > left {
+ left, right = 0, 0
+ }
+ }
+ left, right = 0, 0
+ for i := len(s) - 1; i >= 0; i-- {
+ if s[i] == '(' {
+ left++
+ } else {
+ right++
+ }
+ if left == right {
+ maxLength = max(maxLength, 2*left)
+ } else if left > right {
+ left, right = 0, 0
+ }
+ }
+ return maxLength
+}
+```
\ No newline at end of file
diff --git a/leetcode/0040.Combination-Sum-II/README.md b/leetcode/0040.Combination-Sum-II/README.md
index 5375739bb..b53f67dcd 100755
--- a/leetcode/0040.Combination-Sum-II/README.md
+++ b/leetcode/0040.Combination-Sum-II/README.md
@@ -45,4 +45,4 @@ candidates 中的每个数字在每个组合中只能使用一次。
## 解题思路
- 题目要求出总和为 sum 的所有组合,组合需要去重。这一题是第 39 题的加强版,第 39 题中元素可以重复利用(重复元素可无限次使用),这一题中元素只能有限次数的利用,因为存在重复元素,并且每个元素只能用一次(重复元素只能使用有限次)
-- 这一题和第 47 题类似,只不过元素可以反复使用。
+- 这一题和第 47 题类似。
diff --git a/leetcode/0042.Trapping-Rain-Water/README.md b/leetcode/0042.Trapping-Rain-Water/README.md
index 4b8fbf871..9bafaa2d2 100644
--- a/leetcode/0042.Trapping-Rain-Water/README.md
+++ b/leetcode/0042.Trapping-Rain-Water/README.md
@@ -10,9 +10,9 @@ Given n non-negative integers representing an elevation map where the width of e
The above elevation map is represented by array [0,1,0,2,1,0,1,3,2,1,2,1]. In this case, 6 units of rain water (blue section) are being trapped. Thanks Marcos for contributing this image!
-Example:
+**Example**:
-```c
+```go
Input: [0,1,0,2,1,0,1,3,2,1,2,1]
Output: 6
```
@@ -23,7 +23,9 @@ Output: 6
## 解题思路
-
-
-
-每个数组里面的元素值可以想象成一个左右都有壁的圆柱筒。例如上图中左边的第二个元素 1,当前左边最大的元素是 2 ,所以 2 高度的水会装到 1 的上面(因为想象成了左右都有筒壁)。这道题的思路就是左指针从 0 开始往右扫,右指针从最右边开始往左扫。额外还需要 2 个变量分别记住左边最大的高度和右边最大高度。遍历扫数组元素的过程中,如果左指针的高度比右指针的高度小,就不断的移动左指针,否则移动右指针。循环的终止条件就是左右指针碰上以后就结束。只要数组中元素的高度比保存的局部最大高度小,就累加 res 的值,否则更新局部最大高度。最终解就是 res 的值。
\ No newline at end of file
+- 每个数组里面的元素值可以想象成一个左右都有壁的圆柱筒。例如下图中左边的第二个元素 1,当前左边最大的元素是 2 ,所以 2 高度的水会装到 1 的上面(因为想象成了左右都有筒壁)。这道题的思路就是左指针从 0 开始往右扫,右指针从最右边开始往左扫。额外还需要 2 个变量分别记住左边最大的高度和右边最大高度。遍历扫数组元素的过程中,如果左指针的高度比右指针的高度小,就不断的移动左指针,否则移动右指针。循环的终止条件就是左右指针碰上以后就结束。只要数组中元素的高度比保存的局部最大高度小,就累加 res 的值,否则更新局部最大高度。最终解就是 res 的值。
+ 
+- 抽象一下,本题是想求针对每个 i,找到它左边最大值 leftMax,右边的最大值 rightMax,然后 min(leftMax,rightMax) 为能够接到水的高度。left 和 right 指针是两边往中间移动的游标指针。最傻的解题思路是针对每个下标 i,往左循环找到第一个最大值,往右循环找到第一个最大值,然后把这两个最大值取出最小者,即为当前雨水的高度。这样做时间复杂度高,浪费了很多循环。i 在从左往右的过程中,是可以动态维护最大值的。右边的最大值用右边的游标指针来维护。从左往右扫一遍下标,和,从两边往中间遍历一遍下标,是相同的结果,每个下标都遍历了一次。
+ 
+- 每个 i 的宽度固定为 1,所以每个“坑”只需要求出高度,即当前这个“坑”能积攒的雨水。最后依次将每个“坑”中的雨水相加即是能接到的雨水数。
+ 
\ No newline at end of file
diff --git a/leetcode/0043.Multiply-Strings/43. Multiply Strings.go b/leetcode/0043.Multiply-Strings/43. Multiply Strings.go
new file mode 100644
index 000000000..88ab4b4c7
--- /dev/null
+++ b/leetcode/0043.Multiply-Strings/43. Multiply Strings.go
@@ -0,0 +1,25 @@
+package leetcode
+
+func multiply(num1 string, num2 string) string {
+ if num1 == "0" || num2 == "0" {
+ return "0"
+ }
+ b1, b2, tmp := []byte(num1), []byte(num2), make([]int, len(num1)+len(num2))
+ for i := 0; i < len(b1); i++ {
+ for j := 0; j < len(b2); j++ {
+ tmp[i+j+1] += int(b1[i]-'0') * int(b2[j]-'0')
+ }
+ }
+ for i := len(tmp) - 1; i > 0; i-- {
+ tmp[i-1] += tmp[i] / 10
+ tmp[i] = tmp[i] % 10
+ }
+ if tmp[0] == 0 {
+ tmp = tmp[1:]
+ }
+ res := make([]byte, len(tmp))
+ for i := 0; i < len(tmp); i++ {
+ res[i] = '0' + byte(tmp[i])
+ }
+ return string(res)
+}
diff --git a/leetcode/0043.Multiply-Strings/43. Multiply Strings_test.go b/leetcode/0043.Multiply-Strings/43. Multiply Strings_test.go
new file mode 100644
index 000000000..6017786e0
--- /dev/null
+++ b/leetcode/0043.Multiply-Strings/43. Multiply Strings_test.go
@@ -0,0 +1,48 @@
+package leetcode
+
+import (
+ "fmt"
+ "testing"
+)
+
+type question43 struct {
+ para43
+ ans43
+}
+
+// para 是参数
+// one 代表第一个参数
+type para43 struct {
+ num1 string
+ num2 string
+}
+
+// ans 是答案
+// one 代表第一个答案
+type ans43 struct {
+ one string
+}
+
+func Test_Problem43(t *testing.T) {
+
+ qs := []question43{
+
+ {
+ para43{"2", "3"},
+ ans43{"6"},
+ },
+
+ {
+ para43{"123", "456"},
+ ans43{"56088"},
+ },
+ }
+
+ fmt.Printf("------------------------Leetcode Problem 43------------------------\n")
+
+ for _, q := range qs {
+ _, p := q.ans43, q.para43
+ fmt.Printf("【input】:%v 【output】:%v\n", p, multiply(p.num1, p.num2))
+ }
+ fmt.Printf("\n\n\n")
+}
diff --git a/leetcode/0043.Multiply-Strings/README.md b/leetcode/0043.Multiply-Strings/README.md
new file mode 100644
index 000000000..46410bd38
--- /dev/null
+++ b/leetcode/0043.Multiply-Strings/README.md
@@ -0,0 +1,66 @@
+# [43. Multiply Strings](https://leetcode.com/problems/multiply-strings/)
+
+
+## 题目
+
+Given two non-negative integers `num1` and `num2` represented as strings, return the product of `num1` and `num2`, also represented as a string.
+
+**Note:** You must not use any built-in BigInteger library or convert the inputs to integer directly.
+
+**Example 1:**
+
+```
+Input: num1 = "2", num2 = "3"
+Output: "6"
+```
+
+**Example 2:**
+
+```
+Input: num1 = "123", num2 = "456"
+Output: "56088"
+```
+
+**Constraints:**
+
+- `1 <= num1.length, num2.length <= 200`
+- `num1` and `num2` consist of digits only.
+- Both `num1` and `num2` do not contain any leading zero, except the number `0` itself.
+
+## 题目大意
+
+给定两个以字符串形式表示的非负整数 num1 和 num2,返回 num1 和 num2 的乘积,它们的乘积也表示为字符串形式。
+
+## 解题思路
+
+- 用数组模拟乘法。创建一个数组长度为 `len(num1) + len(num2)` 的数组用于存储乘积。对于任意 `0 ≤ i < len(num1)`,`0 ≤ j < len(num2)`,`num1[i] * num2[j]` 的结果位于 `tmp[i+j+1]`,如果 `tmp[i+j+1]≥10`,则将进位部分加到 `tmp[i+j]`。最后,将数组 `tmp` 转成字符串,如果最高位是 0 则舍弃最高位。
+
+## 代码
+
+```go
+package leetcode
+
+func multiply(num1 string, num2 string) string {
+ if num1 == "0" || num2 == "0" {
+ return "0"
+ }
+ b1, b2, tmp := []byte(num1), []byte(num2), make([]int, len(num1)+len(num2))
+ for i := 0; i < len(b1); i++ {
+ for j := 0; j < len(b2); j++ {
+ tmp[i+j+1] += int(b1[i]-'0') * int(b2[j]-'0')
+ }
+ }
+ for i := len(tmp) - 1; i > 0; i-- {
+ tmp[i-1] += tmp[i] / 10
+ tmp[i] = tmp[i] % 10
+ }
+ if tmp[0] == 0 {
+ tmp = tmp[1:]
+ }
+ res := make([]byte, len(tmp))
+ for i := 0; i < len(tmp); i++ {
+ res[i] = '0' + byte(tmp[i])
+ }
+ return string(res)
+}
+```
\ No newline at end of file
diff --git a/leetcode/0045.Jump-Game-II/45. Jump Game II.go b/leetcode/0045.Jump-Game-II/45. Jump Game II.go
new file mode 100644
index 000000000..2707e5dbd
--- /dev/null
+++ b/leetcode/0045.Jump-Game-II/45. Jump Game II.go
@@ -0,0 +1,21 @@
+package leetcode
+
+func jump(nums []int) int {
+ if len(nums) == 1 {
+ return 0
+ }
+ needChoose, canReach, step := 0, 0, 0
+ for i, x := range nums {
+ if i+x > canReach {
+ canReach = i + x
+ if canReach >= len(nums)-1 {
+ return step + 1
+ }
+ }
+ if i == needChoose {
+ needChoose = canReach
+ step++
+ }
+ }
+ return step
+}
diff --git a/leetcode/0045.Jump-Game-II/45. Jump Game II_test.go b/leetcode/0045.Jump-Game-II/45. Jump Game II_test.go
new file mode 100644
index 000000000..0e58e91ae
--- /dev/null
+++ b/leetcode/0045.Jump-Game-II/45. Jump Game II_test.go
@@ -0,0 +1,47 @@
+package leetcode
+
+import (
+ "fmt"
+ "testing"
+)
+
+type question45 struct {
+ para45
+ ans45
+}
+
+// para 是参数
+// one 代表第一个参数
+type para45 struct {
+ nums []int
+}
+
+// ans 是答案
+// one 代表第一个答案
+type ans45 struct {
+ one int
+}
+
+func Test_Problem45(t *testing.T) {
+
+ qs := []question45{
+
+ {
+ para45{[]int{2, 3, 1, 1, 4}},
+ ans45{2},
+ },
+
+ {
+ para45{[]int{2, 3, 0, 1, 4}},
+ ans45{2},
+ },
+ }
+
+ fmt.Printf("------------------------Leetcode Problem 45------------------------\n")
+
+ for _, q := range qs {
+ _, p := q.ans45, q.para45
+ fmt.Printf("【input】:%v 【output】:%v\n", p, jump(p.nums))
+ }
+ fmt.Printf("\n\n\n")
+}
diff --git a/leetcode/0045.Jump-Game-II/README.md b/leetcode/0045.Jump-Game-II/README.md
new file mode 100644
index 000000000..e5394aa22
--- /dev/null
+++ b/leetcode/0045.Jump-Game-II/README.md
@@ -0,0 +1,67 @@
+# [45. Jump Game II](https://leetcode.com/problems/jump-game-ii/)
+
+
+## 题目
+
+Given an array of non-negative integers `nums`, you are initially positioned at the first index of the array.
+
+Each element in the array represents your maximum jump length at that position.
+
+Your goal is to reach the last index in the minimum number of jumps.
+
+You can assume that you can always reach the last index.
+
+**Example 1:**
+
+```
+Input: nums = [2,3,1,1,4]
+Output: 2
+Explanation: The minimum number of jumps to reach the last index is 2. Jump 1 step from index 0 to 1, then 3 steps to the last index.
+```
+
+**Example 2:**
+
+```
+Input: nums = [2,3,0,1,4]
+Output: 2
+```
+
+**Constraints:**
+
+- `1 <= nums.length <= 1000`
+- `0 <= nums[i] <= 10^5`
+
+## 题目大意
+
+给定一个非负整数数组,你最初位于数组的第一个位置。数组中的每个元素代表你在该位置可以跳跃的最大长度。你的目标是使用最少的跳跃次数到达数组的最后一个位置。
+
+## 解题思路
+
+- 要求找到最少跳跃次数,顺理成章的会想到用贪心算法解题。扫描步数数组,维护当前能够到达最大下标的位置,记为能到达的最远边界,如果扫描过程中到达了最远边界,更新边界并将跳跃次数 + 1。
+- 扫描数组的时候,其实不需要扫描最后一个元素,因为在跳到最后一个元素之前,能到达的最远边界一定大于等于最后一个元素的位置,不然就跳不到最后一个元素,到达不了终点了;如果遍历到最后一个元素,说明边界正好为最后一个位置,最终跳跃次数直接 + 1 即可,也不需要访问最后一个元素。
+
+## 代码
+
+```go
+package leetcode
+
+func jump(nums []int) int {
+ if len(nums) == 1 {
+ return 0
+ }
+ needChoose, canReach, step := 0, 0, 0
+ for i, x := range nums {
+ if i+x > canReach {
+ canReach = i + x
+ if canReach >= len(nums)-1 {
+ return step + 1
+ }
+ }
+ if i == needChoose {
+ needChoose = canReach
+ step++
+ }
+ }
+ return step
+}
+```
\ No newline at end of file
diff --git a/leetcode/0048.Rotate-Image/48. Rotate Image.go b/leetcode/0048.Rotate-Image/48. Rotate Image.go
index a21d5fa80..f27e91e35 100644
--- a/leetcode/0048.Rotate-Image/48. Rotate Image.go
+++ b/leetcode/0048.Rotate-Image/48. Rotate Image.go
@@ -1,26 +1,61 @@
package leetcode
+// 解法一
func rotate(matrix [][]int) {
- row := len(matrix)
- if row <= 0 {
- return
- }
- column := len(matrix[0])
+ length := len(matrix)
// rotate by diagonal 对角线变换
- for i := 0; i < row; i++ {
- for j := i + 1; j < column; j++ {
- tmp := matrix[i][j]
- matrix[i][j] = matrix[j][i]
- matrix[j][i] = tmp
+ for i := 0; i < length; i++ {
+ for j := i + 1; j < length; j++ {
+ matrix[i][j], matrix[j][i] = matrix[j][i], matrix[i][j]
}
}
// rotate by vertical centerline 竖直轴对称翻转
- halfColumn := column / 2
- for i := 0; i < row; i++ {
- for j := 0; j < halfColumn; j++ {
- tmp := matrix[i][j]
- matrix[i][j] = matrix[i][column-j-1]
- matrix[i][column-j-1] = tmp
+ for i := 0; i < length; i++ {
+ for j := 0; j < length/2; j++ {
+ matrix[i][j], matrix[i][length-j-1] = matrix[i][length-j-1], matrix[i][j]
}
}
}
+
+// 解法二
+func rotate1(matrix [][]int) {
+ n := len(matrix)
+ if n == 1 {
+ return
+ }
+ /* rotate clock-wise = 1. transpose matrix => 2. reverse(matrix[i])
+
+ 1 2 3 4 1 5 9 13 13 9 5 1
+ 5 6 7 8 => 2 6 10 14 => 14 10 6 2
+ 9 10 11 12 3 7 11 15 15 11 7 3
+ 13 14 15 16 4 8 12 16 16 12 8 4
+
+ */
+
+ for i := 0; i < n; i++ {
+ // transpose, i=rows, j=columns
+ // j = i+1, coz diagonal elements didn't change in a square matrix
+ for j := i + 1; j < n; j++ {
+ swap(matrix, i, j)
+ }
+ // reverse each row of the image
+ matrix[i] = reverse(matrix[i])
+ }
+}
+
+// swap changes original slice's i,j position
+func swap(nums [][]int, i, j int) {
+ nums[i][j], nums[j][i] = nums[j][i], nums[i][j]
+}
+
+// reverses a row of image, matrix[i]
+func reverse(nums []int) []int {
+ var lp, rp = 0, len(nums) - 1
+
+ for lp < rp {
+ nums[lp], nums[rp] = nums[rp], nums[lp]
+ lp++
+ rp--
+ }
+ return nums
+}
diff --git a/leetcode/0048.Rotate-Image/README.md b/leetcode/0048.Rotate-Image/README.md
index d05ee7d3e..1a07a97d9 100755
--- a/leetcode/0048.Rotate-Image/README.md
+++ b/leetcode/0048.Rotate-Image/README.md
@@ -10,8 +10,9 @@ Rotate the image by 90 degrees (clockwise).
You have to rotate the image **[in-place](https://en.wikipedia.org/wiki/In-place_algorithm)**, which means you have to modify the input 2D matrix directly. **DO NOT** allocate another 2D matrix and do the rotation.
-**Example 1:**
+**Example 1**:
+
Given input matrix =
[
@@ -28,8 +29,9 @@ You have to rotate the image **[in-place](https://en.wikipedia.org/wiki/In-plac
]
-**Example 2:**
+**Example 2**:
+
Given input matrix =
[
diff --git a/leetcode/0051.N-Queens/51. N-Queens.go b/leetcode/0051.N-Queens/51. N-Queens.go
index de68f47bd..ba63a9100 100644
--- a/leetcode/0051.N-Queens/51. N-Queens.go
+++ b/leetcode/0051.N-Queens/51. N-Queens.go
@@ -47,39 +47,45 @@ func generateBoard(n int, row *[]int) []string {
return board
}
-// 解法二 二进制操作法
-// class Solution
-// {
-// int n;
-// string getNq(int p)
-// {
-// string s(n, '.');
-// s[p] = 'Q';
-// return s;
-// }
-// void nQueens(int p, int l, int m, int r, vector= len(matrix) || col < 0 || col >= len(matrix[0]) {
+ return
+ }
+ if (*visited)[row][col] || matrix[row][col] < height {
+ return
+ }
+ (*visited)[row][col] = true
+ dfs(matrix, row+1, col, visited, matrix[row][col])
+ dfs(matrix, row-1, col, visited, matrix[row][col])
+ dfs(matrix, row, col+1, visited, matrix[row][col])
+ dfs(matrix, row, col-1, visited, matrix[row][col])
+}
diff --git a/leetcode/0417.Pacific-Atlantic-Water-Flow/417. Pacific Atlantic Water Flow_test.go b/leetcode/0417.Pacific-Atlantic-Water-Flow/417. Pacific Atlantic Water Flow_test.go
new file mode 100644
index 000000000..a7278808f
--- /dev/null
+++ b/leetcode/0417.Pacific-Atlantic-Water-Flow/417. Pacific Atlantic Water Flow_test.go
@@ -0,0 +1,56 @@
+package leetcode
+
+import (
+ "fmt"
+ "testing"
+)
+
+type question417 struct {
+ para417
+ ans417
+}
+
+// para 是参数
+// one 代表第一个参数
+type para417 struct {
+ matrix [][]int
+}
+
+// ans 是答案
+// one 代表第一个答案
+type ans417 struct {
+ one [][]int
+}
+
+func Test_Problem417(t *testing.T) {
+
+ qs := []question417{
+
+ {
+ para417{[][]int{
+ {1, 2, 2, 3, 5},
+ {3, 2, 3, 4, 4},
+ {2, 4, 5, 3, 1},
+ {6, 7, 1, 4, 5},
+ {5, 1, 1, 2, 4},
+ }},
+ ans417{[][]int{
+ {0, 4},
+ {1, 3},
+ {1, 4},
+ {2, 2},
+ {3, 0},
+ {3, 1},
+ {4, 0},
+ }},
+ },
+ }
+
+ fmt.Printf("------------------------Leetcode Problem 417------------------------\n")
+
+ for _, q := range qs {
+ _, p := q.ans417, q.para417
+ fmt.Printf("【input】:%v 【output】:%v\n", p, pacificAtlantic(p.matrix))
+ }
+ fmt.Printf("\n\n\n")
+}
diff --git a/leetcode/0417.Pacific-Atlantic-Water-Flow/README.md b/leetcode/0417.Pacific-Atlantic-Water-Flow/README.md
new file mode 100644
index 000000000..124ce1fa5
--- /dev/null
+++ b/leetcode/0417.Pacific-Atlantic-Water-Flow/README.md
@@ -0,0 +1,92 @@
+# [417. Pacific Atlantic Water Flow](https://leetcode.com/problems/pacific-atlantic-water-flow/)
+
+
+## 题目
+
+Given an `m x n` matrix of non-negative integers representing the height of each unit cell in a continent, the "Pacific ocean" touches the left and top edges of the matrix and the "Atlantic ocean" touches the right and bottom edges.
+
+Water can only flow in four directions (up, down, left, or right) from a cell to another one with height equal or lower.
+
+Find the list of grid coordinates where water can flow to both the Pacific and Atlantic ocean.
+
+**Note:**
+
+1. The order of returned grid coordinates does not matter.
+2. Both m and n are less than 150.
+
+**Example:**
+
+```
+Given the following 5x5 matrix:
+
+ Pacific ~ ~ ~ ~ ~
+ ~ 1 2 2 3 (5) *
+ ~ 3 2 3 (4) (4) *
+ ~ 2 4 (5) 3 1 *
+ ~ (6) (7) 1 4 5 *
+ ~ (5) 1 1 2 4 *
+ * * * * * Atlantic
+
+Return:
+
+[[0, 4], [1, 3], [1, 4], [2, 2], [3, 0], [3, 1], [4, 0]] (positions with parentheses in above matrix).
+
+```
+
+## 题目大意
+
+给定一个 m x n 的非负整数矩阵来表示一片大陆上各个单元格的高度。“太平洋”处于大陆的左边界和上边界,而“大西洋”处于大陆的右边界和下边界。规定水流只能按照上、下、左、右四个方向流动,且只能从高到低或者在同等高度上流动。请找出那些水流既可以流动到“太平洋”,又能流动到“大西洋”的陆地单元的坐标。
+
+## 解题思路
+
+- 暴力解法,利用 DFS 把二维数据按照行优先搜索一遍,分别标记出太平洋和大西洋水流能到达的位置。再按照列优先搜索一遍,标记出太平洋和大西洋水流能到达的位置。最后两者都能到达的坐标即为所求。
+
+## 代码
+
+```go
+package leetcode
+
+import "math"
+
+func pacificAtlantic(matrix [][]int) [][]int {
+ if len(matrix) == 0 || len(matrix[0]) == 0 {
+ return nil
+ }
+ row, col, res := len(matrix), len(matrix[0]), make([][]int, 0)
+ pacific, atlantic := make([][]bool, row), make([][]bool, row)
+ for i := 0; i < row; i++ {
+ pacific[i] = make([]bool, col)
+ atlantic[i] = make([]bool, col)
+ }
+ for i := 0; i < row; i++ {
+ dfs(matrix, i, 0, &pacific, math.MinInt32)
+ dfs(matrix, i, col-1, &atlantic, math.MinInt32)
+ }
+ for j := 0; j < col; j++ {
+ dfs(matrix, 0, j, &pacific, math.MinInt32)
+ dfs(matrix, row-1, j, &atlantic, math.MinInt32)
+ }
+ for i := 0; i < row; i++ {
+ for j := 0; j < col; j++ {
+ if atlantic[i][j] && pacific[i][j] {
+ res = append(res, []int{i, j})
+ }
+ }
+ }
+ return res
+}
+
+func dfs(matrix [][]int, row, col int, visited *[][]bool, height int) {
+ if row < 0 || row >= len(matrix) || col < 0 || col >= len(matrix[0]) {
+ return
+ }
+ if (*visited)[row][col] || matrix[row][col] < height {
+ return
+ }
+ (*visited)[row][col] = true
+ dfs(matrix, row+1, col, visited, matrix[row][col])
+ dfs(matrix, row-1, col, visited, matrix[row][col])
+ dfs(matrix, row, col+1, visited, matrix[row][col])
+ dfs(matrix, row, col-1, visited, matrix[row][col])
+}
+```
\ No newline at end of file
diff --git a/leetcode/0419.Battleships-in-a-Board/419. Battleships in a Board.go b/leetcode/0419.Battleships-in-a-Board/419. Battleships in a Board.go
new file mode 100644
index 000000000..6e519b858
--- /dev/null
+++ b/leetcode/0419.Battleships-in-a-Board/419. Battleships in a Board.go
@@ -0,0 +1,21 @@
+package leetcode
+
+func countBattleships(board [][]byte) (ans int) {
+ if len(board) == 0 || len(board[0]) == 0 {
+ return 0
+ }
+ for i := range board {
+ for j := range board[i] {
+ if board[i][j] == 'X' {
+ if i > 0 && board[i-1][j] == 'X' {
+ continue
+ }
+ if j > 0 && board[i][j-1] == 'X' {
+ continue
+ }
+ ans++
+ }
+ }
+ }
+ return
+}
diff --git a/leetcode/0419.Battleships-in-a-Board/419. Battleships in a Board_test.go b/leetcode/0419.Battleships-in-a-Board/419. Battleships in a Board_test.go
new file mode 100644
index 000000000..3669aeec3
--- /dev/null
+++ b/leetcode/0419.Battleships-in-a-Board/419. Battleships in a Board_test.go
@@ -0,0 +1,59 @@
+package leetcode
+
+import (
+ "fmt"
+ "testing"
+ "unsafe"
+)
+
+type question419 struct {
+ para419
+ ans419
+}
+
+// para 是参数
+// one 代表第一个参数
+type para419 struct {
+ one [][]byte
+}
+
+// ans 是答案
+// one 代表第一个答案
+type ans419 struct {
+ one int
+}
+
+func Test_Problem419(t *testing.T) {
+
+ qs := []question419{
+
+ {
+ para419{[][]byte{{'X', '.', '.', 'X'}, {'.', '.', '.', 'X'}, {'.', '.', '.', 'X'}}},
+ ans419{2},
+ },
+
+ {
+ para419{[][]byte{{'.'}}},
+ ans419{0},
+ },
+ }
+
+ fmt.Printf("------------------------Leetcode Problem 419------------------------\n")
+
+ for _, q := range qs {
+ _, p := q.ans419, q.para419
+ fmt.Printf("【input】:%v 【output】:%v\n", bytesArrayToStringArray(p.one), countBattleships(p.one))
+ }
+ fmt.Printf("\n\n\n")
+
+}
+
+// 在运行go test时 为了更直观地显示[][]byte中的字符而非ASCII码数值
+// bytesArrayToStringArray converts [][]byte to []string
+func bytesArrayToStringArray(b [][]byte) []string {
+ s := make([]string, len(b))
+ for i := range b {
+ s[i] = fmt.Sprintf("[%v]", *(*string)(unsafe.Pointer(&b[i])))
+ }
+ return s
+}
diff --git a/leetcode/0419.Battleships-in-a-Board/README.md b/leetcode/0419.Battleships-in-a-Board/README.md
new file mode 100644
index 000000000..8754bfb91
--- /dev/null
+++ b/leetcode/0419.Battleships-in-a-Board/README.md
@@ -0,0 +1,51 @@
+# [419. Battleships in a Board](https://leetcode.com/problems/battleships-in-a-board/)
+
+## 题目
+
+Given an `m x n` matrix `board` where each cell is a battleship `'X'` or empty `'.'`, return the number of the **battleships** on `board`.
+
+**Battleships** can only be placed horizontally or vertically on `board`. In other words, they can only be made of the shape `1 x k` (`1` row, `k` columns) or `k x 1` (`k` rows, `1` column), where `k` can be of any size. At least one horizontal or vertical cell separates between two battleships (i.e., there are no adjacent battleships).
+
+**Example 1:**
+
+
+
+```c
+Input: board = [["X",".",".","X"],[".",".",".","X"],[".",".",".","X"]]
+Output: 2
+```
+
+**Example 2:**
+
+```c
+Input: board = [["."]]
+Output: 0
+```
+
+**Constraints:**
+
+- `m == board.length`
+- `n == board[i].length`
+- `1 <= m, n <= 200`
+- `board[i][j] is either '.' or 'X'`.
+
+**Follow up:** Could you do it in one-pass, using only `O(1)` extra memory and without modifying the values `board`?
+
+## 题目大意
+
+给定一个大小为`m × n`的矩阵 称之为甲板,矩阵单元格中的`'X'`表示战舰,`'.'`表示空位。
+
+战舰只能水平或竖直摆放在甲板上(换句话说,可以理解为联通的同一行`'X'`或同一列`'X'`只算作一个“战舰群”),任意俩个“战舰群”间都是不相邻的。返回甲板上“战舰群”的数量。
+
+## 解题思路
+
+题目进阶要求一次扫描算法,空间复杂度为`O(1)`,且不能修改矩阵中的值。
+
+因为题目中给定的两个“战舰群”间至少有一个水平或垂直的空位分隔,所以可以通过枚举每个战舰的左上顶点即可统计“战舰群”的个数。
+
+假设当前遍历到矩阵中`'X'`的位置为`(i, j)`,即 `board[i][j]='X'`。如果当前战舰属于一个新的“战舰群”,则需要满足以下条件:
+
+- 当前位置的上方位为空,即 `board[i-1][j]='.'`;
+- 当前位置的左方位为空,即 `board[i][j-1]='.'`;
+
+统计出所有左方位和上方位为空的战舰个数,即可得到“战舰群”的数量。
\ No newline at end of file
diff --git a/leetcode/0423.Reconstruct-Original-Digits-from-English/423. Reconstruct Original Digits from English.go b/leetcode/0423.Reconstruct-Original-Digits-from-English/423. Reconstruct Original Digits from English.go
new file mode 100644
index 000000000..77577c712
--- /dev/null
+++ b/leetcode/0423.Reconstruct-Original-Digits-from-English/423. Reconstruct Original Digits from English.go
@@ -0,0 +1,32 @@
+package leetcode
+
+import (
+ "strings"
+)
+
+func originalDigits(s string) string {
+ digits := make([]int, 26)
+ for i := 0; i < len(s); i++ {
+ digits[int(s[i]-'a')]++
+ }
+ res := make([]string, 10)
+ res[0] = convert('z', digits, "zero", "0")
+ res[6] = convert('x', digits, "six", "6")
+ res[2] = convert('w', digits, "two", "2")
+ res[4] = convert('u', digits, "four", "4")
+ res[5] = convert('f', digits, "five", "5")
+ res[1] = convert('o', digits, "one", "1")
+ res[7] = convert('s', digits, "seven", "7")
+ res[3] = convert('r', digits, "three", "3")
+ res[8] = convert('t', digits, "eight", "8")
+ res[9] = convert('i', digits, "nine", "9")
+ return strings.Join(res, "")
+}
+
+func convert(b byte, digits []int, s string, num string) string {
+ v := digits[int(b-'a')]
+ for i := 0; i < len(s); i++ {
+ digits[int(s[i]-'a')] -= v
+ }
+ return strings.Repeat(num, v)
+}
diff --git a/leetcode/0423.Reconstruct-Original-Digits-from-English/423. Reconstruct Original Digits from English_test.go b/leetcode/0423.Reconstruct-Original-Digits-from-English/423. Reconstruct Original Digits from English_test.go
new file mode 100644
index 000000000..758aa950f
--- /dev/null
+++ b/leetcode/0423.Reconstruct-Original-Digits-from-English/423. Reconstruct Original Digits from English_test.go
@@ -0,0 +1,47 @@
+package leetcode
+
+import (
+ "fmt"
+ "testing"
+)
+
+type question423 struct {
+ para423
+ ans423
+}
+
+// para 是参数
+// one 代表第一个参数
+type para423 struct {
+ one string
+}
+
+// ans 是答案
+// one 代表第一个答案
+type ans423 struct {
+ one int
+}
+
+func Test_Problem423(t *testing.T) {
+
+ qs := []question423{
+
+ {
+ para423{"owoztneoer"},
+ ans423{012},
+ },
+
+ {
+ para423{"fviefuro"},
+ ans423{45},
+ },
+ }
+
+ fmt.Printf("------------------------Leetcode Problem 423------------------------\n")
+
+ for _, q := range qs {
+ _, p := q.ans423, q.para423
+ fmt.Printf("【input】:%v 【output】:%v\n", p, originalDigits(p.one))
+ }
+ fmt.Printf("\n\n\n")
+}
diff --git a/leetcode/0423.Reconstruct-Original-Digits-from-English/README.md b/leetcode/0423.Reconstruct-Original-Digits-from-English/README.md
new file mode 100644
index 000000000..ab95e6698
--- /dev/null
+++ b/leetcode/0423.Reconstruct-Original-Digits-from-English/README.md
@@ -0,0 +1,103 @@
+# [423. Reconstruct Original Digits from English](https://leetcode.com/problems/reconstruct-original-digits-from-english/)
+
+
+## 题目
+
+Given a **non-empty** string containing an out-of-order English representation of digits `0-9`, output the digits in ascending order.
+
+**Note:**
+
+1. Input contains only lowercase English letters.
+2. Input is guaranteed to be valid and can be transformed to its original digits. That means invalid inputs such as "abc" or "zerone" are not permitted.
+3. Input length is less than 50,000.
+
+**Example 1:**
+
+```
+Input: "owoztneoer"
+Output: "012"
+```
+
+**Example 2:**
+
+```
+Input: "fviefuro"
+Output: "45"
+```
+
+## 题目大意
+
+给定一个非空字符串,其中包含字母顺序打乱的英文单词表示的数字0-9。按升序输出原始的数字。
+
+注意:
+
+- 输入只包含小写英文字母。
+- 输入保证合法并可以转换为原始的数字,这意味着像 "abc" 或 "zerone" 的输入是不允许的。
+- 输入字符串的长度小于 50,000。
+
+## 解题思路
+
+- 这道题是一道找规律的题目。首先观察 0-9 对应的英文单词,找到特殊规律:所有的偶数都包含一个独特的字母:
+
+ `z` 只在 `zero` 中出现。
+
+ `w` 只在 `two` 中出现。
+
+ `u` 只在 `four` 中出现。
+
+ `x` 只在 `six` 中出现。
+
+ `g` 只在 `eight` 中出现。
+
+- 所以先排除掉这些偶数。然后在看剩下来几个数字对应的英文字母,这也是计算 3,5 和 7 的关键,因为有些单词只在一个奇数和一个偶数中出现(而且偶数已经被计算过了):
+
+ `h` 只在 `three` 和 `eight` 中出现。
+
+ `f` 只在 `five` 和 `four` 中出现。
+
+ `s` 只在 `seven` 和 `six` 中出现。
+
+- 接下来只需要处理 9 和 0,思路依然相同。
+
+ `i` 在 `nine`,`five`,`six` 和 `eight` 中出现。
+
+ `n` 在 `one`,`seven` 和 `nine` 中出现。
+
+- 最后按照上述的优先级,依次消耗对应的英文字母,生成最终的原始数字。注意按照优先级换算数字的时候,注意有多个重复数字的情况,比如多个 `1`,多个 `5` 等等。
+
+## 代码
+
+```go
+package leetcode
+
+import (
+ "strings"
+)
+
+func originalDigits(s string) string {
+ digits := make([]int, 26)
+ for i := 0; i < len(s); i++ {
+ digits[int(s[i]-'a')]++
+ }
+ res := make([]string, 10)
+ res[0] = convert('z', digits, "zero", "0")
+ res[6] = convert('x', digits, "six", "6")
+ res[2] = convert('w', digits, "two", "2")
+ res[4] = convert('u', digits, "four", "4")
+ res[5] = convert('f', digits, "five", "5")
+ res[1] = convert('o', digits, "one", "1")
+ res[7] = convert('s', digits, "seven", "7")
+ res[3] = convert('r', digits, "three", "3")
+ res[8] = convert('t', digits, "eight", "8")
+ res[9] = convert('i', digits, "nine", "9")
+ return strings.Join(res, "")
+}
+
+func convert(b byte, digits []int, s string, num string) string {
+ v := digits[int(b-'a')]
+ for i := 0; i < len(s); i++ {
+ digits[int(s[i]-'a')] -= v
+ }
+ return strings.Repeat(num, v)
+}
+```
\ No newline at end of file
diff --git a/leetcode/0429.N-ary-Tree-Level-Order-Traversal/429. N-ary Tree Level Order Traversal.go b/leetcode/0429.N-ary-Tree-Level-Order-Traversal/429. N-ary Tree Level Order Traversal.go
new file mode 100644
index 000000000..dfcf57a1e
--- /dev/null
+++ b/leetcode/0429.N-ary-Tree-Level-Order-Traversal/429. N-ary Tree Level Order Traversal.go
@@ -0,0 +1,39 @@
+package leetcode
+
+/**
+ * Definition for a Node.
+ * type Node struct {
+ * Val int
+ * Children []*Node
+ * }
+ */
+
+type Node struct {
+ Val int
+ Children []*Node
+}
+
+func levelOrder(root *Node) [][]int {
+ var res [][]int
+ var temp []int
+ if root == nil {
+ return res
+ }
+ queue := []*Node{root, nil}
+ for len(queue) > 1 {
+ node := queue[0]
+ queue = queue[1:]
+ if node == nil {
+ queue = append(queue, nil)
+ res = append(res, temp)
+ temp = []int{}
+ } else {
+ temp = append(temp, node.Val)
+ if len(node.Children) > 0 {
+ queue = append(queue, node.Children...)
+ }
+ }
+ }
+ res = append(res, temp)
+ return res
+}
diff --git a/leetcode/0429.N-ary-Tree-Level-Order-Traversal/429. N-ary Tree Level Order Traversal_test.go b/leetcode/0429.N-ary-Tree-Level-Order-Traversal/429. N-ary Tree Level Order Traversal_test.go
new file mode 100644
index 000000000..fe56775a4
--- /dev/null
+++ b/leetcode/0429.N-ary-Tree-Level-Order-Traversal/429. N-ary Tree Level Order Traversal_test.go
@@ -0,0 +1,10 @@
+package leetcode
+
+import (
+ "fmt"
+ "testing"
+)
+
+func Test_Problem429(t *testing.T) {
+ fmt.Printf("success\n")
+}
diff --git a/leetcode/0429.N-ary-Tree-Level-Order-Traversal/README.md b/leetcode/0429.N-ary-Tree-Level-Order-Traversal/README.md
new file mode 100644
index 000000000..79d4912d9
--- /dev/null
+++ b/leetcode/0429.N-ary-Tree-Level-Order-Traversal/README.md
@@ -0,0 +1,85 @@
+# [429. N-ary Tree Level Order Traversal](https://leetcode.com/problems/n-ary-tree-level-order-traversal/)
+
+
+## 题目
+
+Given an n-ary tree, return the *level order* traversal of its nodes' values.
+
+*Nary-Tree input serialization is represented in their level order traversal, each group of children is separated by the null value (See examples).*
+
+**Example 1:**
+
+
+
+```
+Input: root = [1,null,3,2,4,null,5,6]
+Output: [[1],[3,2,4],[5,6]]
+
+```
+
+**Example 2:**
+
+
+
+```
+Input: root = [1,null,2,3,4,5,null,null,6,7,null,8,null,9,10,null,null,11,null,12,null,13,null,null,14]
+Output: [[1],[2,3,4,5],[6,7,8,9,10],[11,12,13],[14]]
+
+```
+
+**Constraints:**
+
+- The height of the n-ary tree is less than or equal to `1000`
+- The total number of nodes is between `[0, 104]`
+
+## 题目大意
+
+给定一个 N 叉树,返回其节点值的层序遍历。(即从左到右,逐层遍历)。树的序列化输入是用层序遍历,每组子节点都由 null 值分隔(参见示例)。
+
+## 解题思路
+
+- 这是 n 叉树的系列题,第 589 题也是这一系列的题目。这一题思路不难,既然是层序遍历,用 BFS 解答。
+
+## 代码
+
+```go
+package leetcode
+
+/**
+ * Definition for a Node.
+ * type Node struct {
+ * Val int
+ * Children []*Node
+ * }
+ */
+
+type Node struct {
+ Val int
+ Children []*Node
+}
+
+func levelOrder(root *Node) [][]int {
+ var res [][]int
+ var temp []int
+ if root == nil {
+ return res
+ }
+ queue := []*Node{root, nil}
+ for len(queue) > 1 {
+ node := queue[0]
+ queue = queue[1:]
+ if node == nil {
+ queue = append(queue, nil)
+ res = append(res, temp)
+ temp = []int{}
+ } else {
+ temp = append(temp, node.Val)
+ if len(node.Children) > 0 {
+ queue = append(queue, node.Children...)
+ }
+ }
+ }
+ res = append(res, temp)
+ return res
+}
+```
\ No newline at end of file
diff --git a/leetcode/0434.Number-of-Segments-in-a-String/434.Number of Segments in a String.go b/leetcode/0434.Number-of-Segments-in-a-String/434.Number of Segments in a String.go
new file mode 100644
index 000000000..626caebe8
--- /dev/null
+++ b/leetcode/0434.Number-of-Segments-in-a-String/434.Number of Segments in a String.go
@@ -0,0 +1,18 @@
+package leetcode
+
+func countSegments(s string) int {
+ segments := false
+ cnt := 0
+ for _, v := range s {
+ if v == ' ' && segments {
+ segments = false
+ cnt += 1
+ } else if v != ' ' {
+ segments = true
+ }
+ }
+ if segments {
+ cnt++
+ }
+ return cnt
+}
diff --git a/leetcode/0434.Number-of-Segments-in-a-String/434.Number of Segments in a String_test.go b/leetcode/0434.Number-of-Segments-in-a-String/434.Number of Segments in a String_test.go
new file mode 100644
index 000000000..7c634601e
--- /dev/null
+++ b/leetcode/0434.Number-of-Segments-in-a-String/434.Number of Segments in a String_test.go
@@ -0,0 +1,55 @@
+package leetcode
+
+import (
+ "fmt"
+ "testing"
+)
+
+type question434 struct {
+ para434
+ ans434
+}
+
+// s 是参数
+type para434 struct {
+ s string
+}
+
+// ans 是答案
+type ans434 struct {
+ ans int
+}
+
+func Test_Problem434(t *testing.T) {
+
+ qs := []question434{
+
+ {
+ para434{"Hello, my name is John"},
+ ans434{5},
+ },
+
+ {
+ para434{"Hello"},
+ ans434{1},
+ },
+
+ {
+ para434{"love live! mu'sic forever"},
+ ans434{4},
+ },
+
+ {
+ para434{""},
+ ans434{0},
+ },
+ }
+
+ fmt.Printf("------------------------Leetcode Problem 434------------------------\n")
+
+ for _, q := range qs {
+ _, p := q.ans434, q.para434
+ fmt.Printf("【input】:%v 【output】:%v\n", p, countSegments(p.s))
+ }
+ fmt.Printf("\n\n\n")
+}
diff --git a/leetcode/0434.Number-of-Segments-in-a-String/README.md b/leetcode/0434.Number-of-Segments-in-a-String/README.md
new file mode 100644
index 000000000..48fd4b8da
--- /dev/null
+++ b/leetcode/0434.Number-of-Segments-in-a-String/README.md
@@ -0,0 +1,70 @@
+# [434. Number of Segments in a String](https://leetcode.com/problems/number-of-segments-in-a-string/)
+
+
+## 题目
+
+You are given a string s, return the number of segments in the string.
+
+A segment is defined to be a contiguous sequence of non-space characters.
+
+**Example 1:**
+
+ Input: s = "Hello, my name is John"
+ Output: 5
+ Explanation: The five segments are ["Hello,", "my", "name", "is", "John"]
+
+**Example 2:**
+
+ Input: s = "Hello"
+ Output: 1
+
+**Example 3:**
+
+ Input: s = "love live! mu'sic forever"
+ Output: 4
+
+**Example 4:**
+
+ Input: s = ""
+ Output: 0
+
+**Constraints**
+
+ - 0 <= s.length <= 300
+ - s consists of lower-case and upper-case English letters, digits or one of the following characters "!@#$%^&*()_+-=',.:".
+ - The only space character in s is ' '.
+
+## 题目大意
+
+统计字符串中的单词个数,这里的单词指的是连续的不是空格的字符。
+
+请注意,你可以假定字符串里不包括任何不可打印的字符。
+
+## 解题思路
+
+- 以空格为分割计算元素个数
+
+## 代码
+
+```go
+
+package leetcode
+
+func countSegments(s string) int {
+ segments := false
+ cnt := 0
+ for _, v := range s {
+ if v == ' ' && segments {
+ segments = false
+ cnt += 1
+ } else if v != ' ' {
+ segments = true
+ }
+ }
+ if segments {
+ cnt++
+ }
+ return cnt
+}
+
+```
\ No newline at end of file
diff --git a/leetcode/0437.Path-Sum-III/437. Path Sum III.go b/leetcode/0437.Path-Sum-III/437. Path Sum III.go
index 96e208ec6..cdbe52bf6 100644
--- a/leetcode/0437.Path-Sum-III/437. Path Sum III.go
+++ b/leetcode/0437.Path-Sum-III/437. Path Sum III.go
@@ -16,6 +16,30 @@ type TreeNode = structures.TreeNode
* }
*/
+// 解法一 带缓存 dfs
+func pathSum(root *TreeNode, targetSum int) int {
+ prefixSum := make(map[int]int)
+ prefixSum[0] = 1
+ return dfs(root, prefixSum, 0, targetSum)
+}
+
+func dfs(root *TreeNode, prefixSum map[int]int, cur, sum int) int {
+ if root == nil {
+ return 0
+ }
+ cur += root.Val
+ cnt := 0
+ if v, ok := prefixSum[cur-sum]; ok {
+ cnt = v
+ }
+ prefixSum[cur]++
+ cnt += dfs(root.Left, prefixSum, cur, sum)
+ cnt += dfs(root.Right, prefixSum, cur, sum)
+ prefixSum[cur]--
+ return cnt
+}
+
+// 解法二
func pathSumIII(root *TreeNode, sum int) int {
if root == nil {
return 0
diff --git a/leetcode/0437.Path-Sum-III/437. Path Sum III_test.go b/leetcode/0437.Path-Sum-III/437. Path Sum III_test.go
index 4f122a2da..089bef78a 100644
--- a/leetcode/0437.Path-Sum-III/437. Path Sum III_test.go
+++ b/leetcode/0437.Path-Sum-III/437. Path Sum III_test.go
@@ -45,7 +45,7 @@ func Test_Problem437(t *testing.T) {
_, p := q.ans437, q.para437
fmt.Printf("【input】:%v ", p)
root := structures.Ints2TreeNode(p.one)
- fmt.Printf("【output】:%v \n", pathSumIII(root, p.sum))
+ fmt.Printf("【output】:%v \n", pathSum(root, p.sum))
}
fmt.Printf("\n\n\n")
}
diff --git a/leetcode/0437.Path-Sum-III/README.md b/leetcode/0437.Path-Sum-III/README.md
old mode 100755
new mode 100644
index cad475bdd..755a4e263
--- a/leetcode/0437.Path-Sum-III/README.md
+++ b/leetcode/0437.Path-Sum-III/README.md
@@ -3,32 +3,34 @@
## 题目
-You are given a binary tree in which each node contains an integer value.
+Given the `root` of a binary tree and an integer `targetSum`, return *the number of paths where the sum of the values along the path equals* `targetSum`.
-Find the number of paths that sum to a given value.
+The path does not need to start or end at the root or a leaf, but it must go downwards (i.e., traveling only from parent nodes to child nodes).
-The path does not need to start or end at the root or a leaf, but it must go downwards (traveling only from parent nodes to child nodes).
+**Example 1:**
-The tree has no more than 1,000 nodes and the values are in the range -1,000,000 to 1,000,000.
+
-**Example:**
+```
+Input: root = [10,5,-3,3,2,null,11,3,-2,null,1], targetSum = 8
+Output: 3
+Explanation: The paths that sum to 8 are shown.
- root = [10,5,-3,3,2,null,11,3,-2,null,1], sum = 8
-
- 10
- / \
- 5 -3
- / \ \
- 3 2 11
- / \ \
- 3 -2 1
-
- Return 3. The paths that sum to 8 are:
-
- 1. 5 -> 3
- 2. 5 -> 2 -> 1
- 3. -3 -> 11
+```
+**Example 2:**
+
+```
+Input: root = [5,4,8,11,null,13,4,7,2,null,null,5,1], targetSum = 22
+Output: 3
+
+```
+
+**Constraints:**
+
+- The number of nodes in the tree is in the range `[0, 1000]`.
+- `109 <= Node.val <= 109`
+- `1000 <= targetSum <= 1000`
## 题目大意
@@ -42,3 +44,76 @@ The tree has no more than 1,000 nodes and the values are in the range -1,000,000
- 注意这一题可能出现负数的情况,节点和为 sum,并不一定是最终情况,有可能下面还有正数节点和负数节点相加正好为 0,那么这也是一种情况。一定要遍历到底。
- 一个点是否为 sum 的起点,有 3 种情况,第一种情况路径包含该 root 节点,如果包含该结点,就在它的左子树和右子树中寻找和为 `sum-root.Val` 的情况。第二种情况路径不包含该 root 节点,那么就需要在它的左子树和右子树中分别寻找和为 sum 的结点。
+
+
+## 代码
+
+```go
+
+package leetcode
+
+import (
+ "github.com/halfrost/LeetCode-Go/structures"
+)
+
+// TreeNode define
+type TreeNode = structures.TreeNode
+
+/**
+ * Definition for a binary tree node.
+ * type TreeNode struct {
+ * Val int
+ * Left *TreeNode
+ * Right *TreeNode
+ * }
+ */
+
+// 解法一 带缓存 dfs
+func pathSum(root *TreeNode, targetSum int) int {
+ prefixSum := make(map[int]int)
+ prefixSum[0] = 1
+ return dfs(root, prefixSum, 0, targetSum)
+}
+
+func dfs(root *TreeNode, prefixSum map[int]int, cur, sum int) int {
+ if root == nil {
+ return 0
+ }
+ cur += root.Val
+ cnt := 0
+ if v, ok := prefixSum[cur-sum]; ok {
+ cnt = v
+ }
+ prefixSum[cur]++
+ cnt += dfs(root.Left, prefixSum, cur, sum)
+ cnt += dfs(root.Right, prefixSum, cur, sum)
+ prefixSum[cur]--
+ return cnt
+}
+
+// 解法二
+func pathSumIII(root *TreeNode, sum int) int {
+ if root == nil {
+ return 0
+ }
+ res := findPath437(root, sum)
+ res += pathSumIII(root.Left, sum)
+ res += pathSumIII(root.Right, sum)
+ return res
+}
+
+// 寻找包含 root 这个结点,且和为 sum 的路径
+func findPath437(root *TreeNode, sum int) int {
+ if root == nil {
+ return 0
+ }
+ res := 0
+ if root.Val == sum {
+ res++
+ }
+ res += findPath437(root.Left, sum-root.Val)
+ res += findPath437(root.Right, sum-root.Val)
+ return res
+}
+
+```
\ No newline at end of file
diff --git a/leetcode/0445.Add-Two-Numbers-II/445. Add Two Numbers II.go b/leetcode/0445.Add-Two-Numbers-II/445. Add Two Numbers II.go
index 3211805ad..e4ddee058 100644
--- a/leetcode/0445.Add-Two-Numbers-II/445. Add Two Numbers II.go
+++ b/leetcode/0445.Add-Two-Numbers-II/445. Add Two Numbers II.go
@@ -67,3 +67,72 @@ func getLength(l *ListNode) int {
}
return count
}
+
+func addTwoNumbers1(l1 *ListNode, l2 *ListNode) *ListNode {
+ reservedL1 := reverseList(l1)
+ reservedL2 := reverseList(l2)
+
+ dummyHead := &ListNode{}
+ head := dummyHead
+ carry := 0
+ for reservedL1 != nil || reservedL2 != nil || carry > 0 {
+ val := carry
+ if reservedL1 != nil {
+ val = reservedL1.Val + val
+ reservedL1 = reservedL1.Next
+ }
+ if reservedL2 != nil {
+ val = reservedL2.Val + val
+ reservedL2 = reservedL2.Next
+ }
+ carry = val / 10
+ head.Next = &ListNode{Val: val % 10}
+ head = head.Next
+ }
+ return reverseList(dummyHead.Next)
+}
+
+func reverseList(head *ListNode) *ListNode {
+ var prev *ListNode
+ for head != nil {
+ tmp := head.Next
+ head.Next = prev
+
+ prev = head
+ head = tmp
+ }
+ return prev
+}
+
+func addTwoNumbers(l1 *ListNode, l2 *ListNode) *ListNode {
+ stack1 := pushStack(l1)
+ stack2 := pushStack(l2)
+
+ dummyHead := &ListNode{}
+ head := dummyHead
+ carry := 0
+ for len(stack1) > 0 || len(stack2) > 0 || carry > 0 {
+ val := carry
+ if len(stack1) > 0 {
+ val = val + stack1[len(stack1)-1]
+ stack1 = stack1[:len(stack1)-1]
+ }
+ if len(stack2) > 0 {
+ val = val + stack2[len(stack2)-1]
+ stack2 = stack2[:len(stack2)-1]
+ }
+ carry = val / 10
+ tmp := head.Next
+ head.Next = &ListNode{Val: val % 10, Next: tmp}
+ }
+ return dummyHead.Next
+}
+
+func pushStack(l *ListNode) []int {
+ var stack []int
+ for l != nil {
+ stack = append(stack, l.Val)
+ l = l.Next
+ }
+ return stack
+}
diff --git a/leetcode/0456.132-Pattern/456. 132 Pattern.go b/leetcode/0456.132-Pattern/456. 132 Pattern.go
index 89a75e6b1..af7db50b2 100644
--- a/leetcode/0456.132-Pattern/456. 132 Pattern.go
+++ b/leetcode/0456.132-Pattern/456. 132 Pattern.go
@@ -1,7 +1,6 @@
package leetcode
import (
- "fmt"
"math"
)
@@ -20,7 +19,6 @@ func find132pattern(nums []int) bool {
stack = stack[:len(stack)-1]
}
stack = append(stack, nums[i])
- fmt.Printf("stack = %v \n", stack)
}
return false
}
diff --git a/leetcode/0458.Poor-Pigs/458.Poor Pigs.go b/leetcode/0458.Poor-Pigs/458.Poor Pigs.go
new file mode 100644
index 000000000..81162d51e
--- /dev/null
+++ b/leetcode/0458.Poor-Pigs/458.Poor Pigs.go
@@ -0,0 +1,8 @@
+package leetcode
+
+import "math"
+
+func poorPigs(buckets int, minutesToDie int, minutesToTest int) int {
+ base := minutesToTest/minutesToDie + 1
+ return int(math.Ceil(math.Log10(float64(buckets)) / math.Log10(float64(base))))
+}
diff --git a/leetcode/0458.Poor-Pigs/458.Poor Pigs_test.go b/leetcode/0458.Poor-Pigs/458.Poor Pigs_test.go
new file mode 100644
index 000000000..50bb561ea
--- /dev/null
+++ b/leetcode/0458.Poor-Pigs/458.Poor Pigs_test.go
@@ -0,0 +1,52 @@
+package leetcode
+
+import (
+ "fmt"
+ "testing"
+)
+
+type question458 struct {
+ para458
+ ans458
+}
+
+// para 是参数
+type para458 struct {
+ buckets int
+ minutesToDie int
+ minutesToTest int
+}
+
+// ans 是答案
+type ans458 struct {
+ ans int
+}
+
+func Test_Problem458(t *testing.T) {
+
+ qs := []question458{
+
+ {
+ para458{1000, 15, 60},
+ ans458{5},
+ },
+
+ {
+ para458{4, 15, 15},
+ ans458{2},
+ },
+
+ {
+ para458{4, 15, 30},
+ ans458{2},
+ },
+ }
+
+ fmt.Printf("------------------------Leetcode Problem 458------------------------\n")
+
+ for _, q := range qs {
+ _, p := q.ans458, q.para458
+ fmt.Printf("【input】:%v 【output】:%v\n", p, poorPigs(p.buckets, p.minutesToDie, p.minutesToTest))
+ }
+ fmt.Printf("\n\n\n")
+}
diff --git a/leetcode/0458.Poor-Pigs/README.md b/leetcode/0458.Poor-Pigs/README.md
new file mode 100644
index 000000000..e8dba552d
--- /dev/null
+++ b/leetcode/0458.Poor-Pigs/README.md
@@ -0,0 +1,77 @@
+# [458. Poor Pigs](https://leetcode.com/problems/poor-pigs/)
+
+## 题目
+
+There are buckets buckets of liquid, where exactly one of the buckets is poisonous. To figure out which one is poisonous, you feed some number of (poor) pigs the liquid to see whether they will die or not. Unfortunately, you only have minutesToTest minutes to determine which bucket is poisonous.
+
+You can feed the pigs according to these steps:
+
+- Choose some live pigs to feed.
+- For each pig, choose which buckets to feed it. The pig will consume all the chosen buckets simultaneously and will take no time.
+- Wait for minutesToDie minutes. You may not feed any other pigs during this time.
+- After minutesToDie minutes have passed, any pigs that have been fed the poisonous bucket will die, and all others will survive.
+- Repeat this process until you run out of time.
+
+Given buckets, minutesToDie, and minutesToTest, return the minimum number of pigs needed to figure out which bucket is poisonous within the allotted time.
+
+**Example 1**:
+
+ Input: buckets = 1000, minutesToDie = 15, minutesToTest = 60
+ Output: 5
+
+**Example 2**:
+
+ Input: buckets = 4, minutesToDie = 15, minutesToTest = 15
+ Output: 2
+
+**Example 3**:
+
+ Input: buckets = 4, minutesToDie = 15, minutesToTest = 30
+ Output: 2
+
+**Constraints:**
+
+- 1 <= buckets <= 1000
+- 1 <= minutesToDie <= minutesToTest <= 100
+
+## 题目大意
+
+有 buckets 桶液体,其中 正好 有一桶含有毒药,其余装的都是水。它们从外观看起来都一样。为了弄清楚哪只水桶含有毒药,你可以喂一些猪喝,通过观察猪是否会死进行判断。不幸的是,你只有 minutesToTest 分钟时间来确定哪桶液体是有毒的。
+
+喂猪的规则如下:
+
+- 选择若干活猪进行喂养
+- 可以允许小猪同时饮用任意数量的桶中的水,并且该过程不需要时间。
+- 小猪喝完水后,必须有 minutesToDie 分钟的冷却时间。在这段时间里,你只能观察,而不允许继续喂猪。
+- 过了 minutesToDie 分钟后,所有喝到毒药的猪都会死去,其他所有猪都会活下来。
+- 重复这一过程,直到时间用完。
+
+给你桶的数目 buckets ,minutesToDie 和 minutesToTest ,返回在规定时间内判断哪个桶有毒所需的 最小 猪数。
+
+## 解题思路
+
+使用数学方法,以 minutesToDie=15, minutesToTest=60, 1 只小猪为例,可以测试 5 只桶
+
+- 0-15 小猪吃第一个桶中的液体,如果死去,则第一个桶有毒,否则继续测试
+- 15-30 小猪吃第二个桶中的液体,如果死去,则第二个桶有毒,否则继续测试
+- 30-45 小猪吃第三个桶中的液体,如果死去,则第三个桶有毒,否则继续测试
+- 45-60 小猪吃第四个桶中的液体,如果死去,则第四个桶有毒
+- 如果最后小猪没有死去,则第五个桶有毒
+
+所以一只小猪在 minutesToDie 和 minutesToTest 时间一定的情况下可以最多判断 base = minutesToTest / minutesToDie + 1 个桶
+
+假设小猪的数量是 num,那么 pow(base, num) >= buckets,根据对数运算规则,两边分别取对数得到: num >= Log10(buckets) / Log10(base)
+
+## 代码
+
+```go
+
+package leetcode
+
+import "math"
+
+func poorPigs(buckets int, minutesToDie int, minutesToTest int) int {
+ base := minutesToTest/minutesToDie + 1
+ return int(math.Ceil(math.Log10(float64(buckets)) / math.Log10(float64(base))))
+}
+```
\ No newline at end of file
diff --git a/leetcode/0460.LFU-Cache/460. LFU Cache.go b/leetcode/0460.LFU-Cache/460. LFU Cache.go
new file mode 100644
index 000000000..e2a29f539
--- /dev/null
+++ b/leetcode/0460.LFU-Cache/460. LFU Cache.go
@@ -0,0 +1,74 @@
+package leetcode
+
+import "container/list"
+
+type LFUCache struct {
+ nodes map[int]*list.Element
+ lists map[int]*list.List
+ capacity int
+ min int
+}
+
+type node struct {
+ key int
+ value int
+ frequency int
+}
+
+func Constructor(capacity int) LFUCache {
+ return LFUCache{nodes: make(map[int]*list.Element),
+ lists: make(map[int]*list.List),
+ capacity: capacity,
+ min: 0,
+ }
+}
+
+func (this *LFUCache) Get(key int) int {
+ value, ok := this.nodes[key]
+ if !ok {
+ return -1
+ }
+ currentNode := value.Value.(*node)
+ this.lists[currentNode.frequency].Remove(value)
+ currentNode.frequency++
+ if _, ok := this.lists[currentNode.frequency]; !ok {
+ this.lists[currentNode.frequency] = list.New()
+ }
+ newList := this.lists[currentNode.frequency]
+ newNode := newList.PushBack(currentNode)
+ this.nodes[key] = newNode
+ if currentNode.frequency-1 == this.min && this.lists[currentNode.frequency-1].Len() == 0 {
+ this.min++
+ }
+ return currentNode.value
+}
+
+func (this *LFUCache) Put(key int, value int) {
+ if this.capacity == 0 {
+ return
+ }
+ if currentValue, ok := this.nodes[key]; ok {
+ currentNode := currentValue.Value.(*node)
+ currentNode.value = value
+ this.Get(key)
+ return
+ }
+ if this.capacity == len(this.nodes) {
+ currentList := this.lists[this.min]
+ frontNode := currentList.Front()
+ delete(this.nodes, frontNode.Value.(*node).key)
+ currentList.Remove(frontNode)
+ }
+ this.min = 1
+ currentNode := &node{
+ key: key,
+ value: value,
+ frequency: 1,
+ }
+ if _, ok := this.lists[1]; !ok {
+ this.lists[1] = list.New()
+ }
+ newList := this.lists[1]
+ newNode := newList.PushBack(currentNode)
+ this.nodes[key] = newNode
+}
diff --git a/leetcode/0460.LFU-Cache/460. LFU Cache_test.go b/leetcode/0460.LFU-Cache/460. LFU Cache_test.go
new file mode 100644
index 000000000..12205d94e
--- /dev/null
+++ b/leetcode/0460.LFU-Cache/460. LFU Cache_test.go
@@ -0,0 +1,64 @@
+package leetcode
+
+import (
+ "fmt"
+ "testing"
+)
+
+func Test_Problem460(t *testing.T) {
+ obj := Constructor(5)
+ fmt.Printf("obj.list = %v obj.map = %v obj.min = %v\n", MLists2Ints(&obj), MList2Ints(&obj), obj.min)
+ obj.Put(1, 1)
+ fmt.Printf("obj.list = %v obj.map = %v obj.min = %v\n", MLists2Ints(&obj), MList2Ints(&obj), obj.min)
+ obj.Put(2, 2)
+ fmt.Printf("obj.list = %v obj.map = %v obj.min = %v\n", MLists2Ints(&obj), MList2Ints(&obj), obj.min)
+ obj.Put(3, 3)
+ fmt.Printf("obj.list = %v obj.map = %v obj.min = %v\n", MLists2Ints(&obj), MList2Ints(&obj), obj.min)
+ obj.Put(4, 4)
+ fmt.Printf("obj.list = %v obj.map = %v obj.min = %v\n", MLists2Ints(&obj), MList2Ints(&obj), obj.min)
+ obj.Put(5, 5)
+ fmt.Printf("obj.list = %v obj.map = %v obj.min = %v\n", MLists2Ints(&obj), MList2Ints(&obj), obj.min)
+
+ param1 := obj.Get(4)
+ fmt.Printf("param_1 = %v obj.list = %v obj.map = %v obj.min = %v\n", param1, MLists2Ints(&obj), MList2Ints(&obj), obj.min)
+ param1 = obj.Get(4)
+ fmt.Printf("param_1 = %v obj.list = %v obj.map = %v obj.min = %v\n", param1, MLists2Ints(&obj), MList2Ints(&obj), obj.min)
+ param1 = obj.Get(4)
+ fmt.Printf("param_1 = %v obj.list = %v obj.map = %v obj.min = %v\n", param1, MLists2Ints(&obj), MList2Ints(&obj), obj.min)
+ param1 = obj.Get(5)
+ fmt.Printf("param_1 = %v obj.list = %v obj.map = %v obj.min = %v\n", param1, MLists2Ints(&obj), MList2Ints(&obj), obj.min)
+ param1 = obj.Get(5)
+ fmt.Printf("param_1 = %v obj.list = %v obj.map = %v obj.min = %v\n", param1, MLists2Ints(&obj), MList2Ints(&obj), obj.min)
+ param1 = obj.Get(5)
+ fmt.Printf("param_1 = %v obj.list = %v obj.map = %v obj.min = %v\n", param1, MLists2Ints(&obj), MList2Ints(&obj), obj.min)
+ obj.Put(6, 6)
+ fmt.Printf("obj.list = %v obj.map = %v obj.min = %v\n", MLists2Ints(&obj), MList2Ints(&obj), obj.min)
+ obj.Put(7, 7)
+ fmt.Printf("obj.list = %v obj.map = %v obj.min = %v\n", MLists2Ints(&obj), MList2Ints(&obj), obj.min)
+ obj.Put(8, 8)
+ fmt.Printf("obj.list = %v obj.map = %v obj.min = %v\n", MLists2Ints(&obj), MList2Ints(&obj), obj.min)
+}
+
+func MList2Ints(lfu *LFUCache) map[int][][]int {
+ res := map[int][][]int{}
+ for k, v := range lfu.nodes {
+ node := v.Value.(*node)
+ arr := [][]int{}
+ tmp := []int{node.key, node.value, node.frequency}
+ arr = append(arr, tmp)
+ res[k] = arr
+ }
+ return res
+}
+
+func MLists2Ints(lfu *LFUCache) map[int][]int {
+ res := map[int][]int{}
+ for k, v := range lfu.lists {
+ tmp := []int{}
+ for head := v.Front(); head != nil; head = head.Next() {
+ tmp = append(tmp, head.Value.(*node).value)
+ }
+ res[k] = tmp
+ }
+ return res
+}
diff --git a/leetcode/0460.LFU-Cache/README.md b/leetcode/0460.LFU-Cache/README.md
new file mode 100644
index 000000000..f4a07c445
--- /dev/null
+++ b/leetcode/0460.LFU-Cache/README.md
@@ -0,0 +1,142 @@
+# [460. LFU Cache](https://leetcode.com/problems/lfu-cache/)
+
+
+## 题目
+
+Design and implement a data structure for [Least Frequently Used (LFU)](https://en.wikipedia.org/wiki/Least_frequently_used) cache.
+
+Implement the `LFUCache` class:
+
+- `LFUCache(int capacity)` Initializes the object with the `capacity` of the data structure.
+- `int get(int key)` Gets the value of the `key` if the `key` exists in the cache. Otherwise, returns `1`.
+- `void put(int key, int value)` Sets or inserts the value if the `key` is not already present. When the cache reaches its `capacity`, it should invalidate the least frequently used item before inserting a new item. For this problem, when there is a tie (i.e., two or more keys with the same frequency), **the least recently** used `key` would be evicted.
+
+**Notice that** the number of times an item is used is the number of calls to the `get` and `put` functions for that item since it was inserted. This number is set to zero when the item is removed.
+
+**Example 1:**
+
+```
+Input
+["LFUCache", "put", "put", "get", "put", "get", "get", "put", "get", "get", "get"]
+[[2], [1, 1], [2, 2], [1], [3, 3], [2], [3], [4, 4], [1], [3], [4]]
+Output
+[null, null, null, 1, null, -1, 3, null, -1, 3, 4]
+
+Explanation
+LFUCache lfu = new LFUCache(2);
+lfu.put(1, 1);
+lfu.put(2, 2);
+lfu.get(1); // return 1
+lfu.put(3, 3); // evicts key 2
+lfu.get(2); // return -1 (not found)
+lfu.get(3); // return 3
+lfu.put(4, 4); // evicts key 1.
+lfu.get(1); // return -1 (not found)
+lfu.get(3); // return 3
+lfu.get(4); // return 4
+
+```
+
+**Constraints:**
+
+- `0 <= capacity, key, value <= 104`
+- At most `10^5` calls will be made to `get` and `put`.
+
+**Follow up:** Could you do both operations in `O(1)` time complexity?
+
+## 题目大意
+
+请你为 最不经常使用(LFU)缓存算法设计并实现数据结构。
+
+实现 LFUCache 类:
+
+- LFUCache(int capacity) - 用数据结构的容量 capacity 初始化对象
+- int get(int key) - 如果键存在于缓存中,则获取键的值,否则返回 -1。
+- void put(int key, int value) - 如果键已存在,则变更其值;如果键不存在,请插入键值对。当缓存达到其容量时,则应该在插入新项之前,使最不经常使用的项无效。在此问题中,当存在平局(即两个或更多个键具有相同使用频率)时,应该去除 最久未使用 的键。
+
+注意「项的使用次数」就是自插入该项以来对其调用 get 和 put 函数的次数之和。使用次数会在对应项被移除后置为 0 。
+
+进阶:你是否可以在 O(1) 时间复杂度内执行两项操作?
+
+## 解题思路
+
+- 这一题是 LFU 经典面试题,详细解释见[第三章 LFUCache 模板](https://books.halfrost.com/leetcode/ChapterThree/LFUCache/)。
+
+## 代码
+
+```go
+package leetcode
+
+import "container/list"
+
+type LFUCache struct {
+ nodes map[int]*list.Element
+ lists map[int]*list.List
+ capacity int
+ min int
+}
+
+type node struct {
+ key int
+ value int
+ frequency int
+}
+
+func Constructor(capacity int) LFUCache {
+ return LFUCache{nodes: make(map[int]*list.Element),
+ lists: make(map[int]*list.List),
+ capacity: capacity,
+ min: 0,
+ }
+}
+
+func (this *LFUCache) Get(key int) int {
+ value, ok := this.nodes[key]
+ if !ok {
+ return -1
+ }
+ currentNode := value.Value.(*node)
+ this.lists[currentNode.frequency].Remove(value)
+ currentNode.frequency++
+ if _, ok := this.lists[currentNode.frequency]; !ok {
+ this.lists[currentNode.frequency] = list.New()
+ }
+ newList := this.lists[currentNode.frequency]
+ newNode := newList.PushBack(currentNode)
+ this.nodes[key] = newNode
+ if currentNode.frequency-1 == this.min && this.lists[currentNode.frequency-1].Len() == 0 {
+ this.min++
+ }
+ return currentNode.value
+}
+
+func (this *LFUCache) Put(key int, value int) {
+ if this.capacity == 0 {
+ return
+ }
+ if currentValue, ok := this.nodes[key]; ok {
+ currentNode := currentValue.Value.(*node)
+ currentNode.value = value
+ this.Get(key)
+ return
+ }
+ if this.capacity == len(this.nodes) {
+ currentList := this.lists[this.min]
+ frontNode := currentList.Front()
+ delete(this.nodes, frontNode.Value.(*node).key)
+ currentList.Remove(frontNode)
+ }
+ this.min = 1
+ currentNode := &node{
+ key: key,
+ value: value,
+ frequency: 1,
+ }
+ if _, ok := this.lists[1]; !ok {
+ this.lists[1] = list.New()
+ }
+ newList := this.lists[1]
+ newNode := newList.PushBack(currentNode)
+ this.nodes[key] = newNode
+}
+```
\ No newline at end of file
diff --git a/leetcode/0462.Minimum-Moves-to-Equal-Array-Elements-II/462. Minimum Moves to Equal Array Elements II.go b/leetcode/0462.Minimum-Moves-to-Equal-Array-Elements-II/462. Minimum Moves to Equal Array Elements II.go
new file mode 100644
index 000000000..cd38e4787
--- /dev/null
+++ b/leetcode/0462.Minimum-Moves-to-Equal-Array-Elements-II/462. Minimum Moves to Equal Array Elements II.go
@@ -0,0 +1,21 @@
+package leetcode
+
+import (
+ "math"
+ "sort"
+)
+
+func minMoves2(nums []int) int {
+ if len(nums) == 0 {
+ return 0
+ }
+ moves, mid := 0, len(nums)/2
+ sort.Ints(nums)
+ for i := range nums {
+ if i == mid {
+ continue
+ }
+ moves += int(math.Abs(float64(nums[mid] - nums[i])))
+ }
+ return moves
+}
diff --git a/leetcode/0462.Minimum-Moves-to-Equal-Array-Elements-II/462. Minimum Moves to Equal Array Elements II_test.go b/leetcode/0462.Minimum-Moves-to-Equal-Array-Elements-II/462. Minimum Moves to Equal Array Elements II_test.go
new file mode 100644
index 000000000..bdbae051f
--- /dev/null
+++ b/leetcode/0462.Minimum-Moves-to-Equal-Array-Elements-II/462. Minimum Moves to Equal Array Elements II_test.go
@@ -0,0 +1,57 @@
+package leetcode
+
+import (
+ "fmt"
+ "testing"
+)
+
+type question462 struct {
+ para462
+ ans462
+}
+
+// para 是参数
+// one 代表第一个参数
+type para462 struct {
+ nums []int
+}
+
+// ans 是答案
+// one 代表第一个答案
+type ans462 struct {
+ one int
+}
+
+func Test_Problem462(t *testing.T) {
+
+ qs := []question462{
+
+ {
+ para462{[]int{}},
+ ans462{0},
+ },
+
+ {
+ para462{[]int{1, 2, 3}},
+ ans462{2},
+ },
+
+ {
+ para462{[]int{1, 10, 2, 9}},
+ ans462{16},
+ },
+
+ {
+ para462{[]int{1, 0, 0, 8, 6}},
+ ans462{14},
+ },
+ }
+
+ fmt.Printf("------------------------Leetcode Problem 462------------------------\n")
+
+ for _, q := range qs {
+ _, p := q.ans462, q.para462
+ fmt.Printf("【input】:%v 【output】:%v\n", p, minMoves2(p.nums))
+ }
+ fmt.Printf("\n\n\n")
+}
diff --git a/leetcode/0462.Minimum-Moves-to-Equal-Array-Elements-II/README.md b/leetcode/0462.Minimum-Moves-to-Equal-Array-Elements-II/README.md
new file mode 100644
index 000000000..c030b1de0
--- /dev/null
+++ b/leetcode/0462.Minimum-Moves-to-Equal-Array-Elements-II/README.md
@@ -0,0 +1,66 @@
+# [462. Minimum Moves to Equal Array Elements II](https://leetcode.com/problems/minimum-moves-to-equal-array-elements-ii/)
+
+
+## 题目
+
+Given an integer array `nums` of size `n`, return *the minimum number of moves required to make all array elements equal*.
+
+In one move, you can increment or decrement an element of the array by `1`.
+
+**Example 1:**
+
+```
+Input: nums = [1,2,3]
+Output: 2
+Explanation:
+Only two moves are needed (remember each move increments or decrements one element):
+[1,2,3] => [2,2,3] => [2,2,2]
+```
+
+**Example 2:**
+
+```
+Input: nums = [1,10,2,9]
+Output: 16
+```
+
+**Constraints:**
+
+- `n == nums.length`
+- `1 <= nums.length <= 10^5`
+- `109 <= nums[i] <= 10^9`
+
+## 题目大意
+
+给定一个非空整数数组,找到使所有数组元素相等所需的最小移动数,其中每次移动可将选定的一个元素加 1 或减 1。 您可以假设数组的长度最多为10000。
+
+## 解题思路
+
+- 这题抽象成数学问题是,如果我们把数组 a 中的每个数看成水平轴上的一个点,那么根据上面的移动次数公式,我们需要找到在水平轴上找到一个点 x,使得这 N 个点到 x 的距离之和最小。有 2 个点值得我们考虑,一个是中位数,另外一个是平均值。举个简单的例子,[1,0,0,8,6] 这组数据,中位数是 1,平均值是 3 。分别计算移动的步数,按照中位数对齐是 14,按照平均值对齐是 16 。所以选择中位数。
+- 此题可以用数学证明,证明出,按照平均值移动的步数 ≥ 按照中位数移动的步数。具体证明笔者这里不证明了,感兴趣的同学可以自己证明试试。
+
+## 代码
+
+```go
+package leetcode
+
+import (
+ "math"
+ "sort"
+)
+
+func minMoves2(nums []int) int {
+ if len(nums) == 0 {
+ return 0
+ }
+ moves, mid := 0, len(nums)/2
+ sort.Ints(nums)
+ for i := range nums {
+ if i == mid {
+ continue
+ }
+ moves += int(math.Abs(float64(nums[mid] - nums[i])))
+ }
+ return moves
+}
+```
\ No newline at end of file
diff --git a/leetcode/0473.Matchsticks-to-Square/473. Matchsticks to Square.go b/leetcode/0473.Matchsticks-to-Square/473. Matchsticks to Square.go
new file mode 100644
index 000000000..8930f35a4
--- /dev/null
+++ b/leetcode/0473.Matchsticks-to-Square/473. Matchsticks to Square.go
@@ -0,0 +1,49 @@
+package leetcode
+
+import "sort"
+
+func makesquare(matchsticks []int) bool {
+ if len(matchsticks) < 4 {
+ return false
+ }
+ total := 0
+ for _, v := range matchsticks {
+ total += v
+ }
+ if total%4 != 0 {
+ return false
+ }
+ sort.Slice(matchsticks, func(i, j int) bool {
+ return matchsticks[i] > matchsticks[j]
+ })
+ visited := make([]bool, 16)
+ return dfs(matchsticks, 0, 0, 0, total, &visited)
+}
+
+func dfs(matchsticks []int, cur, group, sum, total int, visited *[]bool) bool {
+ if group == 4 {
+ return true
+ }
+ if sum > total/4 {
+ return false
+ }
+ if sum == total/4 {
+ return dfs(matchsticks, 0, group+1, 0, total, visited)
+ }
+ last := -1
+ for i := cur; i < len(matchsticks); i++ {
+ if (*visited)[i] {
+ continue
+ }
+ if last == matchsticks[i] {
+ continue
+ }
+ (*visited)[i] = true
+ last = matchsticks[i]
+ if dfs(matchsticks, i+1, group, sum+matchsticks[i], total, visited) {
+ return true
+ }
+ (*visited)[i] = false
+ }
+ return false
+}
diff --git a/leetcode/0473.Matchsticks-to-Square/473. Matchsticks to Square_test.go b/leetcode/0473.Matchsticks-to-Square/473. Matchsticks to Square_test.go
new file mode 100644
index 000000000..7636f00fb
--- /dev/null
+++ b/leetcode/0473.Matchsticks-to-Square/473. Matchsticks to Square_test.go
@@ -0,0 +1,47 @@
+package leetcode
+
+import (
+ "fmt"
+ "testing"
+)
+
+type question473 struct {
+ para473
+ ans473
+}
+
+// para 是参数
+// one 代表第一个参数
+type para473 struct {
+ arr []int
+}
+
+// ans 是答案
+// one 代表第一个答案
+type ans473 struct {
+ one bool
+}
+
+func Test_Problem473(t *testing.T) {
+
+ qs := []question473{
+
+ {
+ para473{[]int{1, 1, 2, 2, 2}},
+ ans473{true},
+ },
+
+ {
+ para473{[]int{3, 3, 3, 3, 4}},
+ ans473{false},
+ },
+ }
+
+ fmt.Printf("------------------------Leetcode Problem 473------------------------\n")
+
+ for _, q := range qs {
+ _, p := q.ans473, q.para473
+ fmt.Printf("【input】:%v 【output】:%v\n", p, makesquare(p.arr))
+ }
+ fmt.Printf("\n\n\n")
+}
diff --git a/leetcode/0473.Matchsticks-to-Square/README.md b/leetcode/0473.Matchsticks-to-Square/README.md
new file mode 100644
index 000000000..d58d6b1c4
--- /dev/null
+++ b/leetcode/0473.Matchsticks-to-Square/README.md
@@ -0,0 +1,94 @@
+# [473. Matchsticks to Square](https://leetcode.com/problems/matchsticks-to-square/)
+
+
+## 题目
+
+You are given an integer array `matchsticks` where `matchsticks[i]` is the length of the `ith` matchstick. You want to use **all the matchsticks** to make one square. You **should not break** any stick, but you can link them up, and each matchstick must be used **exactly one time**.
+
+Return `true` if you can make this square and `false` otherwise.
+
+**Example 1:**
+
+
+
+```
+Input: matchsticks = [1,1,2,2,2]
+Output: true
+Explanation: You can form a square with length 2, one side of the square came two sticks with length 1.
+```
+
+**Example 2:**
+
+```
+Input: matchsticks = [3,3,3,3,4]
+Output: false
+Explanation: You cannot find a way to form a square with all the matchsticks.
+```
+
+**Constraints:**
+
+- `1 <= matchsticks.length <= 15`
+- `0 <= matchsticks[i] <= 109`
+
+## 题目大意
+
+现在已知小女孩有多少根火柴,请找出一种能使用所有火柴拼成一个正方形的方法。不能折断火柴,可以把火柴连接起来,并且每根火柴都要用到。输入为小女孩拥有火柴的数目,每根火柴用其长度表示。输出即为是否能用所有的火柴拼成正方形。
+
+## 解题思路
+
+- 将火柴拼成一个正方形,可以将它们分成四组,每一根火柴恰好属于其中的一组;并且每一组火柴的长度之和都相同,等于所有火柴长度之和的四分之一。
+- 考虑暴力解法,使用深度优先搜索枚举出所有的分组情况,并对于每一种情况,判断是否满足上述的两个条件(每根火柴属于其中一组,每组火柴长度之和相同)。依次对每一根火柴进行搜索,当搜索到第 i 根火柴时,可以考虑把它放到四组中的任意一种。对于每一种放置方法,继续对第 i + 1 根火柴进行深搜。当我们搜索完全部的 N 根火柴后,再判断每一组火柴的长度之和是否都相同。
+
+## 代码
+
+```go
+package leetcode
+
+import "sort"
+
+func makesquare(matchsticks []int) bool {
+ if len(matchsticks) < 4 {
+ return false
+ }
+ total := 0
+ for _, v := range matchsticks {
+ total += v
+ }
+ if total%4 != 0 {
+ return false
+ }
+ sort.Slice(matchsticks, func(i, j int) bool {
+ return matchsticks[i] > matchsticks[j]
+ })
+ visited := make([]bool, 16)
+ return dfs(matchsticks, 0, 0, 0, total, &visited)
+}
+
+func dfs(matchsticks []int, cur, group, sum, total int, visited *[]bool) bool {
+ if group == 4 {
+ return true
+ }
+ if sum > total/4 {
+ return false
+ }
+ if sum == total/4 {
+ return dfs(matchsticks, 0, group+1, 0, total, visited)
+ }
+ last := -1
+ for i := cur; i < len(matchsticks); i++ {
+ if (*visited)[i] {
+ continue
+ }
+ if last == matchsticks[i] {
+ continue
+ }
+ (*visited)[i] = true
+ last = matchsticks[i]
+ if dfs(matchsticks, i+1, group, sum+matchsticks[i], total, visited) {
+ return true
+ }
+ (*visited)[i] = false
+ }
+ return false
+}
+```
\ No newline at end of file
diff --git a/leetcode/0478.Generate-Random-Point-in-a-Circle/478. Generate Random Point in a Circle.go b/leetcode/0478.Generate-Random-Point-in-a-Circle/478. Generate Random Point in a Circle.go
new file mode 100644
index 000000000..d611124a3
--- /dev/null
+++ b/leetcode/0478.Generate-Random-Point-in-a-Circle/478. Generate Random Point in a Circle.go
@@ -0,0 +1,46 @@
+package leetcode
+
+import (
+ "math"
+ "math/rand"
+ "time"
+)
+
+type Solution struct {
+ r float64
+ x float64
+ y float64
+}
+
+func Constructor(radius float64, x_center float64, y_center float64) Solution {
+ rand.Seed(time.Now().UnixNano())
+ return Solution{radius, x_center, y_center}
+}
+
+func (this *Solution) RandPoint() []float64 {
+ /*
+ a := angle()
+ r := this.r * math.Sqrt(rand.Float64())
+ x := r * math.Cos(a) + this.x
+ y := r * math.Sin(a) + this.y
+ return []float64{x, y}*/
+ for {
+ rx := 2*rand.Float64() - 1.0
+ ry := 2*rand.Float64() - 1.0
+ x := this.r * rx
+ y := this.r * ry
+ if x*x+y*y <= this.r*this.r {
+ return []float64{x + this.x, y + this.y}
+ }
+ }
+}
+
+func angle() float64 {
+ return rand.Float64() * 2 * math.Pi
+}
+
+/**
+ * Your Solution object will be instantiated and called as such:
+ * obj := Constructor(radius, x_center, y_center);
+ * param_1 := obj.RandPoint();
+ */
diff --git a/leetcode/0478.Generate-Random-Point-in-a-Circle/478. Generate Random Point in a Circle_test.go b/leetcode/0478.Generate-Random-Point-in-a-Circle/478. Generate Random Point in a Circle_test.go
new file mode 100644
index 000000000..ddd2e62df
--- /dev/null
+++ b/leetcode/0478.Generate-Random-Point-in-a-Circle/478. Generate Random Point in a Circle_test.go
@@ -0,0 +1,18 @@
+package leetcode
+
+import (
+ "fmt"
+ "testing"
+)
+
+func Test_Problem478(t *testing.T) {
+ obj := Constructor(1, 0, 0)
+ fmt.Printf("RandPoint() = %v\n", obj.RandPoint())
+ fmt.Printf("RandPoint() = %v\n", obj.RandPoint())
+ fmt.Printf("RandPoint() = %v\n", obj.RandPoint())
+
+ obj = Constructor(10, 5, -7.5)
+ fmt.Printf("RandPoint() = %v\n", obj.RandPoint())
+ fmt.Printf("RandPoint() = %v\n", obj.RandPoint())
+ fmt.Printf("RandPoint() = %v\n", obj.RandPoint())
+}
diff --git a/leetcode/0478.Generate-Random-Point-in-a-Circle/README.md b/leetcode/0478.Generate-Random-Point-in-a-Circle/README.md
new file mode 100644
index 000000000..bc325e62a
--- /dev/null
+++ b/leetcode/0478.Generate-Random-Point-in-a-Circle/README.md
@@ -0,0 +1,103 @@
+# [478. Generate Random Point in a Circle](https://leetcode.com/problems/generate-random-point-in-a-circle/)
+
+
+## 题目
+
+Given the radius and x-y positions of the center of a circle, write a function `randPoint` which generates a uniform random point in the circle.
+
+Note:
+
+1. input and output values are in [floating-point](https://www.webopedia.com/TERM/F/floating_point_number.html).
+2. radius and x-y position of the center of the circle is passed into the class constructor.
+3. a point on the circumference of the circle is considered to be in the circle.
+4. `randPoint` returns a size 2 array containing x-position and y-position of the random point, in that order.
+
+**Example 1:**
+
+```
+Input:
+["Solution","randPoint","randPoint","randPoint"]
+[[1,0,0],[],[],[]]
+Output: [null,[-0.72939,-0.65505],[-0.78502,-0.28626],[-0.83119,-0.19803]]
+
+```
+
+**Example 2:**
+
+```
+Input:
+["Solution","randPoint","randPoint","randPoint"]
+[[10,5,-7.5],[],[],[]]
+Output: [null,[11.52438,-8.33273],[2.46992,-16.21705],[11.13430,-12.42337]]
+```
+
+**Explanation of Input Syntax:**
+
+The input is two lists: the subroutines called and their arguments. `Solution`'s constructor has three arguments, the radius, x-position of the center, and y-position of the center of the circle. `randPoint` has no arguments. Arguments are always wrapped with a list, even if there aren't any.
+
+## 题目大意
+
+给定圆的半径和圆心的 x、y 坐标,写一个在圆中产生均匀随机点的函数 randPoint 。
+
+说明:
+
+- 输入值和输出值都将是浮点数。
+- 圆的半径和圆心的 x、y 坐标将作为参数传递给类的构造函数。
+- 圆周上的点也认为是在圆中。
+- randPoint 返回一个包含随机点的x坐标和y坐标的大小为2的数组。
+
+## 解题思路
+
+- 随机产生一个圆内的点,这个点一定满足定义 `(x-a)^2+(y-b)^2 ≤ R^2`,其中 `(a,b)` 是圆的圆心坐标,`R` 是半径。
+- 先假设圆心坐标在 (0,0),这样方便计算,最终输出坐标的时候整体加上圆心的偏移量即可。`rand.Float64()` 产生一个 `[0.0,1.0)` 区间的浮点数。`-R ≤ 2 * R * rand() - R < R`,利用随机产生坐标点的横纵坐标 `(x,y)` 与半径 R 的关系,如果 `x^2 + y^2 ≤ R^2`,那么说明产生的点在圆内。最终输出的时候要记得加上圆心坐标的偏移值。
+
+## 代码
+
+```go
+package leetcode
+
+import (
+ "math"
+ "math/rand"
+ "time"
+)
+
+type Solution struct {
+ r float64
+ x float64
+ y float64
+}
+
+func Constructor(radius float64, x_center float64, y_center float64) Solution {
+ rand.Seed(time.Now().UnixNano())
+ return Solution{radius, x_center, y_center}
+}
+
+func (this *Solution) RandPoint() []float64 {
+ /*
+ a := angle()
+ r := this.r * math.Sqrt(rand.Float64())
+ x := r * math.Cos(a) + this.x
+ y := r * math.Sin(a) + this.y
+ return []float64{x, y}*/
+ for {
+ rx := 2*rand.Float64() - 1.0
+ ry := 2*rand.Float64() - 1.0
+ x := this.r * rx
+ y := this.r * ry
+ if x*x+y*y <= this.r*this.r {
+ return []float64{x + this.x, y + this.y}
+ }
+ }
+}
+
+func angle() float64 {
+ return rand.Float64() * 2 * math.Pi
+}
+
+/**
+ * Your Solution object will be instantiated and called as such:
+ * obj := Constructor(radius, x_center, y_center);
+ * param_1 := obj.RandPoint();
+ */
+```
\ No newline at end of file
diff --git a/leetcode/0483.Smallest-Good-Base/483. Smallest Good Base.go b/leetcode/0483.Smallest-Good-Base/483. Smallest Good Base.go
index 6c8f72d2a..7dc0430f3 100644
--- a/leetcode/0483.Smallest-Good-Base/483. Smallest Good Base.go
+++ b/leetcode/0483.Smallest-Good-Base/483. Smallest Good Base.go
@@ -2,34 +2,23 @@ package leetcode
import (
"math"
+ "math/bits"
"strconv"
)
func smallestGoodBase(n string) string {
- num, _ := strconv.ParseUint(n, 10, 64)
- for bit := uint64(math.Log2(float64(num))); bit >= 1; bit-- {
- low, high := uint64(2), uint64(math.Pow(float64(num), 1.0/float64(bit)))
- for low < high {
- mid := uint64(low + (high-low)>>1)
- sum := findBase(mid, bit)
- if sum == num {
- return strconv.FormatUint(mid, 10)
- } else if sum > num {
- high = mid - 1
- } else {
- low = mid + 1
- }
+ nVal, _ := strconv.Atoi(n)
+ mMax := bits.Len(uint(nVal)) - 1
+ for m := mMax; m > 1; m-- {
+ k := int(math.Pow(float64(nVal), 1/float64(m)))
+ mul, sum := 1, 1
+ for i := 0; i < m; i++ {
+ mul *= k
+ sum += mul
+ }
+ if sum == nVal {
+ return strconv.Itoa(k)
}
}
- return strconv.FormatUint(num-1, 10)
-}
-
-// 计算 k^m + k^(m-1) + ... + k + 1
-func findBase(mid, bit uint64) uint64 {
- sum, base := uint64(1), uint64(1)
- for i := uint64(1); i <= bit; i++ {
- base *= mid
- sum += base
- }
- return sum
+ return strconv.Itoa(nVal - 1)
}
diff --git a/leetcode/0488.Zuma-Game/488.Zuma Game.go b/leetcode/0488.Zuma-Game/488.Zuma Game.go
new file mode 100644
index 000000000..7fa5e2595
--- /dev/null
+++ b/leetcode/0488.Zuma-Game/488.Zuma Game.go
@@ -0,0 +1,50 @@
+package leetcode
+
+func findMinStep(board string, hand string) int {
+ q := [][]string{{board, hand}}
+ mp := make(map[string]bool)
+ minStep := 0
+ for len(q) > 0 {
+ length := len(q)
+ minStep++
+ for length > 0 {
+ length--
+ cur := q[0]
+ q = q[1:]
+ curB, curH := cur[0], cur[1]
+ for i := 0; i < len(curB); i++ {
+ for j := 0; j < len(curH); j++ {
+ curB2 := del3(curB[0:i] + string(curH[j]) + curB[i:])
+ curH2 := curH[0:j] + curH[j+1:]
+ if len(curB2) == 0 {
+ return minStep
+ }
+ if _, ok := mp[curB2+curH2]; ok {
+ continue
+ }
+ mp[curB2+curH2] = true
+ q = append(q, []string{curB2, curH2})
+ }
+ }
+ }
+ }
+ return -1
+}
+
+func del3(str string) string {
+ cnt := 1
+ for i := 1; i < len(str); i++ {
+ if str[i] == str[i-1] {
+ cnt++
+ } else {
+ if cnt >= 3 {
+ return del3(str[0:i-cnt] + str[i:])
+ }
+ cnt = 1
+ }
+ }
+ if cnt >= 3 {
+ return str[0 : len(str)-cnt]
+ }
+ return str
+}
diff --git a/leetcode/0488.Zuma-Game/488.Zuma Game_test.go b/leetcode/0488.Zuma-Game/488.Zuma Game_test.go
new file mode 100644
index 000000000..841c8168b
--- /dev/null
+++ b/leetcode/0488.Zuma-Game/488.Zuma Game_test.go
@@ -0,0 +1,56 @@
+package leetcode
+
+import (
+ "fmt"
+ "testing"
+)
+
+type question488 struct {
+ para488
+ ans488
+}
+
+// para 是参数
+type para488 struct {
+ board string
+ hand string
+}
+
+// ans 是答案
+type ans488 struct {
+ ans int
+}
+
+func Test_Problem488(t *testing.T) {
+
+ qs := []question488{
+
+ {
+ para488{"WRRBBW", "RB"},
+ ans488{-1},
+ },
+
+ {
+ para488{"WWRRBBWW", "WRBRW"},
+ ans488{2},
+ },
+
+ {
+ para488{"G", "GGGGG"},
+ ans488{2},
+ },
+
+ {
+ para488{"RBYYBBRRB", "YRBGB"},
+ ans488{3},
+ },
+ }
+
+ fmt.Printf("------------------------Leetcode Problem 488------------------------\n")
+
+ for _, q := range qs {
+ _, p := q.ans488, q.para488
+ fmt.Printf("【input】:%v 【output】:%v\n", p, findMinStep(p.board, p.hand))
+ }
+ fmt.Printf("\n\n\n")
+}
diff --git a/leetcode/0488.Zuma-Game/README.md b/leetcode/0488.Zuma-Game/README.md
new file mode 100644
index 000000000..2e05d9d76
--- /dev/null
+++ b/leetcode/0488.Zuma-Game/README.md
@@ -0,0 +1,141 @@
+# [488. Zuma Game](https://leetcode.com/problems/zuma-game/)
+
+
+## 题目
+
+You are playing a variation of the game Zuma.
+
+In this variation of Zuma, there is a single row of colored balls on a board, where each ball can be colored red 'R', yellow 'Y', blue 'B', green 'G', or white 'W'. You also have several colored balls in your hand.
+
+Your goal is to clear all of the balls from the board. On each turn:
+
+Pick any ball from your hand and insert it in between two balls in the row or on either end of the row.
+If there is a group of three or more consecutive balls of the same color, remove the group of balls from the board.
+If this removal causes more groups of three or more of the same color to form, then continue removing each group until there are none left.
+If there are no more balls on the board, then you win the game.
+Repeat this process until you either win or do not have any more balls in your hand.
+Given a string board, representing the row of balls on the board, and a string hand, representing the balls in your hand, return the minimum number of balls you have to insert to clear all the balls from the board. If you cannot clear all the balls from the board using the balls in your hand, return -1.
+
+**Example 1**:
+
+```
+Input: board = "WRRBBW", hand = "RB"
+Output: -1
+Explanation: It is impossible to clear all the balls. The best you can do is:
+- Insert 'R' so the board becomes WRRRBBW. WRRRBBW -> WBBW.
+- Insert 'B' so the board becomes WBBBW. WBBBW -> WW.
+There are still balls remaining on the board, and you are out of balls to insert.
+```
+
+**Example 2**:
+```
+Input: board = "WWRRBBWW", hand = "WRBRW"
+Output: 2
+Explanation: To make the board empty:
+- Insert 'R' so the board becomes WWRRRBBWW. WWRRRBBWW -> WWBBWW.
+- Insert 'B' so the board becomes WWBBBWW. WWBBBWW -> WWWW -> empty.
+2 balls from your hand were needed to clear the board.
+```
+
+**Example 3**:
+```
+Input: board = "G", hand = "GGGGG"
+Output: 2
+Explanation: To make the board empty:
+- Insert 'G' so the board becomes GG.
+- Insert 'G' so the board becomes GGG. GGG -> empty.
+2 balls from your hand were needed to clear the board.
+```
+
+**Example 4**:
+```
+Input: board = "RBYYBBRRB", hand = "YRBGB"
+Output: 3
+Explanation: To make the board empty:
+- Insert 'Y' so the board becomes RBYYYBBRRB. RBYYYBBRRB -> RBBBRRB -> RRRB -> B.
+- Insert 'B' so the board becomes BB.
+- Insert 'B' so the board becomes BBB. BBB -> empty.
+3 balls from your hand were needed to clear the board.
+```
+
+**Constraints**:
+
+- 1 <= board.length <= 16
+- 1 <= hand.length <= 5
+- board and hand consist of the characters 'R', 'Y', 'B', 'G', and 'W'.
+- The initial row of balls on the board will not have any groups of three or more consecutive balls of the same color.
+
+## 题目大意
+
+你正在参与祖玛游戏的一个变种。
+
+在这个祖玛游戏变体中,桌面上有 一排 彩球,每个球的颜色可能是:红色 'R'、黄色 'Y'、蓝色 'B'、绿色 'G' 或白色 'W' 。你的手中也有一些彩球。
+
+你的目标是 清空 桌面上所有的球。每一回合:
+
+从你手上的彩球中选出 任意一颗 ,然后将其插入桌面上那一排球中:两球之间或这一排球的任一端。
+接着,如果有出现 三个或者三个以上 且 颜色相同 的球相连的话,就把它们移除掉。
+如果这种移除操作同样导致出现三个或者三个以上且颜色相同的球相连,则可以继续移除这些球,直到不再满足移除条件。
+如果桌面上所有球都被移除,则认为你赢得本场游戏。
+重复这个过程,直到你赢了游戏或者手中没有更多的球。
+给你一个字符串 board ,表示桌面上最开始的那排球。另给你一个字符串 hand ,表示手里的彩球。请你按上述操作步骤移除掉桌上所有球,计算并返回所需的 最少 球数。如果不能移除桌上所有的球,返回 -1 。
+
+## 解题思路
+
+- 使用广度优先搜索和剪枝
+
+## 代码
+
+```go
+
+package leetcode
+
+func findMinStep(board string, hand string) int {
+ q := [][]string{{board, hand}}
+ mp := make(map[string]bool)
+ minStep := 0
+ for len(q) > 0 {
+ length := len(q)
+ minStep++
+ for length > 0 {
+ length--
+ cur := q[0]
+ q = q[1:]
+ curB, curH := cur[0], cur[1]
+ for i := 0; i < len(curB); i++ {
+ for j := 0; j < len(curH); j++ {
+ curB2 := del3(curB[0:i] + string(curH[j]) + curB[i:])
+ curH2 := curH[0:j] + curH[j+1:]
+ if len(curB2) == 0 {
+ return minStep
+ }
+ if _, ok := mp[curB2+curH2]; ok {
+ continue
+ }
+ mp[curB2+curH2] = true
+ q = append(q, []string{curB2, curH2})
+ }
+ }
+ }
+ }
+ return -1
+}
+
+func del3(str string) string {
+ cnt := 1
+ for i := 1; i < len(str); i++ {
+ if str[i] == str[i-1] {
+ cnt++
+ } else {
+ if cnt >= 3 {
+ return del3(str[0:i-cnt] + str[i:])
+ }
+ cnt = 1
+ }
+ }
+ if cnt >= 3 {
+ return str[0 : len(str)-cnt]
+ }
+ return str
+}
+```
\ No newline at end of file
diff --git a/leetcode/0491.Increasing-Subsequences/README.md b/leetcode/0491.Increasing-Subsequences/README.md
deleted file mode 100755
index 79063dbc5..000000000
--- a/leetcode/0491.Increasing-Subsequences/README.md
+++ /dev/null
@@ -1,40 +0,0 @@
-# [491. Increasing Subsequences](https://leetcode.com/problems/increasing-subsequences/)
-
-
-## 题目
-
-Given an integer array, your task is to find all the different possible increasing subsequences of the given array, and the length of an increasing subsequence should be at least 2.
-
-**Example:**
-
- Input: [4, 6, 7, 7]
- Output: [[4, 6], [4, 7], [4, 6, 7], [4, 6, 7, 7], [6, 7], [6, 7, 7], [7,7], [4,7,7]]
-
-**Note:**
-
-1. The length of the given array will not exceed 15.
-2. The range of integer in the given array is [-100,100].
-3. The given array may contain duplicates, and two equal integers should also be considered as a special case of increasing sequence.
-
-
-
-## 题目大意
-
-
-给定一个整型数组, 你的任务是找到所有该数组的递增子序列,递增子序列的长度至少是 2。
-
-说明:
-
-1. 给定数组的长度不会超过15。
-2. 数组中的整数范围是 [-100,100]。
-3. 给定数组中可能包含重复数字,相等的数字应该被视为递增的一种情况。
-
-
-
-
-## 解题思路
-
-
-- 给出一个数组,要求找出这个数组中所有长度大于 2 的非递减子序列。子序列顺序和原数组元素下标必须是顺序的,不能是逆序的。
-- 这一题和第 78 题和第 90 题是类似的题目。第 78 题和第 90 题是求所有子序列,这一题在这两题的基础上增加了非递减和长度大于 2 的条件。需要注意的两点是,原数组中元素可能会重复,最终结果输出的时候需要去重。最终结果输出的去重用 map 处理,数组中重复元素用 DFS 遍历搜索。在每次 DFS 中,用 map 记录遍历过的元素,保证本轮 DFS 中不出现重复的元素,递归到下一层还可以选择值相同,但是下标不同的另外一个元素。外层循环也要加一个 map,这个 map 是过滤每组解因为重复元素导致的重复解,经过过滤以后,起点不同了,最终的解也会不同。
-- 这一题和第 78 题,第 90 题类似,可以一起解答和复习。
diff --git a/leetcode/0491.Increasing-Subsequences/491. Increasing Subsequences.go b/leetcode/0491.Non-decreasing-Subsequences/491. Non-decreasing Subsequences.go
similarity index 100%
rename from leetcode/0491.Increasing-Subsequences/491. Increasing Subsequences.go
rename to leetcode/0491.Non-decreasing-Subsequences/491. Non-decreasing Subsequences.go
diff --git a/leetcode/0491.Increasing-Subsequences/491. Increasing Subsequences_test.go b/leetcode/0491.Non-decreasing-Subsequences/491. Non-decreasing Subsequences_test.go
similarity index 100%
rename from leetcode/0491.Increasing-Subsequences/491. Increasing Subsequences_test.go
rename to leetcode/0491.Non-decreasing-Subsequences/491. Non-decreasing Subsequences_test.go
diff --git a/leetcode/0491.Non-decreasing-Subsequences/README.md b/leetcode/0491.Non-decreasing-Subsequences/README.md
new file mode 100755
index 000000000..f5c5e34a6
--- /dev/null
+++ b/leetcode/0491.Non-decreasing-Subsequences/README.md
@@ -0,0 +1,40 @@
+# [491. Non-decreasing Subsequences](https://leetcode.com/problems/non-decreasing-subsequences/)
+
+
+## 题目
+
+Given an integer array, your task is to find all the different possible increasing subsequences of the given array, and the length of an increasing subsequence should be at least 2.
+
+**Example:**
+
+ Input: [4, 6, 7, 7]
+ Output: [[4, 6], [4, 7], [4, 6, 7], [4, 6, 7, 7], [6, 7], [6, 7, 7], [7,7], [4,7,7]]
+
+**Note:**
+
+1. The length of the given array will not exceed 15.
+2. The range of integer in the given array is [-100,100].
+3. The given array may contain duplicates, and two equal integers should also be considered as a special case of increasing sequence.
+
+
+
+## 题目大意
+
+
+给定一个整型数组, 你的任务是找到所有该数组的递增子序列,递增子序列的长度至少是 2。
+
+说明:
+
+1. 给定数组的长度不会超过15。
+2. 数组中的整数范围是 [-100,100]。
+3. 给定数组中可能包含重复数字,相等的数字应该被视为递增的一种情况。
+
+
+
+
+## 解题思路
+
+
+- 给出一个数组,要求找出这个数组中所有长度大于 2 的非递减子序列。子序列顺序和原数组元素下标必须是顺序的,不能是逆序的。
+- 这一题和第 78 题和第 90 题是类似的题目。第 78 题和第 90 题是求所有子序列,这一题在这两题的基础上增加了非递减和长度大于 2 的条件。需要注意的两点是,原数组中元素可能会重复,最终结果输出的时候需要去重。最终结果输出的去重用 map 处理,数组中重复元素用 DFS 遍历搜索。在每次 DFS 中,用 map 记录遍历过的元素,保证本轮 DFS 中不出现重复的元素,递归到下一层还可以选择值相同,但是下标不同的另外一个元素。外层循环也要加一个 map,这个 map 是过滤每组解因为重复元素导致的重复解,经过过滤以后,起点不同了,最终的解也会不同。
+- 这一题和第 78 题,第 90 题类似,可以一起解答和复习。
diff --git a/leetcode/0492.Construct-the-Rectangle/492.Construct the Rectangle.go b/leetcode/0492.Construct-the-Rectangle/492.Construct the Rectangle.go
new file mode 100644
index 000000000..3314fbc13
--- /dev/null
+++ b/leetcode/0492.Construct-the-Rectangle/492.Construct the Rectangle.go
@@ -0,0 +1,16 @@
+package leetcode
+
+import "math"
+
+func constructRectangle(area int) []int {
+ ans := make([]int, 2)
+ W := int(math.Sqrt(float64(area)))
+ for W >= 1 {
+ if area%W == 0 {
+ ans[0], ans[1] = area/W, W
+ break
+ }
+ W -= 1
+ }
+ return ans
+}
diff --git a/leetcode/0492.Construct-the-Rectangle/492.Construct the Rectangle_test.go b/leetcode/0492.Construct-the-Rectangle/492.Construct the Rectangle_test.go
new file mode 100644
index 000000000..b3ed98390
--- /dev/null
+++ b/leetcode/0492.Construct-the-Rectangle/492.Construct the Rectangle_test.go
@@ -0,0 +1,50 @@
+package leetcode
+
+import (
+ "fmt"
+ "testing"
+)
+
+type question492 struct {
+ para492
+ ans492
+}
+
+// area 是参数
+type para492 struct {
+ area int
+}
+
+// ans 是答案
+type ans492 struct {
+ ans []int
+}
+
+func Test_Problem492(t *testing.T) {
+
+ qs := []question492{
+
+ {
+ para492{4},
+ ans492{[]int{2, 2}},
+ },
+
+ {
+ para492{37},
+ ans492{[]int{37, 1}},
+ },
+
+ {
+ para492{122122},
+ ans492{[]int{427, 286}},
+ },
+ }
+
+ fmt.Printf("------------------------Leetcode Problem 492------------------------\n")
+
+ for _, q := range qs {
+ _, p := q.ans492, q.para492
+ fmt.Printf("【input】:%v 【output】:%v\n", p, constructRectangle(p.area))
+ }
+ fmt.Printf("\n\n\n")
+}
diff --git a/leetcode/0492.Construct-the-Rectangle/README.md b/leetcode/0492.Construct-the-Rectangle/README.md
new file mode 100644
index 000000000..8024d6e16
--- /dev/null
+++ b/leetcode/0492.Construct-the-Rectangle/README.md
@@ -0,0 +1,72 @@
+# [492. Construct the Rectangle](https://leetcode.com/problems/construct-the-rectangle/)
+
+
+## 题目
+
+A web developer needs to know how to design a web page's size.
+So, given a specific rectangular web page’s area, your job by now is to design a rectangular web page,
+whose length L and width W satisfy the following requirements:
+
+ The area of the rectangular web page you designed must equal to the given target area.
+ The width W should not be larger than the length L, which means L >= W.
+ The difference between length L and width W should be as small as possible.
+ Return an array [L, W] where L and W are the length and width of the web page you designed in sequence.
+
+**Example 1:**
+
+ Input: area = 4
+ Output: [2,2]
+ Explanation: The target area is 4, and all the possible ways to construct it are [1,4], [2,2], [4,1].
+ But according to requirement 2, [1,4] is illegal; according to requirement 3, [4,1] is not optimal compared to [2,2]. So the length L is 2, and the width W is 2.
+
+**Example 2:**
+
+ Input: area = 37
+ Output: [37,1]
+
+**Example 3:**
+
+ Input: area = 122122
+ Output: [427,286]
+
+**Constraints**
+
+ - 1 <= area <= 10000000
+
+## 题目大意
+
+作为一位 web 开发者, 懂得怎样去规划一个页面的尺寸是很重要的。 现给定一个具体的矩形页面面积,你的任务是设计一个长度为 L 和宽度为 W 且满足以下要求的矩形的页面。要求:
+
+1. 你设计的矩形页面必须等于给定的目标面积。
+2. 宽度 W 不应大于长度 L,换言之,要求 L >= W 。
+3. 长度 L 和宽度 W 之间的差距应当尽可能小。
+
+你需要按顺序输出你设计的页面的长度 L 和宽度 W。
+
+## 解题思路
+
+- 令 W 等于根号 area
+- 在 W 大于等于 1 的情况下,判断 area%W 是否等于 0,如果不相等 W 就减 1 继续循环,如果相等就返回 [area/W, W]
+
+## 代码
+
+```go
+
+package leetcode
+
+import "math"
+
+func constructRectangle(area int) []int {
+ ans := make([]int, 2)
+ W := int(math.Sqrt(float64(area)))
+ for W >= 1 {
+ if area%W == 0 {
+ ans[0], ans[1] = area/W, W
+ break
+ }
+ W -= 1
+ }
+ return ans
+}
+
+``
\ No newline at end of file
diff --git a/leetcode/0493.Reverse-Pairs/493. Reverse Pairs.go b/leetcode/0493.Reverse-Pairs/493. Reverse Pairs.go
index b21a85a53..ec312a33f 100644
--- a/leetcode/0493.Reverse-Pairs/493. Reverse Pairs.go
+++ b/leetcode/0493.Reverse-Pairs/493. Reverse Pairs.go
@@ -6,8 +6,69 @@ import (
"github.com/halfrost/LeetCode-Go/template"
)
-// 解法一 线段树,时间复杂度 O(n log n)
+// 解法一 归并排序 mergesort,时间复杂度 O(n log n)
func reversePairs(nums []int) int {
+ buf := make([]int, len(nums))
+ return mergesortCount(nums, buf)
+}
+
+func mergesortCount(nums, buf []int) int {
+ if len(nums) <= 1 {
+ return 0
+ }
+ mid := (len(nums) - 1) / 2
+ cnt := mergesortCount(nums[:mid+1], buf)
+ cnt += mergesortCount(nums[mid+1:], buf)
+ for i, j := 0, mid+1; i < mid+1; i++ { // Note!!! j is increasing.
+ for ; j < len(nums) && nums[i] <= 2*nums[j]; j++ {
+ }
+ cnt += len(nums) - j
+ }
+ copy(buf, nums)
+ for i, j, k := 0, mid+1, 0; k < len(nums); {
+ if j >= len(nums) || i < mid+1 && buf[i] > buf[j] {
+ nums[k] = buf[i]
+ i++
+ } else {
+ nums[k] = buf[j]
+ j++
+ }
+ k++
+ }
+ return cnt
+}
+
+// 解法二 树状数组,时间复杂度 O(n log n)
+func reversePairs1(nums []int) (cnt int) {
+ n := len(nums)
+ if n <= 1 {
+ return
+ }
+ // 离散化所有下面统计时会出现的元素
+ allNums := make([]int, 0, 2*n)
+ for _, v := range nums {
+ allNums = append(allNums, v, 2*v)
+ }
+ sort.Ints(allNums)
+ k := 1
+ kth := map[int]int{allNums[0]: k}
+ for i := 1; i < 2*n; i++ {
+ if allNums[i] != allNums[i-1] {
+ k++
+ kth[allNums[i]] = k
+ }
+ }
+ bit := template.BinaryIndexedTree{}
+ bit.Init(k)
+ for i, v := range nums {
+ cnt += i - bit.Query(kth[2*v])
+ bit.Add(kth[v], 1)
+ }
+ return
+}
+
+// 解法三 线段树,时间复杂度 O(n log n)
+func reversePairs2(nums []int) int {
if len(nums) < 2 {
return 0
}
@@ -42,35 +103,3 @@ func reversePairs(nums []int) int {
}
return res
}
-
-// 解法二 mergesort
-func reversePairs1(nums []int) int {
- buf := make([]int, len(nums))
- return mergesortCount(nums, buf)
-}
-
-func mergesortCount(nums, buf []int) int {
- if len(nums) <= 1 {
- return 0
- }
- mid := (len(nums) - 1) / 2
- cnt := mergesortCount(nums[:mid+1], buf)
- cnt += mergesortCount(nums[mid+1:], buf)
- for i, j := 0, mid+1; i < mid+1; i++ { // Note!!! j is increasing.
- for ; j < len(nums) && nums[i] <= 2*nums[j]; j++ {
- }
- cnt += len(nums) - j
- }
- copy(buf, nums)
- for i, j, k := 0, mid+1, 0; k < len(nums); {
- if j >= len(nums) || i < mid+1 && buf[i] > buf[j] {
- nums[k] = buf[i]
- i++
- } else {
- nums[k] = buf[j]
- j++
- }
- k++
- }
- return cnt
-}
diff --git a/leetcode/0493.Reverse-Pairs/493. Reverse Pairs_test.go b/leetcode/0493.Reverse-Pairs/493. Reverse Pairs_test.go
index 49ff2de26..2c9097080 100644
--- a/leetcode/0493.Reverse-Pairs/493. Reverse Pairs_test.go
+++ b/leetcode/0493.Reverse-Pairs/493. Reverse Pairs_test.go
@@ -31,6 +31,11 @@ func Test_Problem493(t *testing.T) {
ans493{2},
},
+ {
+ para493{[]int{9, 8, 7, 4, 7, 2, 3, 8, 7, 0}},
+ ans493{18},
+ },
+
{
para493{[]int{2, 4, 3, 5, 1}},
ans493{3},
diff --git a/leetcode/0493.Reverse-Pairs/README.md b/leetcode/0493.Reverse-Pairs/README.md
index 2094a3618..c27689198 100755
--- a/leetcode/0493.Reverse-Pairs/README.md
+++ b/leetcode/0493.Reverse-Pairs/README.md
@@ -38,5 +38,6 @@ You need to return the number of important reverse pairs in the given array.
- 给出一个数组,要求找出满足条件的所有的“重要的反转对” (i,j)。重要的反转对的定义是:`i
+
+
+
diff --git a/website/content/ChapterFour/0414.Third-Maximum-Number.md b/website/content/ChapterFour/0400~0499/0414.Third-Maximum-Number.md
similarity index 79%
rename from website/content/ChapterFour/0414.Third-Maximum-Number.md
rename to website/content/ChapterFour/0400~0499/0414.Third-Maximum-Number.md
index 7c8ef633f..cf74dd4b9 100644
--- a/website/content/ChapterFour/0414.Third-Maximum-Number.md
+++ b/website/content/ChapterFour/0400~0499/0414.Third-Maximum-Number.md
@@ -69,4 +69,11 @@ func thirdMax(nums []int) int {
return c
}
-```
\ No newline at end of file
+```
+
+
+----------------------------------------------
+
diff --git a/website/content/ChapterFour/0416.Partition-Equal-Subset-Sum.md b/website/content/ChapterFour/0400~0499/0416.Partition-Equal-Subset-Sum.md
similarity index 83%
rename from website/content/ChapterFour/0416.Partition-Equal-Subset-Sum.md
rename to website/content/ChapterFour/0400~0499/0416.Partition-Equal-Subset-Sum.md
index ce3a79cca..2947ad58f 100755
--- a/website/content/ChapterFour/0416.Partition-Equal-Subset-Sum.md
+++ b/website/content/ChapterFour/0400~0499/0416.Partition-Equal-Subset-Sum.md
@@ -73,4 +73,11 @@ func canPartition(nums []int) bool {
return dp[C]
}
-```
\ No newline at end of file
+```
+
+
+----------------------------------------------
+
diff --git a/website/content/ChapterFour/0400~0499/0417.Pacific-Atlantic-Water-Flow.md b/website/content/ChapterFour/0400~0499/0417.Pacific-Atlantic-Water-Flow.md
new file mode 100644
index 000000000..c19fb8751
--- /dev/null
+++ b/website/content/ChapterFour/0400~0499/0417.Pacific-Atlantic-Water-Flow.md
@@ -0,0 +1,99 @@
+# [417. Pacific Atlantic Water Flow](https://leetcode.com/problems/pacific-atlantic-water-flow/)
+
+
+## 题目
+
+Given an `m x n` matrix of non-negative integers representing the height of each unit cell in a continent, the "Pacific ocean" touches the left and top edges of the matrix and the "Atlantic ocean" touches the right and bottom edges.
+
+Water can only flow in four directions (up, down, left, or right) from a cell to another one with height equal or lower.
+
+Find the list of grid coordinates where water can flow to both the Pacific and Atlantic ocean.
+
+**Note:**
+
+1. The order of returned grid coordinates does not matter.
+2. Both m and n are less than 150.
+
+**Example:**
+
+```
+Given the following 5x5 matrix:
+
+ Pacific ~ ~ ~ ~ ~
+ ~ 1 2 2 3 (5) *
+ ~ 3 2 3 (4) (4) *
+ ~ 2 4 (5) 3 1 *
+ ~ (6) (7) 1 4 5 *
+ ~ (5) 1 1 2 4 *
+ * * * * * Atlantic
+
+Return:
+
+[[0, 4], [1, 3], [1, 4], [2, 2], [3, 0], [3, 1], [4, 0]] (positions with parentheses in above matrix).
+
+```
+
+## 题目大意
+
+给定一个 m x n 的非负整数矩阵来表示一片大陆上各个单元格的高度。“太平洋”处于大陆的左边界和上边界,而“大西洋”处于大陆的右边界和下边界。规定水流只能按照上、下、左、右四个方向流动,且只能从高到低或者在同等高度上流动。请找出那些水流既可以流动到“太平洋”,又能流动到“大西洋”的陆地单元的坐标。
+
+## 解题思路
+
+- 暴力解法,利用 DFS 把二维数据按照行优先搜索一遍,分别标记出太平洋和大西洋水流能到达的位置。再按照列优先搜索一遍,标记出太平洋和大西洋水流能到达的位置。最后两者都能到达的坐标即为所求。
+
+## 代码
+
+```go
+package leetcode
+
+import "math"
+
+func pacificAtlantic(matrix [][]int) [][]int {
+ if len(matrix) == 0 || len(matrix[0]) == 0 {
+ return nil
+ }
+ row, col, res := len(matrix), len(matrix[0]), make([][]int, 0)
+ pacific, atlantic := make([][]bool, row), make([][]bool, row)
+ for i := 0; i < row; i++ {
+ pacific[i] = make([]bool, col)
+ atlantic[i] = make([]bool, col)
+ }
+ for i := 0; i < row; i++ {
+ dfs(matrix, i, 0, &pacific, math.MinInt32)
+ dfs(matrix, i, col-1, &atlantic, math.MinInt32)
+ }
+ for j := 0; j < col; j++ {
+ dfs(matrix, 0, j, &pacific, math.MinInt32)
+ dfs(matrix, row-1, j, &atlantic, math.MinInt32)
+ }
+ for i := 0; i < row; i++ {
+ for j := 0; j < col; j++ {
+ if atlantic[i][j] && pacific[i][j] {
+ res = append(res, []int{i, j})
+ }
+ }
+ }
+ return res
+}
+
+func dfs(matrix [][]int, row, col int, visited *[][]bool, height int) {
+ if row < 0 || row >= len(matrix) || col < 0 || col >= len(matrix[0]) {
+ return
+ }
+ if (*visited)[row][col] || matrix[row][col] < height {
+ return
+ }
+ (*visited)[row][col] = true
+ dfs(matrix, row+1, col, visited, matrix[row][col])
+ dfs(matrix, row-1, col, visited, matrix[row][col])
+ dfs(matrix, row, col+1, visited, matrix[row][col])
+ dfs(matrix, row, col-1, visited, matrix[row][col])
+}
+```
+
+
+----------------------------------------------
+
diff --git a/website/content/ChapterFour/0400~0499/0419.Battleships-in-a-Board.md b/website/content/ChapterFour/0400~0499/0419.Battleships-in-a-Board.md
new file mode 100644
index 000000000..505b3ab0a
--- /dev/null
+++ b/website/content/ChapterFour/0400~0499/0419.Battleships-in-a-Board.md
@@ -0,0 +1,58 @@
+# [419. Battleships in a Board](https://leetcode.com/problems/battleships-in-a-board/)
+
+## 题目
+
+Given an `m x n` matrix `board` where each cell is a battleship `'X'` or empty `'.'`, return the number of the **battleships** on `board`.
+
+**Battleships** can only be placed horizontally or vertically on `board`. In other words, they can only be made of the shape `1 x k` (`1` row, `k` columns) or `k x 1` (`k` rows, `1` column), where `k` can be of any size. At least one horizontal or vertical cell separates between two battleships (i.e., there are no adjacent battleships).
+
+**Example 1:**
+
+
+
+```c
+Input: board = [["X",".",".","X"],[".",".",".","X"],[".",".",".","X"]]
+Output: 2
+```
+
+**Example 2:**
+
+```c
+Input: board = [["."]]
+Output: 0
+```
+
+**Constraints:**
+
+- `m == board.length`
+- `n == board[i].length`
+- `1 <= m, n <= 200`
+- `board[i][j] is either '.' or 'X'`.
+
+**Follow up:** Could you do it in one-pass, using only `O(1)` extra memory and without modifying the values `board`?
+
+## 题目大意
+
+给定一个大小为`m × n`的矩阵 称之为甲板,矩阵单元格中的`'X'`表示战舰,`'.'`表示空位。
+
+战舰只能水平或竖直摆放在甲板上(换句话说,可以理解为联通的同一行`'X'`或同一列`'X'`只算作一个“战舰群”),任意俩个“战舰群”间都是不相邻的。返回甲板上“战舰群”的数量。
+
+## 解题思路
+
+题目进阶要求一次扫描算法,空间复杂度为`O(1)`,且不能修改矩阵中的值。
+
+因为题目中给定的两个“战舰群”间至少有一个水平或垂直的空位分隔,所以可以通过枚举每个战舰的左上顶点即可统计“战舰群”的个数。
+
+假设当前遍历到矩阵中`'X'`的位置为`(i, j)`,即 `board[i][j]='X'`。如果当前战舰属于一个新的“战舰群”,则需要满足以下条件:
+
+- 当前位置的上方位为空,即 `board[i-1][j]='.'`;
+- 当前位置的左方位为空,即 `board[i][j-1]='.'`;
+
+统计出所有左方位和上方位为空的战舰个数,即可得到“战舰群”的数量。
+
+
+----------------------------------------------
+
diff --git a/website/content/ChapterFour/0421.Maximum-XOR-of-Two-Numbers-in-an-Array.md b/website/content/ChapterFour/0400~0499/0421.Maximum-XOR-of-Two-Numbers-in-an-Array.md
similarity index 92%
rename from website/content/ChapterFour/0421.Maximum-XOR-of-Two-Numbers-in-an-Array.md
rename to website/content/ChapterFour/0400~0499/0421.Maximum-XOR-of-Two-Numbers-in-an-Array.md
index e4c527b3e..7abc8d853 100755
--- a/website/content/ChapterFour/0421.Maximum-XOR-of-Two-Numbers-in-an-Array.md
+++ b/website/content/ChapterFour/0400~0499/0421.Maximum-XOR-of-Two-Numbers-in-an-Array.md
@@ -96,4 +96,11 @@ func findMaximumXOR1(nums []int) int {
return res
}
-```
\ No newline at end of file
+```
+
+
+----------------------------------------------
+
diff --git a/website/content/ChapterFour/0400~0499/0423.Reconstruct-Original-Digits-from-English.md b/website/content/ChapterFour/0400~0499/0423.Reconstruct-Original-Digits-from-English.md
new file mode 100644
index 000000000..81309c6a0
--- /dev/null
+++ b/website/content/ChapterFour/0400~0499/0423.Reconstruct-Original-Digits-from-English.md
@@ -0,0 +1,110 @@
+# [423. Reconstruct Original Digits from English](https://leetcode.com/problems/reconstruct-original-digits-from-english/)
+
+
+## 题目
+
+Given a **non-empty** string containing an out-of-order English representation of digits `0-9`, output the digits in ascending order.
+
+**Note:**
+
+1. Input contains only lowercase English letters.
+2. Input is guaranteed to be valid and can be transformed to its original digits. That means invalid inputs such as "abc" or "zerone" are not permitted.
+3. Input length is less than 50,000.
+
+**Example 1:**
+
+```
+Input: "owoztneoer"
+Output: "012"
+```
+
+**Example 2:**
+
+```
+Input: "fviefuro"
+Output: "45"
+```
+
+## 题目大意
+
+给定一个非空字符串,其中包含字母顺序打乱的英文单词表示的数字0-9。按升序输出原始的数字。
+
+注意:
+
+- 输入只包含小写英文字母。
+- 输入保证合法并可以转换为原始的数字,这意味着像 "abc" 或 "zerone" 的输入是不允许的。
+- 输入字符串的长度小于 50,000。
+
+## 解题思路
+
+- 这道题是一道找规律的题目。首先观察 0-9 对应的英文单词,找到特殊规律:所有的偶数都包含一个独特的字母:
+
+ `z` 只在 `zero` 中出现。
+
+ `w` 只在 `two` 中出现。
+
+ `u` 只在 `four` 中出现。
+
+ `x` 只在 `six` 中出现。
+
+ `g` 只在 `eight` 中出现。
+
+- 所以先排除掉这些偶数。然后在看剩下来几个数字对应的英文字母,这也是计算 3,5 和 7 的关键,因为有些单词只在一个奇数和一个偶数中出现(而且偶数已经被计算过了):
+
+ `h` 只在 `three` 和 `eight` 中出现。
+
+ `f` 只在 `five` 和 `four` 中出现。
+
+ `s` 只在 `seven` 和 `six` 中出现。
+
+- 接下来只需要处理 9 和 0,思路依然相同。
+
+ `i` 在 `nine`,`five`,`six` 和 `eight` 中出现。
+
+ `n` 在 `one`,`seven` 和 `nine` 中出现。
+
+- 最后按照上述的优先级,依次消耗对应的英文字母,生成最终的原始数字。注意按照优先级换算数字的时候,注意有多个重复数字的情况,比如多个 `1`,多个 `5` 等等。
+
+## 代码
+
+```go
+package leetcode
+
+import (
+ "strings"
+)
+
+func originalDigits(s string) string {
+ digits := make([]int, 26)
+ for i := 0; i < len(s); i++ {
+ digits[int(s[i]-'a')]++
+ }
+ res := make([]string, 10)
+ res[0] = convert('z', digits, "zero", "0")
+ res[6] = convert('x', digits, "six", "6")
+ res[2] = convert('w', digits, "two", "2")
+ res[4] = convert('u', digits, "four", "4")
+ res[5] = convert('f', digits, "five", "5")
+ res[1] = convert('o', digits, "one", "1")
+ res[7] = convert('s', digits, "seven", "7")
+ res[3] = convert('r', digits, "three", "3")
+ res[8] = convert('t', digits, "eight", "8")
+ res[9] = convert('i', digits, "nine", "9")
+ return strings.Join(res, "")
+}
+
+func convert(b byte, digits []int, s string, num string) string {
+ v := digits[int(b-'a')]
+ for i := 0; i < len(s); i++ {
+ digits[int(s[i]-'a')] -= v
+ }
+ return strings.Repeat(num, v)
+}
+```
+
+
+----------------------------------------------
+
diff --git a/website/content/ChapterFour/0424.Longest-Repeating-Character-Replacement.md b/website/content/ChapterFour/0400~0499/0424.Longest-Repeating-Character-Replacement.md
similarity index 83%
rename from website/content/ChapterFour/0424.Longest-Repeating-Character-Replacement.md
rename to website/content/ChapterFour/0400~0499/0424.Longest-Repeating-Character-Replacement.md
index 8e54fbcc6..d9cc7cbe1 100644
--- a/website/content/ChapterFour/0424.Longest-Repeating-Character-Replacement.md
+++ b/website/content/ChapterFour/0400~0499/0424.Longest-Repeating-Character-Replacement.md
@@ -82,4 +82,11 @@ func max(a int, b int) int {
return b
}
-```
\ No newline at end of file
+```
+
+
+----------------------------------------------
+
diff --git a/website/content/ChapterFour/0400~0499/0429.N-ary-Tree-Level-Order-Traversal.md b/website/content/ChapterFour/0400~0499/0429.N-ary-Tree-Level-Order-Traversal.md
new file mode 100644
index 000000000..ac4fe90a2
--- /dev/null
+++ b/website/content/ChapterFour/0400~0499/0429.N-ary-Tree-Level-Order-Traversal.md
@@ -0,0 +1,92 @@
+# [429.N-ary Tree Level Order Traversal](https://leetcode.com/problems/n-ary-tree-level-order-traversal/)
+
+
+## 题目
+
+Given an n-ary tree, return the *level order* traversal of its nodes' values.
+
+*Nary-Tree input serialization is represented in their level order traversal, each group of children is separated by the null value (See examples).*
+
+**Example 1:**
+
+
+
+```
+Input: root = [1,null,3,2,4,null,5,6]
+Output: [[1],[3,2,4],[5,6]]
+
+```
+
+**Example 2:**
+
+
+
+```
+Input: root = [1,null,2,3,4,5,null,null,6,7,null,8,null,9,10,null,null,11,null,12,null,13,null,null,14]
+Output: [[1],[2,3,4,5],[6,7,8,9,10],[11,12,13],[14]]
+
+```
+
+**Constraints:**
+
+- The height of the n-ary tree is less than or equal to `1000`
+- The total number of nodes is between `[0, 104]`
+
+## 题目大意
+
+给定一个 N 叉树,返回其节点值的层序遍历。(即从左到右,逐层遍历)。树的序列化输入是用层序遍历,每组子节点都由 null 值分隔(参见示例)。
+
+## 解题思路
+
+- 这是 n 叉树的系列题,第 589 题也是这一系列的题目。这一题思路不难,既然是层序遍历,用 BFS 解答。
+
+## 代码
+
+```go
+package leetcode
+
+/**
+ * Definition for a Node.
+ * type Node struct {
+ * Val int
+ * Children []*Node
+ * }
+ */
+
+type Node struct {
+ Val int
+ Children []*Node
+}
+
+func levelOrder(root *Node) [][]int {
+ var res [][]int
+ var temp []int
+ if root == nil {
+ return res
+ }
+ queue := []*Node{root, nil}
+ for len(queue) > 1 {
+ node := queue[0]
+ queue = queue[1:]
+ if node == nil {
+ queue = append(queue, nil)
+ res = append(res, temp)
+ temp = []int{}
+ } else {
+ temp = append(temp, node.Val)
+ if len(node.Children) > 0 {
+ queue = append(queue, node.Children...)
+ }
+ }
+ }
+ res = append(res, temp)
+ return res
+}
+```
+
+
+----------------------------------------------
+
diff --git a/website/content/ChapterFour/0433.Minimum-Genetic-Mutation.md b/website/content/ChapterFour/0400~0499/0433.Minimum-Genetic-Mutation.md
similarity index 91%
rename from website/content/ChapterFour/0433.Minimum-Genetic-Mutation.md
rename to website/content/ChapterFour/0400~0499/0433.Minimum-Genetic-Mutation.md
index 8fea5ecf6..566f2afde 100755
--- a/website/content/ChapterFour/0433.Minimum-Genetic-Mutation.md
+++ b/website/content/ChapterFour/0400~0499/0433.Minimum-Genetic-Mutation.md
@@ -180,4 +180,11 @@ func convert(gene string) uint32 {
return v
}
-```
\ No newline at end of file
+```
+
+
+----------------------------------------------
+
diff --git a/website/content/ChapterFour/0400~0499/0434.Number-of-Segments-in-a-String.md b/website/content/ChapterFour/0400~0499/0434.Number-of-Segments-in-a-String.md
new file mode 100644
index 000000000..71d45b7d7
--- /dev/null
+++ b/website/content/ChapterFour/0400~0499/0434.Number-of-Segments-in-a-String.md
@@ -0,0 +1,77 @@
+# [434. Number of Segments in a String](https://leetcode.com/problems/number-of-segments-in-a-string/)
+
+
+## 题目
+
+You are given a string s, return the number of segments in the string.
+
+A segment is defined to be a contiguous sequence of non-space characters.
+
+**Example 1:**
+
+ Input: s = "Hello, my name is John"
+ Output: 5
+ Explanation: The five segments are ["Hello,", "my", "name", "is", "John"]
+
+**Example 2:**
+
+ Input: s = "Hello"
+ Output: 1
+
+**Example 3:**
+
+ Input: s = "love live! mu'sic forever"
+ Output: 4
+
+**Example 4:**
+
+ Input: s = ""
+ Output: 0
+
+**Constraints**
+
+ - 0 <= s.length <= 300
+ - s consists of lower-case and upper-case English letters, digits or one of the following characters "!@#$%^&*()_+-=',.:".
+ - The only space character in s is ' '.
+
+## 题目大意
+
+统计字符串中的单词个数,这里的单词指的是连续的不是空格的字符。
+
+请注意,你可以假定字符串里不包括任何不可打印的字符。
+
+## 解题思路
+
+- 以空格为分割计算元素个数
+
+## 代码
+
+```go
+
+package leetcode
+
+func countSegments(s string) int {
+ segments := false
+ cnt := 0
+ for _, v := range s {
+ if v == ' ' && segments {
+ segments = false
+ cnt += 1
+ } else if v != ' ' {
+ segments = true
+ }
+ }
+ if segments {
+ cnt++
+ }
+ return cnt
+}
+
+```
+
+
+----------------------------------------------
+
diff --git a/website/content/ChapterFour/0435.Non-overlapping-Intervals.md b/website/content/ChapterFour/0400~0499/0435.Non-overlapping-Intervals.md
similarity index 89%
rename from website/content/ChapterFour/0435.Non-overlapping-Intervals.md
rename to website/content/ChapterFour/0400~0499/0435.Non-overlapping-Intervals.md
index ff8c90743..17d409ac3 100755
--- a/website/content/ChapterFour/0435.Non-overlapping-Intervals.md
+++ b/website/content/ChapterFour/0400~0499/0435.Non-overlapping-Intervals.md
@@ -132,4 +132,11 @@ func eraseOverlapIntervals1(intervals [][]int) int {
return len(intervals) - res
}
-```
\ No newline at end of file
+```
+
+
+----------------------------------------------
+
diff --git a/website/content/ChapterFour/0436.Find-Right-Interval.md b/website/content/ChapterFour/0400~0499/0436.Find-Right-Interval.md
similarity index 92%
rename from website/content/ChapterFour/0436.Find-Right-Interval.md
rename to website/content/ChapterFour/0400~0499/0436.Find-Right-Interval.md
index 2bb73c8d2..d8b2d726f 100755
--- a/website/content/ChapterFour/0436.Find-Right-Interval.md
+++ b/website/content/ChapterFour/0400~0499/0436.Find-Right-Interval.md
@@ -139,4 +139,11 @@ func searchFirstGreaterInterval(nums []Interval, target int) int {
return -1
}
-```
\ No newline at end of file
+```
+
+
+----------------------------------------------
+
diff --git a/website/content/ChapterFour/0400~0499/0437.Path-Sum-III.md b/website/content/ChapterFour/0400~0499/0437.Path-Sum-III.md
new file mode 100755
index 000000000..cf8405325
--- /dev/null
+++ b/website/content/ChapterFour/0400~0499/0437.Path-Sum-III.md
@@ -0,0 +1,127 @@
+# [437. Path Sum III](https://leetcode.com/problems/path-sum-iii/)
+
+
+## 题目
+
+Given the `root` of a binary tree and an integer `targetSum`, return *the number of paths where the sum of the values along the path equals* `targetSum`.
+
+The path does not need to start or end at the root or a leaf, but it must go downwards (i.e., traveling only from parent nodes to child nodes).
+
+**Example 1:**
+
+
+
+```
+Input: root = [10,5,-3,3,2,null,11,3,-2,null,1], targetSum = 8
+Output: 3
+Explanation: The paths that sum to 8 are shown.
+
+```
+
+**Example 2:**
+
+```
+Input: root = [5,4,8,11,null,13,4,7,2,null,null,5,1], targetSum = 22
+Output: 3
+
+```
+
+**Constraints:**
+
+- The number of nodes in the tree is in the range `[0, 1000]`.
+- `109 <= Node.val <= 109`
+- `1000 <= targetSum <= 1000`
+
+## 题目大意
+
+给定一个二叉树,它的每个结点都存放着一个整数值。找出路径和等于给定数值的路径总数。路径不需要从根节点开始,也不需要在叶子节点结束,但是路径方向必须是向下的(只能从父节点到子节点)。二叉树不超过1000个节点,且节点数值范围是 [-1000000,1000000] 的整数。
+
+
+## 解题思路
+
+
+- 这一题是第 112 题 Path Sum 和第 113 题 Path Sum II 的加强版,这一题要求求出任意一条路径的和为 sum,起点不一定是根节点,可以是任意节点开始。
+- 注意这一题可能出现负数的情况,节点和为 sum,并不一定是最终情况,有可能下面还有正数节点和负数节点相加正好为 0,那么这也是一种情况。一定要遍历到底。
+- 一个点是否为 sum 的起点,有 3 种情况,第一种情况路径包含该 root 节点,如果包含该结点,就在它的左子树和右子树中寻找和为 `sum-root.Val` 的情况。第二种情况路径不包含该 root 节点,那么就需要在它的左子树和右子树中分别寻找和为 sum 的结点。
+
+
+
+## 代码
+
+```go
+
+package leetcode
+
+import (
+ "github.com/halfrost/leetcode-go/structures"
+)
+
+// TreeNode define
+type TreeNode = structures.TreeNode
+
+/**
+ * Definition for a binary tree node.
+ * type TreeNode struct {
+ * Val int
+ * Left *TreeNode
+ * Right *TreeNode
+ * }
+ */
+
+// 解法一 带缓存 dfs
+func pathSum(root *TreeNode, targetSum int) int {
+ prefixSum := make(map[int]int)
+ prefixSum[0] = 1
+ return dfs(root, prefixSum, 0, targetSum)
+}
+
+func dfs(root *TreeNode, prefixSum map[int]int, cur, sum int) int {
+ if root == nil {
+ return 0
+ }
+ cur += root.Val
+ cnt := 0
+ if v, ok := prefixSum[cur-sum]; ok {
+ cnt = v
+ }
+ prefixSum[cur]++
+ cnt += dfs(root.Left, prefixSum, cur, sum)
+ cnt += dfs(root.Right, prefixSum, cur, sum)
+ prefixSum[cur]--
+ return cnt
+}
+
+// 解法二
+func pathSumIII(root *TreeNode, sum int) int {
+ if root == nil {
+ return 0
+ }
+ res := findPath437(root, sum)
+ res += pathSumIII(root.Left, sum)
+ res += pathSumIII(root.Right, sum)
+ return res
+}
+
+// 寻找包含 root 这个结点,且和为 sum 的路径
+func findPath437(root *TreeNode, sum int) int {
+ if root == nil {
+ return 0
+ }
+ res := 0
+ if root.Val == sum {
+ res++
+ }
+ res += findPath437(root.Left, sum-root.Val)
+ res += findPath437(root.Right, sum-root.Val)
+ return res
+}
+
+
+```
+
+
+----------------------------------------------
+
diff --git a/website/content/ChapterFour/0438.Find-All-Anagrams-in-a-String.md b/website/content/ChapterFour/0400~0499/0438.Find-All-Anagrams-in-a-String.md
similarity index 88%
rename from website/content/ChapterFour/0438.Find-All-Anagrams-in-a-String.md
rename to website/content/ChapterFour/0400~0499/0438.Find-All-Anagrams-in-a-String.md
index c422dbb1b..93d240934 100644
--- a/website/content/ChapterFour/0438.Find-All-Anagrams-in-a-String.md
+++ b/website/content/ChapterFour/0400~0499/0438.Find-All-Anagrams-in-a-String.md
@@ -103,4 +103,11 @@ func findAnagrams(s string, p string) []int {
return result
}
-```
\ No newline at end of file
+```
+
+
+----------------------------------------------
+
diff --git a/website/content/ChapterFour/0441.Arranging-Coins.md b/website/content/ChapterFour/0400~0499/0441.Arranging-Coins.md
similarity index 80%
rename from website/content/ChapterFour/0441.Arranging-Coins.md
rename to website/content/ChapterFour/0400~0499/0441.Arranging-Coins.md
index d76eb6264..33fdee75b 100755
--- a/website/content/ChapterFour/0441.Arranging-Coins.md
+++ b/website/content/ChapterFour/0400~0499/0441.Arranging-Coins.md
@@ -72,4 +72,11 @@ func arrangeCoins1(n int) int {
return k - 1
}
-```
\ No newline at end of file
+```
+
+
+----------------------------------------------
+
diff --git a/website/content/ChapterFour/0400~0499/0445.Add-Two-Numbers-II.md b/website/content/ChapterFour/0400~0499/0445.Add-Two-Numbers-II.md
new file mode 100644
index 000000000..a4156c6fb
--- /dev/null
+++ b/website/content/ChapterFour/0400~0499/0445.Add-Two-Numbers-II.md
@@ -0,0 +1,188 @@
+# [445. Add Two Numbers II](https://leetcode.com/problems/add-two-numbers-ii/)
+
+## 题目
+
+You are given two non-empty linked lists representing two non-negative integers. The most significant digit comes first and each of their nodes contain a single digit. Add the two numbers and return it as a linked list.
+
+You may assume the two numbers do not contain any leading zero, except the number 0 itself.
+
+**Follow up**:
+What if you cannot modify the input lists? In other words, reversing the lists is not allowed.
+
+**Example**:
+
+```
+
+Input: (7 -> 2 -> 4 -> 3) + (5 -> 6 -> 4)
+Output: 7 -> 8 -> 0 -> 7
+
+```
+
+## 题目大意
+
+这道题是第 2 题的变种题,第 2 题中的 2 个数是从个位逆序排到高位,这样相加只用从头交到尾,进位一直进位即可。这道题目中强制要求不能把链表逆序。2 个数字是从高位排到低位的,这样进位是倒着来的。
+
+## 解题思路
+
+思路也不难,加法只用把短的链表依次加到长的链表上面来就可以了,最终判断一下最高位有没有进位,有进位再往前进一位。加法的过程可以用到递归。
+
+## 代码
+
+```go
+
+package leetcode
+
+/**
+ * Definition for singly-linked list.
+ * type ListNode struct {
+ * Val int
+ * Next *ListNode
+ * }
+ */
+package leetcode
+
+import (
+ "github.com/halfrost/leetcode-go/structures"
+)
+
+// ListNode define
+type ListNode = structures.ListNode
+
+/**
+ * Definition for singly-linked list.
+ * type ListNode struct {
+ * Val int
+ * Next *ListNode
+ * }
+ */
+func addTwoNumbers445(l1 *ListNode, l2 *ListNode) *ListNode {
+ if l1 == nil {
+ return l2
+ }
+ if l2 == nil {
+ return l1
+ }
+ l1Length := getLength(l1)
+ l2Length := getLength(l2)
+ newHeader := &ListNode{Val: 1, Next: nil}
+ if l1Length < l2Length {
+ newHeader.Next = addNode(l2, l1, l2Length-l1Length)
+ } else {
+ newHeader.Next = addNode(l1, l2, l1Length-l2Length)
+ }
+ if newHeader.Next.Val > 9 {
+ newHeader.Next.Val = newHeader.Next.Val % 10
+ return newHeader
+ }
+ return newHeader.Next
+}
+
+func addNode(l1 *ListNode, l2 *ListNode, offset int) *ListNode {
+ if l1 == nil {
+ return nil
+ }
+ var (
+ res, node *ListNode
+ )
+ if offset == 0 {
+ res = &ListNode{Val: l1.Val + l2.Val, Next: nil}
+ node = addNode(l1.Next, l2.Next, 0)
+ } else {
+ res = &ListNode{Val: l1.Val, Next: nil}
+ node = addNode(l1.Next, l2, offset-1)
+ }
+ if node != nil && node.Val > 9 {
+ res.Val++
+ node.Val = node.Val % 10
+ }
+ res.Next = node
+ return res
+}
+
+func getLength(l *ListNode) int {
+ count := 0
+ cur := l
+ for cur != nil {
+ count++
+ cur = cur.Next
+ }
+ return count
+}
+
+func addTwoNumbers1(l1 *ListNode, l2 *ListNode) *ListNode {
+ reservedL1 := reverseList(l1)
+ reservedL2 := reverseList(l2)
+
+ dummyHead := &ListNode{}
+ head := dummyHead
+ carry := 0
+ for reservedL1 != nil || reservedL2 != nil || carry > 0 {
+ val := carry
+ if reservedL1 != nil {
+ val = reservedL1.Val + val
+ reservedL1 = reservedL1.Next
+ }
+ if reservedL2 != nil {
+ val = reservedL2.Val + val
+ reservedL2 = reservedL2.Next
+ }
+ carry = val / 10
+ head.Next = &ListNode{Val: val % 10}
+ head = head.Next
+ }
+ return reverseList(dummyHead.Next)
+}
+
+func reverseList(head *ListNode) *ListNode {
+ var prev *ListNode
+ for head != nil {
+ tmp := head.Next
+ head.Next = prev
+
+ prev = head
+ head = tmp
+ }
+ return prev
+}
+
+func addTwoNumbers(l1 *ListNode, l2 *ListNode) *ListNode {
+ stack1 := pushStack(l1)
+ stack2 := pushStack(l2)
+
+ dummyHead := &ListNode{}
+ head := dummyHead
+ carry := 0
+ for len(stack1) > 0 || len(stack2) > 0 || carry > 0 {
+ val := carry
+ if len(stack1) > 0 {
+ val = val + stack1[len(stack1)-1]
+ stack1 = stack1[:len(stack1)-1]
+ }
+ if len(stack2) > 0 {
+ val = val + stack2[len(stack2)-1]
+ stack2 = stack2[:len(stack2)-1]
+ }
+ carry = val / 10
+ tmp := head.Next
+ head.Next = &ListNode{Val: val % 10, Next: tmp}
+ }
+ return dummyHead.Next
+}
+
+func pushStack(l *ListNode) []int {
+ var stack []int
+ for l != nil {
+ stack = append(stack, l.Val)
+ l = l.Next
+ }
+ return stack
+}
+
+```
+
+
+----------------------------------------------
+
diff --git a/website/content/ChapterFour/0447.Number-of-Boomerangs.md b/website/content/ChapterFour/0400~0499/0447.Number-of-Boomerangs.md
similarity index 83%
rename from website/content/ChapterFour/0447.Number-of-Boomerangs.md
rename to website/content/ChapterFour/0400~0499/0447.Number-of-Boomerangs.md
index 332a6a3e6..33f3c1fd9 100644
--- a/website/content/ChapterFour/0447.Number-of-Boomerangs.md
+++ b/website/content/ChapterFour/0400~0499/0447.Number-of-Boomerangs.md
@@ -63,4 +63,11 @@ func dis(pa, pb []int) int {
return (pa[0]-pb[0])*(pa[0]-pb[0]) + (pa[1]-pb[1])*(pa[1]-pb[1])
}
-```
\ No newline at end of file
+```
+
+
+----------------------------------------------
+
diff --git a/website/content/ChapterFour/0448.Find-All-Numbers-Disappeared-in-an-Array.md b/website/content/ChapterFour/0400~0499/0448.Find-All-Numbers-Disappeared-in-an-Array.md
similarity index 83%
rename from website/content/ChapterFour/0448.Find-All-Numbers-Disappeared-in-an-Array.md
rename to website/content/ChapterFour/0400~0499/0448.Find-All-Numbers-Disappeared-in-an-Array.md
index ec98b0b4a..29532c7ef 100644
--- a/website/content/ChapterFour/0448.Find-All-Numbers-Disappeared-in-an-Array.md
+++ b/website/content/ChapterFour/0400~0499/0448.Find-All-Numbers-Disappeared-in-an-Array.md
@@ -54,4 +54,11 @@ func findDisappearedNumbers(nums []int) []int {
return res
}
-```
\ No newline at end of file
+```
+
+
+----------------------------------------------
+
diff --git a/website/content/ChapterFour/0451.Sort-Characters-By-Frequency.md b/website/content/ChapterFour/0400~0499/0451.Sort-Characters-By-Frequency.md
similarity index 80%
rename from website/content/ChapterFour/0451.Sort-Characters-By-Frequency.md
rename to website/content/ChapterFour/0400~0499/0451.Sort-Characters-By-Frequency.md
index 58558d7f3..81a8d91a0 100644
--- a/website/content/ChapterFour/0451.Sort-Characters-By-Frequency.md
+++ b/website/content/ChapterFour/0400~0499/0451.Sort-Characters-By-Frequency.md
@@ -110,4 +110,11 @@ func frequencySort(s string) string {
return string(res)
}
-```
\ No newline at end of file
+```
+
+
+----------------------------------------------
+
diff --git a/website/content/ChapterFour/0453.Minimum-Moves-to-Equal-Array-Elements.md b/website/content/ChapterFour/0400~0499/0453.Minimum-Moves-to-Equal-Array-Elements.md
similarity index 80%
rename from website/content/ChapterFour/0453.Minimum-Moves-to-Equal-Array-Elements.md
rename to website/content/ChapterFour/0400~0499/0453.Minimum-Moves-to-Equal-Array-Elements.md
index 280f22a25..f868c33a3 100644
--- a/website/content/ChapterFour/0453.Minimum-Moves-to-Equal-Array-Elements.md
+++ b/website/content/ChapterFour/0400~0499/0453.Minimum-Moves-to-Equal-Array-Elements.md
@@ -48,4 +48,11 @@ func minMoves(nums []int) int {
return sum - min*l
}
-```
\ No newline at end of file
+```
+
+
+----------------------------------------------
+
diff --git a/website/content/ChapterFour/0454.4Sum-II.md b/website/content/ChapterFour/0400~0499/0454.4Sum-II.md
similarity index 80%
rename from website/content/ChapterFour/0454.4Sum-II.md
rename to website/content/ChapterFour/0400~0499/0454.4Sum-II.md
index 6a60ecf1e..bccad3d5a 100644
--- a/website/content/ChapterFour/0454.4Sum-II.md
+++ b/website/content/ChapterFour/0400~0499/0454.4Sum-II.md
@@ -23,7 +23,7 @@ Explanation:
The two tuples are:
1. (0, 0, 0, 1) -> A[0] + B[0] + C[0] + D[1] = 1 + (-2) + (-1) + 2 = 0
2. (1, 1, 0, 0) -> A[1] + B[1] + C[0] + D[0] = 2 + (-1) + (-1) + 0 = 0
-3.
+
```
@@ -62,4 +62,11 @@ func fourSumCount(A []int, B []int, C []int, D []int) int {
return ret
}
-```
\ No newline at end of file
+```
+
+
+----------------------------------------------
+
diff --git a/website/content/ChapterFour/0455.Assign-Cookies.md b/website/content/ChapterFour/0400~0499/0455.Assign-Cookies.md
similarity index 88%
rename from website/content/ChapterFour/0455.Assign-Cookies.md
rename to website/content/ChapterFour/0400~0499/0455.Assign-Cookies.md
index 4efda7a80..dfd13b3a0 100755
--- a/website/content/ChapterFour/0455.Assign-Cookies.md
+++ b/website/content/ChapterFour/0400~0499/0455.Assign-Cookies.md
@@ -66,4 +66,11 @@ func findContentChildren(g []int, s []int) int {
return res
}
-```
\ No newline at end of file
+```
+
+
+----------------------------------------------
+
diff --git a/website/content/ChapterFour/0456.132-Pattern.md b/website/content/ChapterFour/0400~0499/0456.132-Pattern.md
similarity index 85%
rename from website/content/ChapterFour/0456.132-Pattern.md
rename to website/content/ChapterFour/0400~0499/0456.132-Pattern.md
index 382c27208..abd44ce62 100755
--- a/website/content/ChapterFour/0456.132-Pattern.md
+++ b/website/content/ChapterFour/0400~0499/0456.132-Pattern.md
@@ -53,7 +53,6 @@ Given a sequence of n integers a1, a2, ..., an, a 132 pattern is a subsequence a
package leetcode
import (
- "fmt"
"math"
)
@@ -72,7 +71,6 @@ func find132pattern(nums []int) bool {
stack = stack[:len(stack)-1]
}
stack = append(stack, nums[i])
- fmt.Printf("stack = %v \n", stack)
}
return false
}
@@ -100,4 +98,11 @@ func find132pattern1(nums []int) bool {
return false
}
-```
\ No newline at end of file
+```
+
+
+----------------------------------------------
+
diff --git a/website/content/ChapterFour/0457.Circular-Array-Loop.md b/website/content/ChapterFour/0400~0499/0457.Circular-Array-Loop.md
similarity index 92%
rename from website/content/ChapterFour/0457.Circular-Array-Loop.md
rename to website/content/ChapterFour/0400~0499/0457.Circular-Array-Loop.md
index 89756b228..d43a50e6e 100755
--- a/website/content/ChapterFour/0457.Circular-Array-Loop.md
+++ b/website/content/ChapterFour/0400~0499/0457.Circular-Array-Loop.md
@@ -101,4 +101,11 @@ func getNextIndex(nums []int, index int) int {
return ((nums[index]+index)%len(nums) + len(nums)) % len(nums)
}
-```
\ No newline at end of file
+```
+
+
+----------------------------------------------
+
diff --git a/website/content/ChapterFour/0400~0499/0458.Poor-Pigs.md b/website/content/ChapterFour/0400~0499/0458.Poor-Pigs.md
new file mode 100644
index 000000000..dcccfda06
--- /dev/null
+++ b/website/content/ChapterFour/0400~0499/0458.Poor-Pigs.md
@@ -0,0 +1,84 @@
+# [458. Poor Pigs](https://leetcode.com/problems/poor-pigs/)
+
+## 题目
+
+There are buckets buckets of liquid, where exactly one of the buckets is poisonous. To figure out which one is poisonous, you feed some number of (poor) pigs the liquid to see whether they will die or not. Unfortunately, you only have minutesToTest minutes to determine which bucket is poisonous.
+
+You can feed the pigs according to these steps:
+
+- Choose some live pigs to feed.
+- For each pig, choose which buckets to feed it. The pig will consume all the chosen buckets simultaneously and will take no time.
+- Wait for minutesToDie minutes. You may not feed any other pigs during this time.
+- After minutesToDie minutes have passed, any pigs that have been fed the poisonous bucket will die, and all others will survive.
+- Repeat this process until you run out of time.
+
+Given buckets, minutesToDie, and minutesToTest, return the minimum number of pigs needed to figure out which bucket is poisonous within the allotted time.
+
+**Example 1**:
+
+ Input: buckets = 1000, minutesToDie = 15, minutesToTest = 60
+ Output: 5
+
+**Example 2**:
+
+ Input: buckets = 4, minutesToDie = 15, minutesToTest = 15
+ Output: 2
+
+**Example 3**:
+
+ Input: buckets = 4, minutesToDie = 15, minutesToTest = 30
+ Output: 2
+
+**Constraints:**
+
+- 1 <= buckets <= 1000
+- 1 <= minutesToDie <= minutesToTest <= 100
+
+## 题目大意
+
+有 buckets 桶液体,其中 正好 有一桶含有毒药,其余装的都是水。它们从外观看起来都一样。为了弄清楚哪只水桶含有毒药,你可以喂一些猪喝,通过观察猪是否会死进行判断。不幸的是,你只有 minutesToTest 分钟时间来确定哪桶液体是有毒的。
+
+喂猪的规则如下:
+
+- 选择若干活猪进行喂养
+- 可以允许小猪同时饮用任意数量的桶中的水,并且该过程不需要时间。
+- 小猪喝完水后,必须有 minutesToDie 分钟的冷却时间。在这段时间里,你只能观察,而不允许继续喂猪。
+- 过了 minutesToDie 分钟后,所有喝到毒药的猪都会死去,其他所有猪都会活下来。
+- 重复这一过程,直到时间用完。
+
+给你桶的数目 buckets ,minutesToDie 和 minutesToTest ,返回在规定时间内判断哪个桶有毒所需的 最小 猪数。
+
+## 解题思路
+
+使用数学方法,以 minutesToDie=15, minutesToTest=60, 1 只小猪为例,可以测试 5 只桶
+
+- 0-15 小猪吃第一个桶中的液体,如果死去,则第一个桶有毒,否则继续测试
+- 15-30 小猪吃第二个桶中的液体,如果死去,则第二个桶有毒,否则继续测试
+- 30-45 小猪吃第三个桶中的液体,如果死去,则第三个桶有毒,否则继续测试
+- 45-60 小猪吃第四个桶中的液体,如果死去,则第四个桶有毒
+- 如果最后小猪没有死去,则第五个桶有毒
+
+所以一只小猪在 minutesToDie 和 minutesToTest 时间一定的情况下可以最多判断 base = minutesToTest / minutesToDie + 1 个桶
+
+假设小猪的数量是 num,那么 pow(base, num) >= buckets,根据对数运算规则,两边分别取对数得到: num >= Log10(buckets) / Log10(base)
+
+## 代码
+
+```go
+
+package leetcode
+
+import "math"
+
+func poorPigs(buckets int, minutesToDie int, minutesToTest int) int {
+ base := minutesToTest/minutesToDie + 1
+ return int(math.Ceil(math.Log10(float64(buckets)) / math.Log10(float64(base))))
+}
+```
+
+
+----------------------------------------------
+
diff --git a/website/content/ChapterFour/0400~0499/0460.LFU-Cache.md b/website/content/ChapterFour/0400~0499/0460.LFU-Cache.md
new file mode 100644
index 000000000..5692cc711
--- /dev/null
+++ b/website/content/ChapterFour/0400~0499/0460.LFU-Cache.md
@@ -0,0 +1,149 @@
+# [460. LFU Cache](https://leetcode.com/problems/lfu-cache/)
+
+
+## 题目
+
+Design and implement a data structure for [Least Frequently Used (LFU)](https://en.wikipedia.org/wiki/Least_frequently_used) cache.
+
+Implement the `LFUCache` class:
+
+- `LFUCache(int capacity)` Initializes the object with the `capacity` of the data structure.
+- `int get(int key)` Gets the value of the `key` if the `key` exists in the cache. Otherwise, returns `1`.
+- `void put(int key, int value)` Sets or inserts the value if the `key` is not already present. When the cache reaches its `capacity`, it should invalidate the least frequently used item before inserting a new item. For this problem, when there is a tie (i.e., two or more keys with the same frequency), **the least recently** used `key` would be evicted.
+
+**Notice that** the number of times an item is used is the number of calls to the `get` and `put` functions for that item since it was inserted. This number is set to zero when the item is removed.
+
+**Example 1**:
+
+```
+Input
+["LFUCache", "put", "put", "get", "put", "get", "get", "put", "get", "get", "get"]
+[[2], [1, 1], [2, 2], [1], [3, 3], [2], [3], [4, 4], [1], [3], [4]]
+Output
+[null, null, null, 1, null, -1, 3, null, -1, 3, 4]
+
+Explanation
+LFUCache lfu = new LFUCache(2);
+lfu.put(1, 1);
+lfu.put(2, 2);
+lfu.get(1); // return 1
+lfu.put(3, 3); // evicts key 2
+lfu.get(2); // return -1 (not found)
+lfu.get(3); // return 3
+lfu.put(4, 4); // evicts key 1.
+lfu.get(1); // return -1 (not found)
+lfu.get(3); // return 3
+lfu.get(4); // return 4
+
+```
+
+**Constraints**:
+
+- `0 <= capacity, key, value <= 104`
+- At most `10^5` calls will be made to `get` and `put`.
+
+**Follow up**: Could you do both operations in `O(1)` time complexity?
+
+## 题目大意
+
+请你为 最不经常使用(LFU)缓存算法设计并实现数据结构。
+
+实现 LFUCache 类:
+
+- LFUCache(int capacity) - 用数据结构的容量 capacity 初始化对象
+- int get(int key) - 如果键存在于缓存中,则获取键的值,否则返回 -1。
+- void put(int key, int value) - 如果键已存在,则变更其值;如果键不存在,请插入键值对。当缓存达到其容量时,则应该在插入新项之前,使最不经常使用的项无效。在此问题中,当存在平局(即两个或更多个键具有相同使用频率)时,应该去除 最久未使用 的键。
+
+注意「项的使用次数」就是自插入该项以来对其调用 get 和 put 函数的次数之和。使用次数会在对应项被移除后置为 0 。
+
+进阶:你是否可以在 O(1) 时间复杂度内执行两项操作?
+
+## 解题思路
+
+- 这一题是 LFU 经典面试题,详细解释见第三章模板。
+
+## 代码
+
+```go
+package leetcode
+
+import "container/list"
+
+type LFUCache struct {
+ nodes map[int]*list.Element
+ lists map[int]*list.List
+ capacity int
+ min int
+}
+
+type node struct {
+ key int
+ value int
+ frequency int
+}
+
+func Constructor(capacity int) LFUCache {
+ return LFUCache{nodes: make(map[int]*list.Element),
+ lists: make(map[int]*list.List),
+ capacity: capacity,
+ min: 0,
+ }
+}
+
+func (this *LFUCache) Get(key int) int {
+ value, ok := this.nodes[key]
+ if !ok {
+ return -1
+ }
+ currentNode := value.Value.(*node)
+ this.lists[currentNode.frequency].Remove(value)
+ currentNode.frequency++
+ if _, ok := this.lists[currentNode.frequency]; !ok {
+ this.lists[currentNode.frequency] = list.New()
+ }
+ newList := this.lists[currentNode.frequency]
+ newNode := newList.PushBack(currentNode)
+ this.nodes[key] = newNode
+ if currentNode.frequency-1 == this.min && this.lists[currentNode.frequency-1].Len() == 0 {
+ this.min++
+ }
+ return currentNode.value
+}
+
+func (this *LFUCache) Put(key int, value int) {
+ if this.capacity == 0 {
+ return
+ }
+ if currentValue, ok := this.nodes[key]; ok {
+ currentNode := currentValue.Value.(*node)
+ currentNode.value = value
+ this.Get(key)
+ return
+ }
+ if this.capacity == len(this.nodes) {
+ currentList := this.lists[this.min]
+ frontNode := currentList.Front()
+ delete(this.nodes, frontNode.Value.(*node).key)
+ currentList.Remove(frontNode)
+ }
+ this.min = 1
+ currentNode := &node{
+ key: key,
+ value: value,
+ frequency: 1,
+ }
+ if _, ok := this.lists[1]; !ok {
+ this.lists[1] = list.New()
+ }
+ newList := this.lists[1]
+ newNode := newList.PushBack(currentNode)
+ this.nodes[key] = newNode
+}
+```
+
+
+----------------------------------------------
+
diff --git a/website/content/ChapterFour/0461.Hamming-Distance.md b/website/content/ChapterFour/0400~0499/0461.Hamming-Distance.md
similarity index 76%
rename from website/content/ChapterFour/0461.Hamming-Distance.md
rename to website/content/ChapterFour/0400~0499/0461.Hamming-Distance.md
index 9d0d75c0b..c36e66eb7 100755
--- a/website/content/ChapterFour/0461.Hamming-Distance.md
+++ b/website/content/ChapterFour/0400~0499/0461.Hamming-Distance.md
@@ -50,4 +50,11 @@ func hammingDistance(x int, y int) int {
return distance
}
-```
\ No newline at end of file
+```
+
+
+----------------------------------------------
+
diff --git a/website/content/ChapterFour/0400~0499/0462.Minimum-Moves-to-Equal-Array-Elements-II.md b/website/content/ChapterFour/0400~0499/0462.Minimum-Moves-to-Equal-Array-Elements-II.md
new file mode 100644
index 000000000..c43b0bdeb
--- /dev/null
+++ b/website/content/ChapterFour/0400~0499/0462.Minimum-Moves-to-Equal-Array-Elements-II.md
@@ -0,0 +1,73 @@
+# [462. Minimum Moves to Equal Array Elements II](https://leetcode.com/problems/minimum-moves-to-equal-array-elements-ii/)
+
+
+## 题目
+
+Given an integer array `nums` of size `n`, return *the minimum number of moves required to make all array elements equal*.
+
+In one move, you can increment or decrement an element of the array by `1`.
+
+**Example 1:**
+
+```
+Input: nums = [1,2,3]
+Output: 2
+Explanation:
+Only two moves are needed (remember each move increments or decrements one element):
+[1,2,3] => [2,2,3] => [2,2,2]
+```
+
+**Example 2:**
+
+```
+Input: nums = [1,10,2,9]
+Output: 16
+```
+
+**Constraints:**
+
+- `n == nums.length`
+- `1 <= nums.length <= 10^5`
+- `109 <= nums[i] <= 10^9`
+
+## 题目大意
+
+给定一个非空整数数组,找到使所有数组元素相等所需的最小移动数,其中每次移动可将选定的一个元素加 1 或减 1。 您可以假设数组的长度最多为10000。
+
+## 解题思路
+
+- 这题抽象成数学问题是,如果我们把数组 a 中的每个数看成水平轴上的一个点,那么根据上面的移动次数公式,我们需要找到在水平轴上找到一个点 x,使得这 N 个点到 x 的距离之和最小。有 2 个点值得我们考虑,一个是中位数,另外一个是平均值。举个简单的例子,[1,0,0,8,6] 这组数据,中位数是 1,平均值是 3 。分别计算移动的步数,按照中位数对齐是 14,按照平均值对齐是 16 。所以选择中位数。
+- 此题可以用数学证明,证明出,按照平均值移动的步数 ≥ 按照中位数移动的步数。具体证明笔者这里不证明了,感兴趣的同学可以自己证明试试。
+
+## 代码
+
+```go
+package leetcode
+
+import (
+ "math"
+ "sort"
+)
+
+func minMoves2(nums []int) int {
+ if len(nums) == 0 {
+ return 0
+ }
+ moves, mid := 0, len(nums)/2
+ sort.Ints(nums)
+ for i := range nums {
+ if i == mid {
+ continue
+ }
+ moves += int(math.Abs(float64(nums[mid] - nums[i])))
+ }
+ return moves
+}
+```
+
+
+----------------------------------------------
+
diff --git a/website/content/ChapterFour/0463.Island-Perimeter.md b/website/content/ChapterFour/0400~0499/0463.Island-Perimeter.md
similarity index 83%
rename from website/content/ChapterFour/0463.Island-Perimeter.md
rename to website/content/ChapterFour/0400~0499/0463.Island-Perimeter.md
index 7a319887a..3ac220658 100755
--- a/website/content/ChapterFour/0463.Island-Perimeter.md
+++ b/website/content/ChapterFour/0400~0499/0463.Island-Perimeter.md
@@ -68,4 +68,11 @@ func islandPerimeter(grid [][]int) int {
return counter
}
-```
\ No newline at end of file
+```
+
+
+----------------------------------------------
+
diff --git a/website/content/ChapterFour/0470.Implement-Rand10-Using-Rand7.md b/website/content/ChapterFour/0400~0499/0470.Implement-Rand10-Using-Rand7.md
similarity index 90%
rename from website/content/ChapterFour/0470.Implement-Rand10-Using-Rand7.md
rename to website/content/ChapterFour/0400~0499/0470.Implement-Rand10-Using-Rand7.md
index 1c650ca33..3e3ac3826 100755
--- a/website/content/ChapterFour/0470.Implement-Rand10-Using-Rand7.md
+++ b/website/content/ChapterFour/0400~0499/0470.Implement-Rand10-Using-Rand7.md
@@ -97,4 +97,11 @@ func rand101() int {
return rand40%10 + 1
}
-```
\ No newline at end of file
+```
+
+
+----------------------------------------------
+
diff --git a/website/content/ChapterFour/0400~0499/0473.Matchsticks-to-Square.md b/website/content/ChapterFour/0400~0499/0473.Matchsticks-to-Square.md
new file mode 100644
index 000000000..5ac15f049
--- /dev/null
+++ b/website/content/ChapterFour/0400~0499/0473.Matchsticks-to-Square.md
@@ -0,0 +1,101 @@
+# [473. Matchsticks to Square](https://leetcode.com/problems/matchsticks-to-square/)
+
+
+## 题目
+
+You are given an integer array `matchsticks` where `matchsticks[i]` is the length of the `ith` matchstick. You want to use **all the matchsticks** to make one square. You **should not break** any stick, but you can link them up, and each matchstick must be used **exactly one time**.
+
+Return `true` if you can make this square and `false` otherwise.
+
+**Example 1:**
+
+
+
+```
+Input: matchsticks = [1,1,2,2,2]
+Output: true
+Explanation: You can form a square with length 2, one side of the square came two sticks with length 1.
+```
+
+**Example 2:**
+
+```
+Input: matchsticks = [3,3,3,3,4]
+Output: false
+Explanation: You cannot find a way to form a square with all the matchsticks.
+```
+
+**Constraints:**
+
+- `1 <= matchsticks.length <= 15`
+- `0 <= matchsticks[i] <= 109`
+
+## 题目大意
+
+现在已知小女孩有多少根火柴,请找出一种能使用所有火柴拼成一个正方形的方法。不能折断火柴,可以把火柴连接起来,并且每根火柴都要用到。输入为小女孩拥有火柴的数目,每根火柴用其长度表示。输出即为是否能用所有的火柴拼成正方形。
+
+## 解题思路
+
+- 将火柴拼成一个正方形,可以将它们分成四组,每一根火柴恰好属于其中的一组;并且每一组火柴的长度之和都相同,等于所有火柴长度之和的四分之一。
+- 考虑暴力解法,使用深度优先搜索枚举出所有的分组情况,并对于每一种情况,判断是否满足上述的两个条件(每根火柴属于其中一组,每组火柴长度之和相同)。依次对每一根火柴进行搜索,当搜索到第 i 根火柴时,可以考虑把它放到四组中的任意一种。对于每一种放置方法,继续对第 i + 1 根火柴进行深搜。当我们搜索完全部的 N 根火柴后,再判断每一组火柴的长度之和是否都相同。
+
+## 代码
+
+```go
+package leetcode
+
+import "sort"
+
+func makesquare(matchsticks []int) bool {
+ if len(matchsticks) < 4 {
+ return false
+ }
+ total := 0
+ for _, v := range matchsticks {
+ total += v
+ }
+ if total%4 != 0 {
+ return false
+ }
+ sort.Slice(matchsticks, func(i, j int) bool {
+ return matchsticks[i] > matchsticks[j]
+ })
+ visited := make([]bool, 16)
+ return dfs(matchsticks, 0, 0, 0, total, &visited)
+}
+
+func dfs(matchsticks []int, cur, group, sum, total int, visited *[]bool) bool {
+ if group == 4 {
+ return true
+ }
+ if sum > total/4 {
+ return false
+ }
+ if sum == total/4 {
+ return dfs(matchsticks, 0, group+1, 0, total, visited)
+ }
+ last := -1
+ for i := cur; i < len(matchsticks); i++ {
+ if (*visited)[i] {
+ continue
+ }
+ if last == matchsticks[i] {
+ continue
+ }
+ (*visited)[i] = true
+ last = matchsticks[i]
+ if dfs(matchsticks, i+1, group, sum+matchsticks[i], total, visited) {
+ return true
+ }
+ (*visited)[i] = false
+ }
+ return false
+}
+```
+
+
+----------------------------------------------
+
diff --git a/website/content/ChapterFour/0474.Ones-and-Zeroes.md b/website/content/ChapterFour/0400~0499/0474.Ones-and-Zeroes.md
similarity index 89%
rename from website/content/ChapterFour/0474.Ones-and-Zeroes.md
rename to website/content/ChapterFour/0400~0499/0474.Ones-and-Zeroes.md
index 65e293924..7cd4969c7 100755
--- a/website/content/ChapterFour/0474.Ones-and-Zeroes.md
+++ b/website/content/ChapterFour/0400~0499/0474.Ones-and-Zeroes.md
@@ -75,4 +75,11 @@ func findMaxForm(strs []string, m int, n int) int {
return dp[m][n]
}
-```
\ No newline at end of file
+```
+
+
+----------------------------------------------
+
diff --git a/website/content/ChapterFour/0475.Heaters.md b/website/content/ChapterFour/0400~0499/0475.Heaters.md
similarity index 91%
rename from website/content/ChapterFour/0475.Heaters.md
rename to website/content/ChapterFour/0400~0499/0475.Heaters.md
index bbe46ca73..90e81ad35 100755
--- a/website/content/ChapterFour/0475.Heaters.md
+++ b/website/content/ChapterFour/0400~0499/0475.Heaters.md
@@ -119,4 +119,11 @@ func findRadius1(houses []int, heaters []int) int {
return res
}
-```
\ No newline at end of file
+```
+
+
+----------------------------------------------
+
diff --git a/website/content/ChapterFour/0476.Number-Complement.md b/website/content/ChapterFour/0400~0499/0476.Number-Complement.md
similarity index 82%
rename from website/content/ChapterFour/0476.Number-Complement.md
rename to website/content/ChapterFour/0400~0499/0476.Number-Complement.md
index 1bc61a9e9..41198d109 100755
--- a/website/content/ChapterFour/0476.Number-Complement.md
+++ b/website/content/ChapterFour/0400~0499/0476.Number-Complement.md
@@ -65,4 +65,11 @@ func findComplement1(num int) int {
return (temp - 1) ^ num // temp - 1 即是前面都是 0,num 长度的末尾都是 1 的数,再异或 num 即是最终结果
}
-```
\ No newline at end of file
+```
+
+
+----------------------------------------------
+
diff --git a/website/content/ChapterFour/0477.Total-Hamming-Distance.md b/website/content/ChapterFour/0400~0499/0477.Total-Hamming-Distance.md
similarity index 84%
rename from website/content/ChapterFour/0477.Total-Hamming-Distance.md
rename to website/content/ChapterFour/0400~0499/0477.Total-Hamming-Distance.md
index f3e64a051..2ac93c9f7 100755
--- a/website/content/ChapterFour/0477.Total-Hamming-Distance.md
+++ b/website/content/ChapterFour/0400~0499/0477.Total-Hamming-Distance.md
@@ -63,4 +63,11 @@ func totalHammingDistance1(nums []int) int {
return res
}
-```
\ No newline at end of file
+```
+
+
+----------------------------------------------
+
diff --git a/website/content/ChapterFour/0400~0499/0478.Generate-Random-Point-in-a-Circle.md b/website/content/ChapterFour/0400~0499/0478.Generate-Random-Point-in-a-Circle.md
new file mode 100644
index 000000000..c76e82fb7
--- /dev/null
+++ b/website/content/ChapterFour/0400~0499/0478.Generate-Random-Point-in-a-Circle.md
@@ -0,0 +1,110 @@
+# [478. Generate Random Point in a Circle](https://leetcode.com/problems/generate-random-point-in-a-circle/)
+
+
+## 题目
+
+Given the radius and x-y positions of the center of a circle, write a function `randPoint` which generates a uniform random point in the circle.
+
+Note:
+
+1. input and output values are in [floating-point](https://www.webopedia.com/TERM/F/floating_point_number.html).
+2. radius and x-y position of the center of the circle is passed into the class constructor.
+3. a point on the circumference of the circle is considered to be in the circle.
+4. `randPoint` returns a size 2 array containing x-position and y-position of the random point, in that order.
+
+**Example 1:**
+
+```
+Input:
+["Solution","randPoint","randPoint","randPoint"]
+[[1,0,0],[],[],[]]
+Output: [null,[-0.72939,-0.65505],[-0.78502,-0.28626],[-0.83119,-0.19803]]
+
+```
+
+**Example 2:**
+
+```
+Input:
+["Solution","randPoint","randPoint","randPoint"]
+[[10,5,-7.5],[],[],[]]
+Output: [null,[11.52438,-8.33273],[2.46992,-16.21705],[11.13430,-12.42337]]
+```
+
+**Explanation of Input Syntax:**
+
+The input is two lists: the subroutines called and their arguments. `Solution`'s constructor has three arguments, the radius, x-position of the center, and y-position of the center of the circle. `randPoint` has no arguments. Arguments are always wrapped with a list, even if there aren't any.
+
+## 题目大意
+
+给定圆的半径和圆心的 x、y 坐标,写一个在圆中产生均匀随机点的函数 randPoint 。
+
+说明:
+
+- 输入值和输出值都将是浮点数。
+- 圆的半径和圆心的 x、y 坐标将作为参数传递给类的构造函数。
+- 圆周上的点也认为是在圆中。
+- randPoint 返回一个包含随机点的x坐标和y坐标的大小为2的数组。
+
+## 解题思路
+
+- 随机产生一个圆内的点,这个点一定满足定义 `(x-a)^2+(y-b)^2 ≤ R^2`,其中 `(a,b)` 是圆的圆心坐标,`R` 是半径。
+- 先假设圆心坐标在 (0,0),这样方便计算,最终输出坐标的时候整体加上圆心的偏移量即可。`rand.Float64()` 产生一个 `[0.0,1.0)` 区间的浮点数。`-R ≤ 2 * R * rand() - R < R`,利用随机产生坐标点的横纵坐标 `(x,y)` 与半径 R 的关系,如果 `x^2 + y^2 ≤ R^2`,那么说明产生的点在圆内。最终输出的时候要记得加上圆心坐标的偏移值。
+
+## 代码
+
+```go
+package leetcode
+
+import (
+ "math"
+ "math/rand"
+ "time"
+)
+
+type Solution struct {
+ r float64
+ x float64
+ y float64
+}
+
+func Constructor(radius float64, x_center float64, y_center float64) Solution {
+ rand.Seed(time.Now().UnixNano())
+ return Solution{radius, x_center, y_center}
+}
+
+func (this *Solution) RandPoint() []float64 {
+ /*
+ a := angle()
+ r := this.r * math.Sqrt(rand.Float64())
+ x := r * math.Cos(a) + this.x
+ y := r * math.Sin(a) + this.y
+ return []float64{x, y}*/
+ for {
+ rx := 2*rand.Float64() - 1.0
+ ry := 2*rand.Float64() - 1.0
+ x := this.r * rx
+ y := this.r * ry
+ if x*x+y*y <= this.r*this.r {
+ return []float64{x + this.x, y + this.y}
+ }
+ }
+}
+
+func angle() float64 {
+ return rand.Float64() * 2 * math.Pi
+}
+
+/**
+ * Your Solution object will be instantiated and called as such:
+ * obj := Constructor(radius, x_center, y_center);
+ * param_1 := obj.RandPoint();
+ */
+```
+
+
+----------------------------------------------
+
diff --git a/website/content/ChapterFour/0480.Sliding-Window-Median.md b/website/content/ChapterFour/0400~0499/0480.Sliding-Window-Median.md
similarity index 94%
rename from website/content/ChapterFour/0480.Sliding-Window-Median.md
rename to website/content/ChapterFour/0400~0499/0480.Sliding-Window-Median.md
index 23499f930..01e40d5d3 100755
--- a/website/content/ChapterFour/0480.Sliding-Window-Median.md
+++ b/website/content/ChapterFour/0400~0499/0480.Sliding-Window-Median.md
@@ -273,4 +273,11 @@ func (h *MaxHeapR) Push(x int) { heap.Push(&h.hp, x) }
// Remove define
func (h *MaxHeapR) Remove(x int) { heap.Push(&h.hpDel, x) }
-```
\ No newline at end of file
+```
+
+
+----------------------------------------------
+
diff --git a/website/content/ChapterFour/0400~0499/0483.Smallest-Good-Base.md b/website/content/ChapterFour/0400~0499/0483.Smallest-Good-Base.md
new file mode 100755
index 000000000..817478cec
--- /dev/null
+++ b/website/content/ChapterFour/0400~0499/0483.Smallest-Good-Base.md
@@ -0,0 +1,136 @@
+# [483. Smallest Good Base](https://leetcode.com/problems/smallest-good-base/)
+
+
+## 题目
+
+For an integer n, we call k>=2 a **good base** of n, if all digits of n base k are 1.
+
+Now given a string representing n, you should return the smallest good base of n in string format.
+
+**Example 1**:
+
+ Input: "13"
+ Output: "3"
+ Explanation: 13 base 3 is 111.
+
+**Example 2**:
+
+ Input: "4681"
+ Output: "8"
+ Explanation: 4681 base 8 is 11111.
+
+**Example 3**:
+
+ Input: "1000000000000000000"
+ Output: "999999999999999999"
+ Explanation: 1000000000000000000 base 999999999999999999 is 11.
+
+**Note**:
+
+1. The range of n is [3, 10^18].
+2. The string representing n is always valid and will not have leading zeros.
+
+
+## 题目大意
+
+
+对于给定的整数 n, 如果n的k(k>=2)进制数的所有数位全为1,则称 k(k>=2)是 n 的一个好进制。
+
+以字符串的形式给出 n, 以字符串的形式返回 n 的最小好进制。
+
+提示:
+
+- n 的取值范围是 [3, 10^18]。
+- 输入总是有效且没有前导 0。
+
+
+
+## 解题思路
+
+
+- 给出一个数 n,要求找一个进制 k,使得数字 n 在 k 进制下每一位都是 1 。求最小的进制 k。
+- 这一题等价于求最小的正整数 k,满足存在一个正整数 m 使得
+
+{{< katex display >}}
+ \sum_{i=0}^{m} k^{i} = \frac{1-k^{m+1}}{1-k} = n
+{{< /katex >}}
+
+
+- 这一题需要确定 k 和 m 两个数的值。m 和 k 是有关系的,确定了一个值,另外一个值也确定了。由
+
+{{< katex display >}}
+ \frac{1-k^{m+1}}{1-k} = n \\
+{{< /katex >}}
+
+
+可得:
+
+{{< katex display >}}
+ m = log_{k}(kn-n+1) - 1 < log_{k}(kn) = 1 + log_{k}n
+{{< /katex >}}
+
+
+根据题意,可以知道 k ≥2,m ≥1 ,所以有:
+
+{{< katex display >}}
+ 1 \leqslant m \leqslant log_{2}n
+{{< /katex >}}
+
+
+所以 m 的取值范围确定了。那么外层循环从 1 到 log n 遍历。找到一个最小的 k ,能满足:
+
+可以用二分搜索来逼近找到最小的 k。先找到 k 的取值范围。由
+
+{{< katex display >}}
+ \frac{1-k^{m+1}}{1-k} = n \\
+{{< /katex >}}
+
+
+可得,
+
+{{< katex display >}}
+ k^{m+1} = nk-n+1 < nk\\ \Rightarrow k < \sqrt[m]{n}
+{{< /katex >}}
+
+
+所以 k 的取值范围是 [2, n*(1/m) ]。再利用二分搜索逼近找到最小的 k 即为答案。
+
+
+## 代码
+
+```go
+
+package leetcode
+
+import (
+ "math"
+ "math/bits"
+ "strconv"
+)
+
+func smallestGoodBase(n string) string {
+ nVal, _ := strconv.Atoi(n)
+ mMax := bits.Len(uint(nVal)) - 1
+ for m := mMax; m > 1; m-- {
+ k := int(math.Pow(float64(nVal), 1/float64(m)))
+ mul, sum := 1, 1
+ for i := 0; i < m; i++ {
+ mul *= k
+ sum += mul
+ }
+ if sum == nVal {
+ return strconv.Itoa(k)
+ }
+ }
+ return strconv.Itoa(nVal - 1)
+}
+
+
+```
+
+
+----------------------------------------------
+
diff --git a/website/content/ChapterFour/0485.Max-Consecutive-Ones.md b/website/content/ChapterFour/0400~0499/0485.Max-Consecutive-Ones.md
similarity index 76%
rename from website/content/ChapterFour/0485.Max-Consecutive-Ones.md
rename to website/content/ChapterFour/0400~0499/0485.Max-Consecutive-Ones.md
index 6bd2c40eb..dce4ba166 100644
--- a/website/content/ChapterFour/0485.Max-Consecutive-Ones.md
+++ b/website/content/ChapterFour/0400~0499/0485.Max-Consecutive-Ones.md
@@ -56,4 +56,11 @@ func findMaxConsecutiveOnes(nums []int) int {
return maxCount
}
-```
\ No newline at end of file
+```
+
+
+----------------------------------------------
+
diff --git a/website/content/ChapterFour/0400~0499/0488.Zuma-Game.md b/website/content/ChapterFour/0400~0499/0488.Zuma-Game.md
new file mode 100644
index 000000000..3b17baa76
--- /dev/null
+++ b/website/content/ChapterFour/0400~0499/0488.Zuma-Game.md
@@ -0,0 +1,148 @@
+# [488. Zuma Game](https://leetcode.com/problems/zuma-game/)
+
+
+## 题目
+
+You are playing a variation of the game Zuma.
+
+In this variation of Zuma, there is a single row of colored balls on a board, where each ball can be colored red 'R', yellow 'Y', blue 'B', green 'G', or white 'W'. You also have several colored balls in your hand.
+
+Your goal is to clear all of the balls from the board. On each turn:
+
+Pick any ball from your hand and insert it in between two balls in the row or on either end of the row.
+If there is a group of three or more consecutive balls of the same color, remove the group of balls from the board.
+If this removal causes more groups of three or more of the same color to form, then continue removing each group until there are none left.
+If there are no more balls on the board, then you win the game.
+Repeat this process until you either win or do not have any more balls in your hand.
+Given a string board, representing the row of balls on the board, and a string hand, representing the balls in your hand, return the minimum number of balls you have to insert to clear all the balls from the board. If you cannot clear all the balls from the board using the balls in your hand, return -1.
+
+**Example 1**:
+
+```
+Input: board = "WRRBBW", hand = "RB"
+Output: -1
+Explanation: It is impossible to clear all the balls. The best you can do is:
+- Insert 'R' so the board becomes WRRRBBW. WRRRBBW -> WBBW.
+- Insert 'B' so the board becomes WBBBW. WBBBW -> WW.
+There are still balls remaining on the board, and you are out of balls to insert.
+```
+
+**Example 2**:
+```
+Input: board = "WWRRBBWW", hand = "WRBRW"
+Output: 2
+Explanation: To make the board empty:
+- Insert 'R' so the board becomes WWRRRBBWW. WWRRRBBWW -> WWBBWW.
+- Insert 'B' so the board becomes WWBBBWW. WWBBBWW -> WWWW -> empty.
+2 balls from your hand were needed to clear the board.
+```
+
+**Example 3**:
+```
+Input: board = "G", hand = "GGGGG"
+Output: 2
+Explanation: To make the board empty:
+- Insert 'G' so the board becomes GG.
+- Insert 'G' so the board becomes GGG. GGG -> empty.
+2 balls from your hand were needed to clear the board.
+```
+
+**Example 4**:
+```
+Input: board = "RBYYBBRRB", hand = "YRBGB"
+Output: 3
+Explanation: To make the board empty:
+- Insert 'Y' so the board becomes RBYYYBBRRB. RBYYYBBRRB -> RBBBRRB -> RRRB -> B.
+- Insert 'B' so the board becomes BB.
+- Insert 'B' so the board becomes BBB. BBB -> empty.
+3 balls from your hand were needed to clear the board.
+```
+
+**Constraints**:
+
+- 1 <= board.length <= 16
+- 1 <= hand.length <= 5
+- board and hand consist of the characters 'R', 'Y', 'B', 'G', and 'W'.
+- The initial row of balls on the board will not have any groups of three or more consecutive balls of the same color.
+
+## 题目大意
+
+你正在参与祖玛游戏的一个变种。
+
+在这个祖玛游戏变体中,桌面上有 一排 彩球,每个球的颜色可能是:红色 'R'、黄色 'Y'、蓝色 'B'、绿色 'G' 或白色 'W' 。你的手中也有一些彩球。
+
+你的目标是 清空 桌面上所有的球。每一回合:
+
+从你手上的彩球中选出 任意一颗 ,然后将其插入桌面上那一排球中:两球之间或这一排球的任一端。
+接着,如果有出现 三个或者三个以上 且 颜色相同 的球相连的话,就把它们移除掉。
+如果这种移除操作同样导致出现三个或者三个以上且颜色相同的球相连,则可以继续移除这些球,直到不再满足移除条件。
+如果桌面上所有球都被移除,则认为你赢得本场游戏。
+重复这个过程,直到你赢了游戏或者手中没有更多的球。
+给你一个字符串 board ,表示桌面上最开始的那排球。另给你一个字符串 hand ,表示手里的彩球。请你按上述操作步骤移除掉桌上所有球,计算并返回所需的 最少 球数。如果不能移除桌上所有的球,返回 -1 。
+
+## 解题思路
+
+- 使用广度优先搜索和剪枝
+
+## 代码
+
+```go
+
+package leetcode
+
+func findMinStep(board string, hand string) int {
+ q := [][]string{{board, hand}}
+ mp := make(map[string]bool)
+ minStep := 0
+ for len(q) > 0 {
+ length := len(q)
+ minStep++
+ for length > 0 {
+ length--
+ cur := q[0]
+ q = q[1:]
+ curB, curH := cur[0], cur[1]
+ for i := 0; i < len(curB); i++ {
+ for j := 0; j < len(curH); j++ {
+ curB2 := del3(curB[0:i] + string(curH[j]) + curB[i:])
+ curH2 := curH[0:j] + curH[j+1:]
+ if len(curB2) == 0 {
+ return minStep
+ }
+ if _, ok := mp[curB2+curH2]; ok {
+ continue
+ }
+ mp[curB2+curH2] = true
+ q = append(q, []string{curB2, curH2})
+ }
+ }
+ }
+ }
+ return -1
+}
+
+func del3(str string) string {
+ cnt := 1
+ for i := 1; i < len(str); i++ {
+ if str[i] == str[i-1] {
+ cnt++
+ } else {
+ if cnt >= 3 {
+ return del3(str[0:i-cnt] + str[i:])
+ }
+ cnt = 1
+ }
+ }
+ if cnt >= 3 {
+ return str[0 : len(str)-cnt]
+ }
+ return str
+}
+```
+
+
+----------------------------------------------
+
diff --git a/website/content/ChapterFour/0400~0499/0491.Non-decreasing-Subsequences.md b/website/content/ChapterFour/0400~0499/0491.Non-decreasing-Subsequences.md
new file mode 100755
index 000000000..e18e428c3
--- /dev/null
+++ b/website/content/ChapterFour/0400~0499/0491.Non-decreasing-Subsequences.md
@@ -0,0 +1,91 @@
+# [491. Non-decreasing Subsequences](https://leetcode.com/problems/non-decreasing-subsequences/)
+
+
+## 题目
+
+Given an integer array, your task is to find all the different possible increasing subsequences of the given array, and the length of an increasing subsequence should be at least 2.
+
+**Example**:
+
+ Input: [4, 6, 7, 7]
+ Output: [[4, 6], [4, 7], [4, 6, 7], [4, 6, 7, 7], [6, 7], [6, 7, 7], [7,7], [4,7,7]]
+
+**Note**:
+
+1. The length of the given array will not exceed 15.
+2. The range of integer in the given array is [-100,100].
+3. The given array may contain duplicates, and two equal integers should also be considered as a special case of increasing sequence.
+
+
+
+## 题目大意
+
+
+给定一个整型数组, 你的任务是找到所有该数组的递增子序列,递增子序列的长度至少是 2。
+
+说明:
+
+1. 给定数组的长度不会超过15。
+2. 数组中的整数范围是 [-100,100]。
+3. 给定数组中可能包含重复数字,相等的数字应该被视为递增的一种情况。
+
+
+
+
+## 解题思路
+
+
+- 给出一个数组,要求找出这个数组中所有长度大于 2 的非递减子序列。子序列顺序和原数组元素下标必须是顺序的,不能是逆序的。
+- 这一题和第 78 题和第 90 题是类似的题目。第 78 题和第 90 题是求所有子序列,这一题在这两题的基础上增加了非递减和长度大于 2 的条件。需要注意的两点是,原数组中元素可能会重复,最终结果输出的时候需要去重。最终结果输出的去重用 map 处理,数组中重复元素用 DFS 遍历搜索。在每次 DFS 中,用 map 记录遍历过的元素,保证本轮 DFS 中不出现重复的元素,递归到下一层还可以选择值相同,但是下标不同的另外一个元素。外层循环也要加一个 map,这个 map 是过滤每组解因为重复元素导致的重复解,经过过滤以后,起点不同了,最终的解也会不同。
+- 这一题和第 78 题,第 90 题类似,可以一起解答和复习。
+
+
+## 代码
+
+```go
+
+package leetcode
+
+func findSubsequences(nums []int) [][]int {
+ c, visited, res := []int{}, map[int]bool{}, [][]int{}
+ for i := 0; i < len(nums)-1; i++ {
+ if _, ok := visited[nums[i]]; ok {
+ continue
+ } else {
+ visited[nums[i]] = true
+ generateIncSubsets(nums, i, c, &res)
+ }
+ }
+ return res
+}
+
+func generateIncSubsets(nums []int, current int, c []int, res *[][]int) {
+ c = append(c, nums[current])
+ if len(c) >= 2 {
+ b := make([]int, len(c))
+ copy(b, c)
+ *res = append(*res, b)
+ }
+ visited := map[int]bool{}
+ for i := current + 1; i < len(nums); i++ {
+ if nums[current] <= nums[i] {
+ if _, ok := visited[nums[i]]; ok {
+ continue
+ } else {
+ visited[nums[i]] = true
+ generateIncSubsets(nums, i, c, res)
+ }
+ }
+ }
+ c = c[:len(c)-1]
+ return
+}
+
+```
+
+
+----------------------------------------------
+
diff --git a/website/content/ChapterFour/0400~0499/0492.Construct-the-Rectangle.md b/website/content/ChapterFour/0400~0499/0492.Construct-the-Rectangle.md
new file mode 100644
index 000000000..5e02ec17e
--- /dev/null
+++ b/website/content/ChapterFour/0400~0499/0492.Construct-the-Rectangle.md
@@ -0,0 +1,79 @@
+# [492. Construct the Rectangle](https://leetcode.com/problems/construct-the-rectangle/)
+
+
+## 题目
+
+A web developer needs to know how to design a web page's size.
+So, given a specific rectangular web page’s area, your job by now is to design a rectangular web page,
+whose length L and width W satisfy the following requirements:
+
+ The area of the rectangular web page you designed must equal to the given target area.
+ The width W should not be larger than the length L, which means L >= W.
+ The difference between length L and width W should be as small as possible.
+ Return an array [L, W] where L and W are the length and width of the web page you designed in sequence.
+
+**Example 1:**
+
+ Input: area = 4
+ Output: [2,2]
+ Explanation: The target area is 4, and all the possible ways to construct it are [1,4], [2,2], [4,1].
+ But according to requirement 2, [1,4] is illegal; according to requirement 3, [4,1] is not optimal compared to [2,2]. So the length L is 2, and the width W is 2.
+
+**Example 2:**
+
+ Input: area = 37
+ Output: [37,1]
+
+**Example 3:**
+
+ Input: area = 122122
+ Output: [427,286]
+
+**Constraints**
+
+ - 1 <= area <= 10000000
+
+## 题目大意
+
+作为一位 web 开发者, 懂得怎样去规划一个页面的尺寸是很重要的。 现给定一个具体的矩形页面面积,你的任务是设计一个长度为 L 和宽度为 W 且满足以下要求的矩形的页面。要求:
+
+1. 你设计的矩形页面必须等于给定的目标面积。
+2. 宽度 W 不应大于长度 L,换言之,要求 L >= W 。
+3. 长度 L 和宽度 W 之间的差距应当尽可能小。
+
+你需要按顺序输出你设计的页面的长度 L 和宽度 W。
+
+## 解题思路
+
+- 令 W 等于根号 area
+- 在 W 大于等于 1 的情况下,判断 area%W 是否等于 0,如果不相等 W 就减 1 继续循环,如果相等就返回 [area/W, W]
+
+## 代码
+
+```go
+
+package leetcode
+
+import "math"
+
+func constructRectangle(area int) []int {
+ ans := make([]int, 2)
+ W := int(math.Sqrt(float64(area)))
+ for W >= 1 {
+ if area%W == 0 {
+ ans[0], ans[1] = area/W, W
+ break
+ }
+ W -= 1
+ }
+ return ans
+}
+
+``
+
+
+----------------------------------------------
+
diff --git a/website/content/ChapterFour/0400~0499/0493.Reverse-Pairs.md b/website/content/ChapterFour/0400~0499/0493.Reverse-Pairs.md
new file mode 100755
index 000000000..0e53ce7d5
--- /dev/null
+++ b/website/content/ChapterFour/0400~0499/0493.Reverse-Pairs.md
@@ -0,0 +1,163 @@
+# [493. Reverse Pairs](https://leetcode.com/problems/reverse-pairs/)
+
+
+## 题目
+
+Given an array `nums`, we call `(i, j)` an **important reverse pair** if `i < j` and `nums[i] > 2*nums[j]`.
+
+You need to return the number of important reverse pairs in the given array.
+
+**Example1**:
+
+ Input: [1,3,2,3,1]
+ Output: 2
+
+**Example2**:
+
+ Input: [2,4,3,5,1]
+ Output: 3
+
+**Note**:
+
+1. The length of the given array will not exceed `50,000`.
+2. All the numbers in the input array are in the range of 32-bit integer.
+
+
+## 题目大意
+
+给定一个数组 nums ,如果 i < j 且 nums[i] > 2\*nums[j] 我们就将 (i, j) 称作一个重要翻转对。你需要返回给定数组中的重要翻转对的数量。
+
+注意:
+
+- 给定数组的长度不会超过 50000。
+- 输入数组中的所有数字都在 32 位整数的表示范围内。
+
+
+## 解题思路
+
+
+- 给出一个数组,要求找出满足条件的所有的“重要的反转对” (i,j)。重要的反转对的定义是:`i
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -14,4 +15,11 @@ type: docs
题解慢慢更新中,欢迎大家提出更好的解法。点击页面下方的 edit,会跳转到 github 对应的页面 markdown 中,可以提交你的最优解 PR。
-让我们在题解的太空遨游吧~
\ No newline at end of file
+让我们在题解的太空遨游吧~
+
+
+----------------------------------------------
+
2. 最小公倍数
3. 分解质因数
4. 素数判定
5. 进制转换
6. 高精度计算
7. 整除问题
8. 同余问题
9. 欧拉函数
10. 扩展欧几里得
11. 置换群
12. 母函数
13. 离散变换
14. 康托展开
15. 矩阵
16. 向量
17. 线性方程组
18. 线性规划
||
|几何||1. 凸包 - Gift wrapping
2. 凸包 - Graham scan
3. 线段问题
4. 多边形和多面体相关问题
||
|NP 完全|1. 计算模型
2. P 类与 NP 类问题
3. NP 完全问题
4. NP 完全问题的近似算法
|1. 随机存取机 RAM
2. 随机存取存储程序机 RASP
3. 图灵机
4. 非确定性图灵机
5. P 类与 NP 类语言
6. 多项式时间验证
7. 多项式时间变换
8. Cook定理
9. 合取范式的可满足性问题 CNF-SAT
10. 3 元合取范式的可满足性问题 3-SAT
11. 团问题 CLIQUE
12. 顶点覆盖问题 VERTEX-COVER
13. 子集和问题 SUBSET-SUM
14. 哈密顿回路问题 HAM-CYCLE
15. 旅行售货员问题 TSP
16. 顶点覆盖问题的近似算法
17. 旅行售货员问题近似算法
18. 具有三角不等式性质的旅行售货员问题
19. 一般的旅行售货员问题
20. 集合覆盖问题的近似算法
21. 子集和问题的近似算法
22. 子集和问题的指数时间算法
23. 子集和问题的多项式时间近似格式
||
-|位运算| 位操作包括:
1. 取反(NOT)
2. 按位或(OR)
3. 按位异或(XOR)
4. 按位与(AND)
5. 移位: 是一个二元运算符,用来将一个二进制数中的每一位全部都向一个方向移动指定位,溢出的部分将被舍弃,而空缺的部分填入一定的值。
| 1.数字范围按位与
2.UTF-8 编码验证
3.数字转换为十六进制数
4.找出最长的超赞子字符串
5.数组异或操作
6.幂集
7.位1的个数
8.二进制表示中质数个计算置位
9.子数组异或查询
| [力扣:位运算](https://leetcode-cn.com/tag/bit-manipulation/)
-|------------|------------------------------------------------------------------|-----------------------------------------------------------------|--------------------|
\ No newline at end of file
+|位运算| 位操作包括:
1. 取反(NOT)
2. 按位或(OR)
3. 按位异或(XOR)
4. 按位与(AND)
5. 移位: 是一个二元运算符,用来将一个二进制数中的每一位全部都向一个方向移动指定位,溢出的部分将被舍弃,而空缺的部分填入一定的值。
| 1.数字范围按位与
2.UTF-8 编码验证
3.数字转换为十六进制数
4.找出最长的超赞子字符串
5.数组异或操作
6.幂集
7.位1的个数
8.二进制表示中质数个计算置位
9.子数组异或查询
| [力扣:位运算](https://leetcode-cn.com/tag/bit-manipulation/)|
+|------------|------------------------------------------------------------------|-----------------------------------------------------------------|--------------------|
+
+
+----------------------------------------------
+
diff --git a/website/content/ChapterOne/Data_Structure.md b/website/content/ChapterOne/Data_Structure.md
index f4aec542e..7ccb955e7 100644
--- a/website/content/ChapterOne/Data_Structure.md
+++ b/website/content/ChapterOne/Data_Structure.md
@@ -1,6 +1,7 @@
---
-title: 数据结构知识
+title: 1.1 数据结构知识
type: docs
+weight: 1
---
# 数据结构知识
@@ -11,14 +12,21 @@ type: docs
| 数据结构 | 变种 | 相关题目 | 讲解文章 |
|:-------:|:-------|:------|:------|
-|顺序线性表:向量||||
-|单链表|1. 双向链表
2. 静态链表
3. 对称矩阵
4. 稀疏矩阵|||
-|哈希表|1. 散列函数
2. 解决碰撞/填充因子
|||
-|栈和队列|1. 广义栈
2. 双端队列
|||
-|队列|1. 链表实现
2. 循环数组实现
3. 双端队列|||
-|字符串|1. KMP算法
2. 有限状态自动机
3. 模式匹配有限状态自动机
4. BM 模式匹配算法
5. BM-KMP 算法
6. BF 算法|||
-|树|1. 二叉树
2. 并查集
3. Huffman 树|||
-|数组实现的堆|1. 极大堆和极小堆
2. 极大极小堆
3. 双端堆
4. d 叉堆|||
-|树实现的堆|1. 左堆
2. 扁堆
3. 二项式堆
4. 斐波那契堆
5. 配对堆|||
-|查找|1. 哈希表
2. 跳跃表
3. 排序二叉树
4. AVL 树
5. B 树 / B+ 树 / B* 树
6. AA 树
7. 红黑树
8. 排序二叉堆
9. Splay 树
10. 双链树
11. Trie 树
12. R 树|||
-|--------------------------------------------|--------------------------------------------------------------------------------------------|---------------------------|-----------------------------------|
\ No newline at end of file
+|顺序线性表:向量
Vector||||
+|单链表
Singly Linked List|1. 双向链表 Double Linked Lists
2. 静态链表 Static List
3. 对称矩阵 Symmetric Matrix
4. 稀疏矩阵 Sparse Matrix|||
+|哈希表
Hash Table|1. 散列函数 Hash Function
2. 解决碰撞/填充因子 Collision Resolution
|||
+|栈和队列
Stack & Queue|1. 广义表 Generalized List/GList
2. 双端队列 Deque
|||
+|队列
Queue|1. 链表实现 Linked List Implementation
2. 循环数组实现 ArrayQueue
3. 双端队列 Deque
4. 优先队列 Priority Queue
5. 循环队列 Circular Queue|||
+|字符串
String|1. KMP 算法
2. 有限状态自动机
3. 模式匹配有限状态自动机
4. BM 模式匹配算法
5. BM-KMP 算法
6. BF 算法|||
+|树
Tree|1. 二叉树 Binary Tree
2. 并查集 Union-Find
3. Huffman 树|||
+|数组实现的堆
Heap|1. 极大堆和极小堆 Max Heap and Min Heap
2. 极大极小堆
3. 双端堆 Deap
4. d 叉堆|||
+|树实现的堆
Heap|1. 左堆 Leftist Tree/Leftist Heap
2. 扁堆
3. 二项式堆
4. 斐波那契堆 Fibonacco Heap
5. 配对堆 Pairing Heap|||
+|查找
Search|1. 哈希表 Hash
2. 跳跃表 Skip List
3. 排序二叉树 Binary Sort Tree
4. AVL 树
5. B 树 / B+ 树 / B* 树
6. AA 树
7. 红黑树 Red Black Tree
8. 排序二叉堆 Binary Heap
9. Splay 树
10. 双链树 Double Chained Tree
11. Trie 树
12. R 树|||
+|--------------------------------------------|--------------------------------------------------------------------------------------------|---------------------------|-----------------------------------|
+
+
+----------------------------------------------
+
diff --git a/website/content/ChapterOne/Time_Complexity.md b/website/content/ChapterOne/Time_Complexity.md
new file mode 100644
index 000000000..b68708bb2
--- /dev/null
+++ b/website/content/ChapterOne/Time_Complexity.md
@@ -0,0 +1,139 @@
+---
+title: 1.3 时间复杂度
+type: docs
+weight: 3
+---
+
+# 时间复杂度和空间复杂度
+
+
+## 一. 时间复杂度数据规模
+
+1s 内能解决问题的数据规模:10^6 ~ 10^7
+
+- O(n^2) 算法可以处理 10^4 级别的数据规模(保守估计,处理 1000 级别的问题肯定没问题)
+- O(n) 算法可以处理 10^8 级别的数据规模(保守估计,处理 10^7 级别的问题肯定没问题)
+- O(nlog n) 算法可以处理 10^7 级别的数据规模(保守估计,处理 10^6 级别的问题肯定没问题)
+
+| | 数据规模|时间复杂度 | 算法举例|
+|:------:|:------:|:------:|:------:|
+|1|10|O(n!)|permutation 排列|
+|2|20~30|O(2^n)|combination 组合|
+|3|50|O(n^4)|DFS 搜索、DP 动态规划|
+|4|100|O(n^3)|任意两点最短路径、DP 动态规划|
+|5|1000|O(n^2)|稠密图、DP 动态规划|
+|6|10^6|O(nlog n)|排序,堆,递归与分治|
+|7|10^7|O(n)|DP 动态规划、图遍历、拓扑排序、树遍历|
+|8|10^9|O(sqrt(n))|筛素数、求平方根|
+|9|10^10|O(log n)|二分搜索|
+|10|+∞|O(1)|数学相关算法|
+|------------------------------|------------------------------|------------------------------------------------------------------|------------------------------------------------------------------|
+
+
+一些具有迷惑性的例子:
+
+```c
+void hello (int n){
+ for( int sz = 1 ; sz < n ; sz += sz )
+ for( int i = 1 ; i < n ; i ++ )
+ cout << "Hello" << endl;
+}
+```
+
+上面这段代码的时间复杂度是 O(nlog n) 而不是 O(n^2)
+
+```c
+bool isPrime (int n){
+ if (num <= 1) return false;
+ for( int x = 2 ; x * x <= n ; x ++ )
+ if( n % x == 0 )
+ return false;
+ return true;
+}
+```
+
+上面这段代码的时间复杂度是 O(sqrt(n)) 而不是 O(n)。
+
+再举一个例子,有一个字符串数组,将数组中的每一个字符串按照字母序排序,之后再将整个字符串数组按照字典序排序。两步操作的整体时间复杂度是多少呢?
+
+如果回答是 O(n*nlog n + nlog n) = O(n^2log n),这个答案是错误的。字符串的长度和数组的长度是没有关系的,所以这两个变量应该单独计算。假设最长的字符串长度为 s,数组中有 n 个字符串。对每个字符串排序的时间复杂度是 O(slog s),将数组中每个字符串都按照字母序排序的时间复杂度是 O(n * slog s)。
+
+将整个字符串数组按照字典序排序的时间复杂度是 O(s * nlog n)。排序算法中的 O(nlog n) 是比较的次数,由于比较的是整型数字,所以每次比较是 O(1)。但是字符串按照字典序比较,时间复杂度是 O(s)。所以字符串数组按照字典序排序的时间复杂度是 O(s * nlog n)。所以整体复杂度是 O(n * slog s) + O(s * nlog n) = O(n\*slog s + s\*nlogn) = O(n\*s\*(log s + log n)) = O(n\*s\*log(n\*s))。
+
+## 二. 空间复杂度
+
+递归调用是有空间代价的,递归算法需要保存递归栈信息,所以花费的空间复杂度会比非递归算法要高。
+
+```c
+int sum( int n ){
+ assert( n >= 0 )
+ int ret = 0;
+ for ( int i = 0 ; i <= n ; i ++ )
+ ret += i;
+ return ret;
+}
+```
+
+上面算法的时间复杂度为 O(n),空间复杂度 O(1)。
+
+```c
+int sum( int n ){
+ assert( n >= 0 )
+ if ( n == 0 )
+ return 0;
+ return n + sum( n - 1 );
+}
+```
+
+上面算法的时间复杂度为 O(n),空间复杂度 O(n)。
+
+## 三. 递归的时间复杂度
+
+### 1. 只有一次递归调用
+
+如果递归函数中,只进行了一次递归调用,且递归深度为 depth,在每个递归函数中,时间复杂度为 T,那么总体的时间复杂度为 O(T * depth)
+
+举个例子:
+
+```c
+int binarySearch(int arr[], int l, int r, int target){
+ if( l > r )
+ return -1;
+ int mid = l + ( r - l ) / 2; // 防溢出
+ if(arr[mid] == target)
+ return mid;
+ else if (arr[mid] > target)
+ return binarySearch(arr,l,mid-1,target);
+ else
+ return binarySearch(arr,mid+1,r,target);
+}
+
+```
+
+在二分查找的递归实现中,只递归调用了自身。递归深度是 log n ,每次递归里面的复杂度是 O(1) 的,所以二分查找的递归实现的时间复杂度为 O(log n) 的。
+
+
+### 2. 只有多次递归调用
+
+针对多次递归调用的情况,就需要看它的计算调用的次数了。通常可以画一颗递归树来看。举例:
+
+```c
+int f(int n){
+ assert( n >= 0 );
+ if( n == 0 )
+ return 1;
+ return f( n - 1 ) + f ( n - 1 );
+}
+```
+
+上述这次递归调用的次数为 2^0^ + 2^1^ + 2^2^ + …… + 2^n^ = 2^n+1^ - 1 = O(2^n)
+
+
+> 关于更加复杂的递归的复杂度分析,请参考主定理。主定理中针对各种复杂情况都给出了正确的结论。
+
+
+----------------------------------------------
+
diff --git a/website/content/ChapterOne/_index.md b/website/content/ChapterOne/_index.md
index 1016b57c0..6d535294a 100644
--- a/website/content/ChapterOne/_index.md
+++ b/website/content/ChapterOne/_index.md
@@ -1,6 +1,7 @@
---
-title: 第一章
+title: 第一章 序章
type: docs
+weight: 1
---
# 第一章 序章
@@ -34,7 +35,7 @@ type: docs
## 关于作者
-笔者是一个刚刚入行一年半的 gopher 新人,还请各位大佬多多指点小弟我。大学参加了 3 年 ACM-ICPC,但是由于资质不高,没有拿到一块金牌。所以在算法方面,我对自己的评价算是新手吧。参加 ACM-ICPC 最大的收获是训练了思维能力,这种能力也会运用到生活中。其次是认识了很多国内很聪明的选手,看到了自己和他们的差距。最后,就是那 200 多页,有些自己都没有完全理解的,打印的密密麻麻的[算法模板](https://github.com/halfrost/LeetCode-Go/releases/tag/Special)。知识学会了,终身都是自己的,没有学会,那些知识都是身外之物。
+笔者是一个刚刚入行一年半的 gopher 新人,还请各位大佬多多指点小弟我。大学参加了 3 年 ACM-ICPC,但是由于资质不高,没有拿到一块金牌。所以在算法方面,我对自己的评价算是新手吧。参加 ACM-ICPC 最大的收获是训练了思维能力,这种能力也会运用到生活中。其次是认识了很多国内很聪明的选手,看到了自己和他们的差距。最后,就是那 200 多页,有些自己都没有完全理解的,打印的密密麻麻的[算法模板](https://github.com/halfrost/leetcode-go/releases/tag/Special)。知识学会了,终身都是自己的,没有学会,那些知识都是身外之物。
笔者从 2019 年 3 月 25 号开始刷题,到 2020 年 3 月 25 号,整整一年的时间。原计划是每天一题。实际上每天有时候不止一题,最终完成了 600+:
@@ -48,7 +49,7 @@ type: docs
## 关于书中的代码
-代码都放在 [github repo](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode) 中,按题号可以搜索到题目。
+代码都放在 [github repo](https://github.com/halfrost/leetcode-go/tree/master/leetcode) 中,按题号可以搜索到题目。
本书题目的代码都已经 beats 100% 了。没有 beats 100% 题解就没有放到本书中了。那些题目笔者会继续优化到 100% 再放进来。
有可能读者会问,为何要追求 beats 100%。笔者认为优化到 beats 100% 才算是把这题做出感觉了。有好几道 Hard 题,笔者都用暴力解法 AC 了,然后只 beats 了 5%。这题就如同没做一样。而且面试中如果给了这样的答案,面试官也不会满意,“还有没有更优解?”。如果通过自己的思考能给出更优解,面试官会更满意一些。
@@ -86,4 +87,9 @@ LeetCode 统计代码运行时长会有波动的,相同的代码提交 10 次
本作品采用 [知识署名-非商业性使用-禁止演绎 (BY-NC-ND) 4.0 国际许可协议](https://creativecommons.org/licenses/by-nc-nd/4.0/legalcode.zh-Hans) 进行许可。
-题解里面的所有题目版权均归 [LeetCode](https://leetcode.com/) 和 [力扣中国](https://leetcode-cn.com/) 所有
\ No newline at end of file
+题解里面的所有题目版权均归 [LeetCode](https://leetcode.com/) 和 [力扣中国](https://leetcode-cn.com/) 所有
+
+
+----------------------------------------------
+
+
diff --git a/website/content/ChapterThree/Binary_Indexed_Tree.md b/website/content/ChapterThree/Binary_Indexed_Tree.md
new file mode 100644
index 000000000..1d58fdeed
--- /dev/null
+++ b/website/content/ChapterThree/Binary_Indexed_Tree.md
@@ -0,0 +1,637 @@
+---
+title: 3.5 Binary Indexed Tree
+type: docs
+weight: 5
+---
+
+# 树状数组 Binary Indexed Tree (二叉索引树)
+
+树状数组或二叉索引树(Binary Indexed Tree),又以其发明者命名为 Fenwick 树,最早由 Peter M. Fenwick 于 1994 年以 A New Data Structure for Cumulative Frequency Tables 为题发表在 SOFTWARE PRACTICE AND EXPERIENCE 上。其初衷是解决数据压缩里的累积频率(Cumulative Frequency)的计算问题,现多用于高效计算数列的前缀和,区间和。针对区间问题,除了常见的线段树解法,还可以考虑树状数组。它可以以 O(log n) 的时间得到任意前缀和{{< katex >}} \sum_{i=1}^{j}A[i],1<=j<=N {{< /katex >}},并同时支持在 O(log n)时间内支持动态单点值的修改(增加或者减少)。空间复杂度 O(n)。
+
+> 利用数组实现前缀和,查询本来是 O(1),但是对于频繁更新的数组,每次重新计算前缀和,时间复杂度 O(n)。此时树状数组的优势便立即显现。
+
+## 一. 一维树状数组概念
+
+
+
+
+树状数组名字虽然又有树,又有数组,但是它实际上物理形式还是数组,不过每个节点的含义是树的关系,如上图。树状数组中父子节点下标关系是 {{< katex >}}parent = son + 2^{k}{{< /katex >}},其中 k 是子节点下标对应二进制末尾 0 的个数。
+
+例如上图中 A 和 B 都是数组。A 数组正常存储数据,B 数组是树状数组。B4,B6,B7 是 B8 的子节点。4 的二进制是 100,4 + {{< katex >}}2^{2}{{< /katex >}} = 8,所以 8 是 4 的父节点。同理,7 的二进制 111,7 + {{< katex >}}2^{0}{{< /katex >}} = 8,8 也是 7 的父节点。
+
+
+### 1. 节点意义
+
+在树状数组中,所有的奇数下标的节点的含义是叶子节点,表示单点,它存的值是原数组相同下标存的值。例如上图中 B1,B3,B5,B7 分别存的值是 A1,A3,A5,A7。所有的偶数下标的节点均是父节点。父节点内存的是区间和。例如 B4 内存的是 B1 + B2 + B3 + A4 = A1 + A2 + A3 + A4。这个区间的左边界是该父节点最左边叶子节点对应的下标,右边界就是自己的下标。例如 B8 表示的区间左边界是 B1,右边界是 B8,所以它表示的区间和是 A1 + A2 + …… + A8。
+
+{{< katex display >}}
+\begin{aligned}
+B_{1} &= A_{1} \\
+B_{2} &= B_{1} + A_{2} = A_{1} + A_{2} \\
+B_{3} &= A_{3} \\
+B_{4} &= B_{2} + B_{3} + A_{4} = A_{1} + A_{2} + A_{3} + A_{4} \\
+B_{5} &= A_{5} \\
+B_{6} &= B_{5} + A_{6} = A_{5} + A_{6} \\
+B_{7} &= A_{7} \\
+B_{8} &= B_{4} + B_{6} + B_{7} + A_{8} = A_{1} + A_{2} + A_{3} + A_{4} + A_{5} + A_{6} + A_{7} + A_{8} \\
+\end{aligned}
+{{< /katex >}}
+
+
+由数学归纳法可以得出,左边界的下标一定是 {{< katex >}}i - 2^{k} + 1{{< /katex >}},其中 i 为父节点的下标,k 为 i 的二进制中末尾 0 的个数。用数学方式表达偶数节点的区间和:
+
+{{< katex display >}}
+B_{i} = \sum_{j = i - 2^{k} + 1}^{i} A_{j}
+{{< /katex >}}
+
+初始化树状数组的代码如下:
+
+```go
+// BinaryIndexedTree define
+type BinaryIndexedTree struct {
+ tree []int
+ capacity int
+}
+
+// Init define
+func (bit *BinaryIndexedTree) Init(nums []int) {
+ bit.tree, bit.capacity = make([]int, len(nums)+1), len(nums)+1
+ for i := 1; i <= len(nums); i++ {
+ bit.tree[i] += nums[i-1]
+ for j := i - 2; j >= i-lowbit(i); j-- {
+ bit.tree[i] += nums[j]
+ }
+ }
+}
+```
+
+lowbit(i) 函数返回 i 转换成二进制以后,末尾最后一个 1 代表的数值,即 {{< katex >}}2^{k}{{< /katex >}},k 为 i 末尾 0 的个数。我们都知道,在计算机系统中,数值一律用补码来表示和存储。原因在于,使用补码,可以将符号位和数值域统一处理;同时,加法和减法也可以统一处理。利用补码,可以 O(1) 算出 lowbit(i)。负数的补码等于正数的原码每位取反再 + 1,加一会使得负数的补码末尾的 0 和正数原码末尾的 0 一样。这两个数进行 & 运算以后,结果即为 lowbit(i):
+
+```go
+func lowbit(x int) int {
+ return x & -x
+}
+```
+
+如果还想不通的读者,可以看这个例子,34 的二进制是 {{< katex >}}(0010 0010)_{2} {{< /katex >}},它的补码是 {{< katex >}}(1101 1110)_{2} {{< /katex >}}。
+
+{{< katex display >}}
+(0010 0010)_{2} \& (1101 1110)_{2} = (0000 0010)_{2}
+{{< /katex >}}
+
+lowbit(34) 结果是 {{< katex >}}2^{k} = 2^{1} = 2 {{< /katex >}}
+
+### 2. 插入操作
+
+树状数组上的父子的下标满足 {{< katex >}}parent = son + 2^{k}{{< /katex >}} 关系,所以可以通过这个公式从叶子结点不断往上递归,直到访问到最大节点值为止,祖先结点最多为 logn 个。插入操作可以实现节点值的增加或者减少,代码实现如下:
+
+```go
+// Add define
+func (bit *BinaryIndexedTree) Add(index int, val int) {
+ for index <= bit.capacity {
+ bit.tree[index] += val
+ index += lowbit(index)
+ }
+}
+```
+
+
+
+
+### 3. 查询操作
+
+
+树状数组中查询 [1, i] 区间内的和。按照节点的含义,可以得出下面的关系:
+
+{{< katex display >}}
+\begin{aligned}
+Query(i) &= A_{1} + A_{2} + ...... + A_{i} \\
+&= A_{1} + A_{2} + A_{i-2^{k}} + A_{i-2^{k}+1} + ...... + A_{i} \\
+&= A_{1} + A_{2} + A_{i-2^{k}} + B_{i} \\
+&= Query(i-2^{k}) + B_{i} \\
+&= Query(i-lowbit(i)) + B_{i} \\
+\end{aligned}
+{{< /katex >}}
+
+{{< katex >}}B_{i}{{< /katex >}} 是树状数组存的值。Query 操作实际是一个递归的过程。lowbit(i) 表示 {{< katex >}}2^{k}{{< /katex >}},其中 k 是 i 的二进制表示中末尾 0 的个数。i - lowbit(i) 将 i 的二进制中末尾的 1 去掉,最多有 {{< katex >}}log(i){{< /katex >}} 个 1,所以查询操作最坏的时间复杂度是 O(log n)。查询操作实现代码如下:
+
+```go
+// Query define
+func (bit *BinaryIndexedTree) Query(index int) int {
+ sum := 0
+ for index >= 1 {
+ sum += bit.tree[index]
+ index -= lowbit(index)
+ }
+ return sum
+}
+```
+
+## 二. 不同场景下树状数组的功能
+
+根据节点维护的数据含义不同,树状数组可以提供不同的功能来满足各种各样的区间场景。下面我们先以上例中讲述的区间和为例,进而引出 RMQ 的使用场景。
+
+### 1. 单点增减 + 区间求和
+
+这种场景是树状数组最经典的场景。单点增减分别调用 add(i,v) 和 add(i,-v)。区间求和,利用前缀和的思想,求 [m,n] 区间和,即 query(n) - query(m-1)。query(n) 代表 [1,n] 区间内的和,query(m-1) 代表 [1,m-1] 区间内的和,两者相减,即 [m,n] 区间内的和。
+
+> LeetCode 对应题目是 [307. Range Sum Query - Mutable](https://books.halfrost.com/leetcode/ChapterFour/0300~0399/0307.Range-Sum-Query-Mutable/)、[327. Count of Range Sum](https://books.halfrost.com/leetcode/ChapterFour/0300~0399/0327.Count-of-Range-Sum/)
+
+### 2. 区间增减 + 单点查询
+
+这种情况需要做一下转化。定义差分数组 {{< katex >}}C_{i}{{< /katex >}} 代表 {{< katex >}}C_{i} = A_{i} - A_{i-1}{{< /katex >}}。那么:
+
+{{< katex display >}}
+\begin{aligned}
+C_{0} &= A_{0} \\
+C_{1} &= A_{1} - A_{0}\\
+C_{2} &= A_{2} - A_{1}\\
+......\\
+C_{n} &= A_{n} - A_{n-1}\\
+\sum_{j=1}^{n}C_{j} &= A_{n}\\
+\end{aligned}
+{{< /katex >}}
+
+区间增减:在 [m,n] 区间内每一个数都增加 v,只影响 2 个单点的值:
+
+{{< katex display >}}
+\begin{aligned}
+C_{m} &= (A_{m} + v) - A_{m-1}\\
+C_{m+1} &= (A_{m+1} + v) - (A_{m} + v)\\
+C_{m+2} &= (A_{m+2} + v) - (A_{m+1} + v)\\
+......\\
+C_{n} &= (A_{n} + v) - (A_{n-1} + v)\\
+C_{n+1} &= A_{n+1} - (A_{n} + v)\\
+\end{aligned}
+{{< /katex >}}
+
+
+可以观察看,{{< katex >}}C_{m+1}, C_{m+2}, ......, C_{n}{{< /katex >}} 值都不变,变化的是 {{< katex >}}C_{m}, C_{n+1}{{< /katex >}}。所以在这种情况下,区间增加只需要执行 add(m,v) 和 add(n+1,-v) 即可。
+
+单点查询这时就是求前缀和了,{{< katex >}}A_{n} = \sum_{j=1}^{n}C_{j}{{< /katex >}},即 query(n)。
+
+### 3. 区间增减 + 区间求和
+
+这种情况是上面一种情况的增强版。区间增减的做法和上面做法一致,构造差分数组。这里主要说明区间查询怎么做。先来看 [1,n] 区间和如何求:
+
+
+
+{{< katex display >}}
+A_{1} + A_{2} + A_{3} + ...... + A_{n}\\
+\begin{aligned}
+ &= (C_{1}) + (C_{1} + C_{2}) + (C_{1} + C_{2} + C_{3}) + ...... + \sum_{1}^{n}C_{n}\\
+&= n * C_{1} + (n-1) * C_{2} + ...... + C_{n}\\
+&= n * (C_{1} + C_{2} + C_{3} + ...... + C_{n}) - (0 * C_{1} + 1 * C_{2} + 2 * C_{3} + ...... + (n - 1) * C_{n})\\
+&= n * \sum_{1}^{n}C_{n} - (D_{1} + D_{2} + D_{3} + ...... + D_{n})\\
+&= n * \sum_{1}^{n}C_{n} - \sum_{1}^{n}D_{n}\\
+\end{aligned}
+{{< /katex >}}
+
+其中 {{< katex >}}D_{n} = (n - 1) * C_{n}{{< /katex >}}
+
+所以求区间和,只需要再构造一个 {{< katex >}}D_{n}{{< /katex >}} 即可。
+
+{{< katex display >}}
+\begin{aligned}
+\sum_{1}^{n}A_{n} &= A_{1} + A_{2} + A_{3} + ...... + A_{n} \\
+&= n * \sum_{1}^{n}C_{n} - \sum_{1}^{n}D_{n}\\
+\end{aligned}
+{{< /katex >}}
+
+以此类推,推到更一般的情况:
+
+{{< katex display >}}
+\begin{aligned}
+\sum_{m}^{n}A_{n} &= A_{m} + A_{m+1} + A_{m+2} + ...... + A_{n} \\
+&= \sum_{1}^{n}A_{n} - \sum_{1}^{m-1}A_{n}\\
+&= (n * \sum_{1}^{n}C_{n} - \sum_{1}^{n}D_{n}) - ((m-1) * \sum_{1}^{m-1}C_{m-1} - \sum_{1}^{m-1}D_{m-1})\\
+\end{aligned}
+{{< /katex >}}
+
+至此区间查询问题得解。
+
+### 4. 单点增减 + 区间最值
+
+线段树最基础的运用是区间求和,但是将 sum 操作换成 max 操作以后,也可以求区间最值,并且时间复杂度完全没有变。那树状数组呢?也可以实现相同的功能么?答案是可以的,不过时间复杂度会下降一点。
+
+线段树求区间和,把每个小区间的和计算好,然后依次 pushUp,往上更新。把 sum 换成 max 操作,含义完全相同:取出小区间的最大值,然后依次 pushUp 得到整个区间的最大值。
+
+树状数组求区间和,是将单点增减的增量影响更新到固定区间 {{< katex >}}[i-2^{k}+1, i]{{< /katex >}}。但是把 sum 换成 max 操作,含义就变了。此时单点的增量和区间 max 值并无直接联系。暴力的方式是将该点与区间内所有值比较大小,取出最大值,时间复杂度 O(n * log n)。仔细观察树状数组的结构,可以发现不必枚举所有区间。例如更新 {{< katex >}}A_{i}{{< /katex >}} 的值,那么受到影响的树状数组下标为 {{< katex >}}i-2^{0}, i-2^{1}, i-2^{2}, i-2^{3}, ......, i-2^{k}{{< /katex >}},其中 {{< katex >}}2^{k} < lowbit(i) \leqslant 2^{k+1}{{< /katex >}}。需要更新至多 k 个下标,外层循环由 O(n) 降为了 O(log n)。区间内部每次都需要重新比较,需要 O(log n) 的复杂度,总的时间复杂度为 {{< katex >}}(O(log n))^2 {{< /katex >}}。
+
+```go
+func (bit *BinaryIndexedTree) Add(index int, val int) {
+ for index <= bit.capacity {
+ bit.tree[index] = val
+ for i := 1; i < lowbit(index); i = i << 1 {
+ bit.tree[index] = max(bit.tree[index], bit.tree[index-i])
+ }
+ index += lowbit(index)
+ }
+}
+```
+
+上面解决了单点更新的问题,再来看区间最值。线段树划分区间是均分,对半分,而树状数组不是均分。在树状数组中 {{< katex >}}B_{i} {{< /katex >}} 表示的区间是 {{< katex >}}[i-2^{k}+1, i]{{< /katex >}},据此划分“不规则区间”。对于树状数组求 [m,n] 区间内最值,
+
+- 如果 {{< katex >}} m < n - 2^{k} {{< /katex >}},那么 {{< katex >}} query(m,n) = max(query(m,n-2^{k}), B_{n}){{< /katex >}}
+- 如果 {{< katex >}} m >= n - 2^{k} {{< /katex >}},那么 {{< katex >}} query(m,n) = max(query(m,n-1), A_{n}){{< /katex >}}
+
+
+```go
+func (bit *BinaryIndexedTree) Query(m, n int) int {
+ res := 0
+ for n >= m {
+ res = max(nums[n], res)
+ n--
+ for ; n-lowbit(n) >= m; n -= lowbit(n) {
+ res = max(bit.tree[n], res)
+ }
+ }
+ return res
+}
+```
+
+n 最多经过 {{< katex >}}(O(log n))^2 {{< /katex >}} 变化,最终 n < m。时间复杂度为 {{< katex >}}(O(log n))^2 {{< /katex >}}。
+
+针对这类问题放一道经典例题[《HDU 1754 I Hate It》](http://acm.hdu.edu.cn/showproblem.php?pid=1754):
+
+Problem Description
+很多学校流行一种比较的习惯。老师们很喜欢询问,从某某到某某当中,分数最高的是多少。这让很多学生很反感。不管你喜不喜欢,现在需要你做的是,就是按照老师的要求,写一个程序,模拟老师的询问。当然,老师有时候需要更新某位同学的成绩。
+
+
+Input
+本题目包含多组测试,请处理到文件结束。
+在每个测试的第一行,有两个正整数 N 和 M ( 0