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/README.md b/README.md index 5fe807a1b..ebb30e7d1 100755 --- a/README.md +++ b/README.md @@ -10,9 +10,9 @@ ![](./website/static/wechat-qr-code.png)

-GitHub All Releases +GitHub All Releases - + @@ -23,7 +23,7 @@

-GitHub +GitHub @@ -126,2282 +126,2463 @@ | | Easy | Medium | Hard | Total | |:--------:|:--------:|:--------:|:--------:|:--------:| -|Optimizing|33|66|38|137| -|Accepted|**293**|**464**|**136**|**893**| -|Total|568|1203|492|2263| -|Perfection Rate|88.7%|85.8%|72.1%|84.7%| -|Completion Rate|51.6%|38.6%|27.6%|39.5%| +|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%| |------------|----------------------------|----------------------------|----------------------------|----------------------------| ## 二. 目录 -以下已经收录了 776 道题的题解,还有 11 道题在尝试优化到 beats 100% +以下已经收录了 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)|48.6%|Easy|| -|0002|Add Two Numbers|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0002.Add-Two-Numbers)|38.6%|Medium|| -|0003|Longest Substring Without Repeating Characters|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0003.Longest-Substring-Without-Repeating-Characters)|33.1%|Medium|| -|0004|Median of Two Sorted Arrays|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0004.Median-of-Two-Sorted-Arrays)|34.1%|Hard|| -|0005|Longest Palindromic Substring|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0005.Longest-Palindromic-Substring)|31.8%|Medium|| -|0006|Zigzag Conversion|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0006.Zigzag-Conversion)|41.6%|Medium|| -|0007|Reverse Integer|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0007.Reverse-Integer)|26.7%|Medium|| -|0008|String to Integer (atoi)|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0008.String-to-Integer-atoi)|16.5%|Medium|| -|0009|Palindrome Number|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0009.Palindrome-Number)|52.4%|Easy|| -|0010|Regular Expression Matching||28.2%|Hard|| -|0011|Container With Most Water|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0011.Container-With-Most-Water)|53.9%|Medium|| -|0012|Integer to Roman|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0012.Integer-to-Roman)|59.5%|Medium|| -|0013|Roman to Integer|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0013.Roman-to-Integer)|57.9%|Easy|| -|0014|Longest Common Prefix|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0014.Longest-Common-Prefix)|39.4%|Easy|| -|0015|3Sum|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0015.3Sum)|31.1%|Medium|| -|0016|3Sum Closest|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0016.3Sum-Closest)|47.1%|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)|53.6%|Medium|| -|0018|4Sum|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0018.4Sum)|37.3%|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)|38.3%|Medium|| -|0020|Valid Parentheses|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0020.Valid-Parentheses)|40.9%|Easy|| -|0021|Merge Two Sorted Lists|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0021.Merge-Two-Sorted-Lists)|60.3%|Easy|| -|0022|Generate Parentheses|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0022.Generate-Parentheses)|70.1%|Medium|| -|0023|Merge k Sorted Lists|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0023.Merge-k-Sorted-Lists)|47.1%|Hard|| -|0024|Swap Nodes in Pairs|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0024.Swap-Nodes-in-Pairs)|58.8%|Medium|| -|0025|Reverse Nodes in k-Group|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0025.Reverse-Nodes-in-k-Group)|51.1%|Hard|| -|0026|Remove Duplicates from Sorted Array|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0026.Remove-Duplicates-from-Sorted-Array)|48.9%|Easy|| -|0027|Remove Element|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0027.Remove-Element)|51.2%|Easy|| -|0028|Implement strStr()|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0028.Implement-strStr)|35.9%|Easy|| -|0029|Divide Two Integers|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0029.Divide-Two-Integers)|17.0%|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)|28.1%|Hard|| -|0031|Next Permutation|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0031.Next-Permutation)|36.4%|Medium|| -|0032|Longest Valid Parentheses|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0032.Longest-Valid-Parentheses)|31.3%|Hard|| -|0033|Search in Rotated Sorted Array|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0033.Search-in-Rotated-Sorted-Array)|37.8%|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)|40.1%|Medium|| -|0035|Search Insert Position|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0035.Search-Insert-Position)|42.3%|Easy|| -|0036|Valid Sudoku|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0036.Valid-Sudoku)|55.1%|Medium|| -|0037|Sudoku Solver|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0037.Sudoku-Solver)|54.0%|Hard|| -|0038|Count and Say||48.7%|Medium|| -|0039|Combination Sum|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0039.Combination-Sum)|65.5%|Medium|| -|0040|Combination Sum II|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0040.Combination-Sum-II)|52.4%|Medium|| -|0041|First Missing Positive|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0041.First-Missing-Positive)|36.0%|Hard|| -|0042|Trapping Rain Water|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0042.Trapping-Rain-Water)|56.5%|Hard|| -|0043|Multiply Strings|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0043.Multiply-Strings)|37.7%|Medium|| -|0044|Wildcard Matching||26.6%|Hard|| -|0045|Jump Game II|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0045.Jump-Game-II)|37.2%|Medium|| -|0046|Permutations|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0046.Permutations)|72.3%|Medium|| -|0047|Permutations II|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0047.Permutations-II)|54.2%|Medium|| -|0048|Rotate Image|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0048.Rotate-Image)|66.7%|Medium|| -|0049|Group Anagrams|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0049.Group-Anagrams)|64.2%|Medium|| -|0050|Pow(x, n)|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0050.Powx-n)|32.4%|Medium|| -|0051|N-Queens|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0051.N-Queens)|57.5%|Hard|| -|0052|N-Queens II|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0052.N-Queens-II)|66.3%|Hard|| -|0053|Maximum Subarray|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0053.Maximum-Subarray)|49.5%|Easy|| -|0054|Spiral Matrix|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0054.Spiral-Matrix)|41.4%|Medium|| -|0055|Jump Game|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0055.Jump-Game)|37.8%|Medium|| -|0056|Merge Intervals|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0056.Merge-Intervals)|44.9%|Medium|| -|0057|Insert Interval|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0057.Insert-Interval)|37.4%|Medium|| -|0058|Length of Last Word|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0058.Length-of-Last-Word)|37.7%|Easy|| -|0059|Spiral Matrix II|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0059.Spiral-Matrix-II)|64.9%|Medium|| -|0060|Permutation Sequence|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0060.Permutation-Sequence)|42.1%|Hard|| -|0061|Rotate List|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0061.Rotate-List)|34.9%|Medium|| -|0062|Unique Paths|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0062.Unique-Paths)|60.1%|Medium|| -|0063|Unique Paths II|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0063.Unique-Paths-II)|37.5%|Medium|| -|0064|Minimum Path Sum|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0064.Minimum-Path-Sum)|59.4%|Medium|| -|0065|Valid Number|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0065.Valid-Number)|18.2%|Hard|| -|0066|Plus One|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0066.Plus-One)|42.8%|Easy|| -|0067|Add Binary|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0067.Add-Binary)|50.5%|Easy|| -|0068|Text Justification||35.2%|Hard|| -|0069|Sqrt(x)|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0069.Sqrtx)|36.5%|Easy|| -|0070|Climbing Stairs|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0070.Climbing-Stairs)|51.0%|Easy|| -|0071|Simplify Path|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0071.Simplify-Path)|38.8%|Medium|| -|0072|Edit Distance||50.8%|Hard|| -|0073|Set Matrix Zeroes|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0073.Set-Matrix-Zeroes)|48.3%|Medium|| -|0074|Search a 2D Matrix|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0074.Search-a-2D-Matrix)|44.5%|Medium|| -|0075|Sort Colors|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0075.Sort-Colors)|54.8%|Medium|| -|0076|Minimum Window Substring|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0076.Minimum-Window-Substring)|39.0%|Hard|| -|0077|Combinations|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0077.Combinations)|64.0%|Medium|| -|0078|Subsets|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0078.Subsets)|71.5%|Medium|| -|0079|Word Search|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0079.Word-Search)|39.7%|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)|50.6%|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.6%|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)|44.3%|Medium|| -|0083|Remove Duplicates from Sorted List|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0083.Remove-Duplicates-from-Sorted-List)|49.0%|Easy|| -|0084|Largest Rectangle in Histogram|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0084.Largest-Rectangle-in-Histogram)|40.8%|Hard|| -|0085|Maximal Rectangle||42.8%|Hard|| -|0086|Partition List|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0086.Partition-List)|47.9%|Medium|| -|0087|Scramble String||35.6%|Hard|| -|0088|Merge Sorted Array|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0088.Merge-Sorted-Array)|43.9%|Easy|| -|0089|Gray Code|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0089.Gray-Code)|55.3%|Medium|| -|0090|Subsets II|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0090.Subsets-II)|53.3%|Medium|| -|0091|Decode Ways|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0091.Decode-Ways)|30.3%|Medium|| -|0092|Reverse Linked List II|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0092.Reverse-Linked-List-II)|43.4%|Medium|| -|0093|Restore IP Addresses|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0093.Restore-IP-Addresses)|41.9%|Medium|| -|0094|Binary Tree Inorder Traversal|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0094.Binary-Tree-Inorder-Traversal)|70.8%|Easy|| -|0095|Unique Binary Search Trees II|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0095.Unique-Binary-Search-Trees-II)|49.5%|Medium|| -|0096|Unique Binary Search Trees|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0096.Unique-Binary-Search-Trees)|58.3%|Medium|| -|0097|Interleaving String|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0097.Interleaving-String)|34.8%|Medium|| -|0098|Validate Binary Search Tree|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0098.Validate-Binary-Search-Tree)|30.5%|Medium|| -|0099|Recover Binary Search Tree|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0099.Recover-Binary-Search-Tree)|48.7%|Medium|| -|0100|Same Tree|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0100.Same-Tree)|55.5%|Easy|| -|0101|Symmetric Tree|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0101.Symmetric-Tree)|51.6%|Easy|| -|0102|Binary Tree Level Order Traversal|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0102.Binary-Tree-Level-Order-Traversal)|61.0%|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)|53.6%|Medium|| -|0104|Maximum Depth of Binary Tree|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0104.Maximum-Depth-of-Binary-Tree)|71.9%|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)|57.7%|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)|55.4%|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)|58.7%|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)|66.1%|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)|55.6%|Medium|| -|0110|Balanced Binary Tree|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0110.Balanced-Binary-Tree)|46.8%|Easy|| -|0111|Minimum Depth of Binary Tree|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0111.Minimum-Depth-of-Binary-Tree)|42.5%|Easy|| -|0112|Path Sum|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0112.Path-Sum)|45.6%|Easy|| -|0113|Path Sum II|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0113.Path-Sum-II)|54.0%|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)|57.8%|Medium|| -|0115|Distinct Subsequences|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0115.Distinct-Subsequences)|42.3%|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)|57.1%|Medium|| -|0117|Populating Next Right Pointers in Each Node II||46.6%|Medium|| -|0118|Pascal's Triangle|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0118.Pascals-Triangle)|64.6%|Easy|| -|0119|Pascal's Triangle II|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0119.Pascals-Triangle-II)|57.6%|Easy|| -|0120|Triangle|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0120.Triangle)|50.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.1%|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)|62.0%|Medium|| -|0123|Best Time to Buy and Sell Stock III||43.2%|Hard|| -|0124|Binary Tree Maximum Path Sum|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0124.Binary-Tree-Maximum-Path-Sum)|37.7%|Hard|| -|0125|Valid Palindrome|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0125.Valid-Palindrome)|41.7%|Easy|| -|0126|Word Ladder II|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0126.Word-Ladder-II)|27.0%|Hard|| -|0127|Word Ladder|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0127.Word-Ladder)|35.5%|Hard|| -|0128|Longest Consecutive Sequence|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0128.Longest-Consecutive-Sequence)|48.7%|Medium|| -|0129|Sum Root to Leaf Numbers|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0129.Sum-Root-to-Leaf-Numbers)|57.0%|Medium|| -|0130|Surrounded Regions|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0130.Surrounded-Regions)|34.0%|Medium|| -|0131|Palindrome Partitioning|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0131.Palindrome-Partitioning)|59.5%|Medium|| -|0132|Palindrome Partitioning II||33.2%|Hard|| -|0133|Clone Graph||47.7%|Medium|| -|0134|Gas Station||44.5%|Medium|| -|0135|Candy|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0135.Candy)|37.1%|Hard|| -|0136|Single Number|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0136.Single-Number)|69.4%|Easy|| -|0137|Single Number II|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0137.Single-Number-II)|56.6%|Medium|| -|0138|Copy List with Random Pointer|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0138.Copy-List-with-Random-Pointer)|48.2%|Medium|| -|0139|Word Break||44.6%|Medium|| -|0140|Word Break II||42.2%|Hard|| -|0141|Linked List Cycle|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0141.Linked-List-Cycle)|45.9%|Easy|| -|0142|Linked List Cycle II|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0142.Linked-List-Cycle-II)|44.3%|Medium|| -|0143|Reorder List|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0143.Reorder-List)|48.0%|Medium|| -|0144|Binary Tree Preorder Traversal|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0144.Binary-Tree-Preorder-Traversal)|62.6%|Easy|| -|0145|Binary Tree Postorder Traversal|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0145.Binary-Tree-Postorder-Traversal)|64.1%|Easy|| -|0146|LRU Cache|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0146.LRU-Cache)|39.9%|Medium|| -|0147|Insertion Sort List|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0147.Insertion-Sort-List)|48.9%|Medium|| -|0148|Sort List|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0148.Sort-List)|52.1%|Medium|| -|0149|Max Points on a Line||20.5%|Hard|| -|0150|Evaluate Reverse Polish Notation|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0150.Evaluate-Reverse-Polish-Notation)|42.6%|Medium|| -|0151|Reverse Words in a String|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0151.Reverse-Words-in-a-String)|28.5%|Medium|| -|0152|Maximum Product Subarray|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0152.Maximum-Product-Subarray)|34.6%|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)|47.9%|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.3%|Hard|| -|0155|Min Stack|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0155.Min-Stack)|50.2%|Easy|| -|0156|Binary Tree Upside Down||60.4%|Medium|| -|0157|Read N Characters Given Read4||40.3%|Easy|| -|0158|Read N Characters Given read4 II - Call Multiple Times||40.9%|Hard|| -|0159|Longest Substring with At Most Two Distinct Characters||52.7%|Medium|| -|0160|Intersection of Two Linked Lists|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0160.Intersection-of-Two-Linked-Lists)|50.0%|Easy|| -|0161|One Edit Distance||34.0%|Medium|| -|0162|Find Peak Element|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0162.Find-Peak-Element)|46.0%|Medium|| -|0163|Missing Ranges||31.3%|Easy|| -|0164|Maximum Gap|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0164.Maximum-Gap)|41.4%|Hard|| -|0165|Compare Version Numbers||34.6%|Medium|| -|0166|Fraction to Recurring Decimal||23.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)|58.8%|Medium|| -|0168|Excel Sheet Column Title|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0168.Excel-Sheet-Column-Title)|33.9%|Easy|| -|0169|Majority Element|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0169.Majority-Element)|62.9%|Easy|| -|0170|Two Sum III - Data structure design||36.8%|Easy|| -|0171|Excel Sheet Column Number|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0171.Excel-Sheet-Column-Number)|60.7%|Easy|| -|0172|Factorial Trailing Zeroes|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0172.Factorial-Trailing-Zeroes)|40.8%|Medium|| -|0173|Binary Search Tree Iterator|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0173.Binary-Search-Tree-Iterator)|67.3%|Medium|| -|0174|Dungeon Game|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0174.Dungeon-Game)|36.5%|Hard|| -|0175|Combine Two Tables||70.3%|Easy|| -|0176|Second Highest Salary||35.3%|Medium|| -|0177|Nth Highest Salary||36.1%|Medium|| -|0178|Rank Scores||57.5%|Medium|| -|0179|Largest Number|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0179.Largest-Number)|32.9%|Medium|| -|0180|Consecutive Numbers||45.6%|Medium|| -|0181|Employees Earning More Than Their Managers||66.4%|Easy|| -|0182|Duplicate Emails||69.0%|Easy|| -|0183|Customers Who Never Order||63.4%|Easy|| -|0184|Department Highest Salary||47.0%|Medium|| -|0185|Department Top Three Salaries||47.2%|Hard|| -|0186|Reverse Words in a String II||51.0%|Medium|| -|0187|Repeated DNA Sequences|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0187.Repeated-DNA-Sequences)|44.7%|Medium|| -|0188|Best Time to Buy and Sell Stock IV||33.7%|Hard|| -|0189|Rotate Array|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0189.Rotate-Array)|38.6%|Medium|| -|0190|Reverse Bits|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0190.Reverse-Bits)|49.0%|Easy|| -|0191|Number of 1 Bits|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0191.Number-of-1-Bits)|60.6%|Easy|| +|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||25.8%|Easy|| -|0194|Transpose File||25.1%|Medium|| +|0193|Valid Phone Numbers||26.0%|Easy|| +|0194|Transpose File||25.3%|Medium|| |0195|Tenth Line||32.9%|Easy|| -|0196|Delete Duplicate Emails||52.6%|Easy|| -|0197|Rising Temperature||42.6%|Easy|| -|0198|House Robber|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0198.House-Robber)|47.2%|Medium|| -|0199|Binary Tree Right Side View|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0199.Binary-Tree-Right-Side-View)|59.6%|Medium|| -|0200|Number of Islands|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0200.Number-of-Islands)|54.0%|Medium|| -|0201|Bitwise AND of Numbers Range|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0201.Bitwise-AND-of-Numbers-Range)|41.8%|Medium|| -|0202|Happy Number|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0202.Happy-Number)|53.2%|Easy|| -|0203|Remove Linked List Elements|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0203.Remove-Linked-List-Elements)|43.5%|Easy|| -|0204|Count Primes|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0204.Count-Primes)|33.0%|Medium|| -|0205|Isomorphic Strings|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0205.Isomorphic-Strings)|42.1%|Easy|| -|0206|Reverse Linked List|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0206.Reverse-Linked-List)|70.3%|Easy|| -|0207|Course Schedule|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0207.Course-Schedule)|45.1%|Medium|| -|0208|Implement Trie (Prefix Tree)|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0208.Implement-Trie-Prefix-Tree)|58.2%|Medium|| -|0209|Minimum Size Subarray Sum|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0209.Minimum-Size-Subarray-Sum)|43.3%|Medium|| -|0210|Course Schedule II|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0210.Course-Schedule-II)|46.6%|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)|44.0%|Medium|| -|0212|Word Search II|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0212.Word-Search-II)|37.9%|Hard|| -|0213|House Robber II|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0213.House-Robber-II)|39.9%|Medium|| -|0214|Shortest Palindrome||31.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)|63.5%|Medium|| -|0216|Combination Sum III|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0216.Combination-Sum-III)|64.0%|Medium|| -|0217|Contains Duplicate|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0217.Contains-Duplicate)|60.8%|Easy|| -|0218|The Skyline Problem|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0218.The-Skyline-Problem)|38.7%|Hard|| -|0219|Contains Duplicate II|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0219.Contains-Duplicate-II)|40.7%|Easy|| -|0220|Contains Duplicate III|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0220.Contains-Duplicate-III)|21.7%|Medium|| -|0221|Maximal Square||43.5%|Medium|| -|0222|Count Complete Tree Nodes|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0222.Count-Complete-Tree-Nodes)|55.3%|Medium|| -|0223|Rectangle Area|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0223.Rectangle-Area)|40.1%|Medium|| -|0224|Basic Calculator|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0224.Basic-Calculator)|40.5%|Hard|| -|0225|Implement Stack using Queues|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0225.Implement-Stack-using-Queues)|55.2%|Easy|| -|0226|Invert Binary Tree|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0226.Invert-Binary-Tree)|71.6%|Easy|| -|0227|Basic Calculator II|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0227.Basic-Calculator-II)|41.6%|Medium|| -|0228|Summary Ranges|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0228.Summary-Ranges)|46.4%|Easy|| -|0229|Majority Element II|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0229.Majority-Element-II)|42.4%|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)|67.7%|Medium|| -|0231|Power of Two|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0231.Power-of-Two)|45.0%|Easy|| -|0232|Implement Queue using Stacks|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0232.Implement-Queue-using-Stacks)|58.3%|Easy|| -|0233|Number of Digit One||33.6%|Hard|| -|0234|Palindrome Linked List|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0234.Palindrome-Linked-List)|46.6%|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)|57.1%|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)|55.4%|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)|71.9%|Easy|| -|0238|Product of Array Except Self||64.0%|Medium|| -|0239|Sliding Window Maximum|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0239.Sliding-Window-Maximum)|46.2%|Hard|| -|0240|Search a 2D Matrix II|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0240.Search-a-2D-Matrix-II)|48.4%|Medium|| -|0241|Different Ways to Add Parentheses||61.7%|Medium|| -|0242|Valid Anagram|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0242.Valid-Anagram)|61.5%|Easy|| -|0243|Shortest Word Distance||64.4%|Easy|| -|0244|Shortest Word Distance II||59.6%|Medium|| -|0245|Shortest Word Distance III||57.2%|Medium|| +|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.0%|Medium|| -|0248|Strobogrammatic Number III||41.4%|Hard|| -|0249|Group Shifted Strings||63.6%|Medium|| -|0250|Count Univalue Subtrees||54.8%|Medium|| -|0251|Flatten 2D Vector||48.0%|Medium|| -|0252|Meeting Rooms||56.7%|Easy|| -|0253|Meeting Rooms II||49.7%|Medium|| -|0254|Factor Combinations||48.7%|Medium|| -|0255|Verify Preorder Sequence in Binary Search Tree||47.5%|Medium|| -|0256|Paint House||58.8%|Medium|| -|0257|Binary Tree Paths|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0257.Binary-Tree-Paths)|58.7%|Easy|| -|0258|Add Digits|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0258.Add-Digits)|62.5%|Easy|| -|0259|3Sum Smaller||50.3%|Medium|| -|0260|Single Number III|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0260.Single-Number-III)|67.2%|Medium|| -|0261|Graph Valid Tree||45.8%|Medium|| -|0262|Trips and Users||37.8%|Hard|| -|0263|Ugly Number|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0263.Ugly-Number)|41.8%|Easy|| -|0264|Ugly Number II|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0264.Ugly-Number-II)|45.3%|Medium|| -|0265|Paint House II||50.8%|Hard|| -|0266|Palindrome Permutation||65.4%|Easy|| -|0267|Palindrome Permutation II||39.7%|Medium|| -|0268|Missing Number|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0268.Missing-Number)|59.4%|Easy|| -|0269|Alien Dictionary||34.9%|Hard|| -|0270|Closest Binary Search Tree Value||53.8%|Easy|| -|0271|Encode and Decode Strings||38.1%|Medium|| -|0272|Closest Binary Search Tree Value II||57.0%|Hard|| -|0273|Integer to English Words||29.6%|Hard|| -|0274|H-Index|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0274.H-Index)|37.6%|Medium|| -|0275|H-Index II|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0275.H-Index-II)|37.0%|Medium|| -|0276|Paint Fence||42.9%|Medium|| -|0277|Find the Celebrity||46.5%|Medium|| -|0278|First Bad Version|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0278.First-Bad-Version)|41.7%|Easy|| -|0279|Perfect Squares|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0279.Perfect-Squares)|51.9%|Medium|| -|0280|Wiggle Sort||66.0%|Medium|| -|0281|Zigzag Iterator||61.5%|Medium|| +|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)|60.7%|Easy|| -|0284|Peeking Iterator|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0284.Peeking-Iterator)|57.6%|Medium|| -|0285|Inorder Successor in BST||47.2%|Medium|| -|0286|Walls and Gates||59.3%|Medium|| -|0287|Find the Duplicate Number|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0287.Find-the-Duplicate-Number)|58.8%|Medium|| -|0288|Unique Word Abbreviation||24.8%|Medium|| -|0289|Game of Life||65.3%|Medium|| -|0290|Word Pattern|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0290.Word-Pattern)|40.2%|Easy|| -|0291|Word Pattern II||46.3%|Medium|| -|0292|Nim Game||55.5%|Easy|| -|0293|Flip Game||62.6%|Easy|| -|0294|Flip Game II||51.5%|Medium|| -|0295|Find Median from Data Stream||50.3%|Hard|| -|0296|Best Meeting Point||59.4%|Hard|| -|0297|Serialize and Deserialize Binary Tree|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0297.Serialize-and-Deserialize-Binary-Tree)|53.8%|Hard|| -|0298|Binary Tree Longest Consecutive Sequence||51.2%|Medium|| -|0299|Bulls and Cows|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0299.Bulls-and-Cows)|47.2%|Medium|| -|0300|Longest Increasing Subsequence|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0300.Longest-Increasing-Subsequence)|49.3%|Medium|| -|0301|Remove Invalid Parentheses|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0301.Remove-Invalid-Parentheses)|46.9%|Hard|| -|0302|Smallest Rectangle Enclosing Black Pixels||57.0%|Hard|| -|0303|Range Sum Query - Immutable|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0303.Range-Sum-Query-Immutable)|55.5%|Easy|| -|0304|Range Sum Query 2D - Immutable|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0304.Range-Sum-Query-2D-Immutable)|47.8%|Medium|| -|0305|Number of Islands II||39.4%|Hard|| -|0306|Additive Number|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0306.Additive-Number)|30.6%|Medium|| -|0307|Range Sum Query - Mutable|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0307.Range-Sum-Query-Mutable)|38.7%|Medium|| -|0308|Range Sum Query 2D - Mutable||41.1%|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)|52.5%|Medium|| -|0310|Minimum Height Trees||38.1%|Medium|| -|0311|Sparse Matrix Multiplication||66.4%|Medium|| -|0312|Burst Balloons||56.3%|Hard|| -|0313|Super Ugly Number||45.7%|Medium|| -|0314|Binary Tree Vertical Order Traversal||51.3%|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.1%|Hard|| -|0316|Remove Duplicate Letters||43.9%|Medium|| -|0317|Shortest Distance from All Buildings||43.3%|Hard|| -|0318|Maximum Product of Word Lengths|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0318.Maximum-Product-of-Word-Lengths)|56.7%|Medium|| -|0319|Bulb Switcher|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0319.Bulb-Switcher)|47.3%|Medium|| -|0320|Generalized Abbreviation||56.4%|Medium|| -|0321|Create Maximum Number||28.4%|Hard|| -|0322|Coin Change|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0322.Coin-Change)|40.1%|Medium|| -|0323|Number of Connected Components in an Undirected Graph||61.1%|Medium|| -|0324|Wiggle Sort II|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0324.Wiggle-Sort-II)|32.2%|Medium|| -|0325|Maximum Size Subarray Sum Equals k||49.2%|Medium|| -|0326|Power of Three|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0326.Power-of-Three)|43.5%|Easy|| +|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)|59.5%|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)|49.7%|Hard|| -|0330|Patching Array||39.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)|43.7%|Medium|| -|0332|Reconstruct Itinerary||40.2%|Hard|| -|0333|Largest BST Subtree||41.3%|Medium|| -|0334|Increasing Triplet Subsequence||41.5%|Medium|| -|0335|Self Crossing||29.1%|Hard|| -|0336|Palindrome Pairs||35.8%|Hard|| -|0337|House Robber III|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0337.House-Robber-III)|53.5%|Medium|| -|0338|Counting Bits|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0338.Counting-Bits)|74.3%|Easy|| -|0339|Nested List Weight Sum||81.3%|Medium|| -|0340|Longest Substring with At Most K Distinct Characters||47.3%|Medium|| -|0341|Flatten Nested List Iterator|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0341.Flatten-Nested-List-Iterator)|58.8%|Medium|| -|0342|Power of Four|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0342.Power-of-Four)|44.0%|Easy|| -|0343|Integer Break|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0343.Integer-Break)|54.2%|Medium|| -|0344|Reverse String|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0344.Reverse-String)|74.9%|Easy|| -|0345|Reverse Vowels of a String|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0345.Reverse-Vowels-of-a-String)|47.0%|Easy|| -|0346|Moving Average from Data Stream||76.4%|Easy|| -|0347|Top K Frequent Elements|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0347.Top-K-Frequent-Elements)|65.1%|Medium|| -|0348|Design Tic-Tac-Toe||57.3%|Medium|| -|0349|Intersection of Two Arrays|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0349.Intersection-of-Two-Arrays)|69.1%|Easy|| -|0350|Intersection of Two Arrays II|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0350.Intersection-of-Two-Arrays-II)|54.9%|Easy|| -|0351|Android Unlock Patterns||51.0%|Medium|| -|0352|Data Stream as Disjoint Intervals|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0352.Data-Stream-as-Disjoint-Intervals)|50.7%|Hard|| -|0353|Design Snake Game||38.2%|Medium|| -|0354|Russian Doll Envelopes|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0354.Russian-Doll-Envelopes)|38.9%|Hard|| -|0355|Design Twitter||34.6%|Medium|| -|0356|Line Reflection||34.4%|Medium|| -|0357|Count Numbers with Unique Digits|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0357.Count-Numbers-with-Unique-Digits)|50.6%|Medium|| -|0358|Rearrange String k Distance Apart||37.1%|Hard|| -|0359|Logger Rate Limiter||74.9%|Easy|| -|0360|Sort Transformed Array||53.6%|Medium|| -|0361|Bomb Enemy||50.1%|Medium|| -|0362|Design Hit Counter||67.4%|Medium|| -|0363|Max Sum of Rectangle No Larger Than K||40.1%|Hard|| -|0364|Nested List Weight Sum II||68.5%|Medium|| -|0365|Water and Jug Problem||34.6%|Medium|| -|0366|Find Leaves of Binary Tree||78.6%|Medium|| -|0367|Valid Perfect Square|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0367.Valid-Perfect-Square)|43.0%|Easy|| -|0368|Largest Divisible Subset|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0368.Largest-Divisible-Subset)|40.6%|Medium|| -|0369|Plus One Linked List||60.5%|Medium|| -|0370|Range Addition||69.6%|Medium|| -|0371|Sum of Two Integers|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0371.Sum-of-Two-Integers)|50.6%|Medium|| -|0372|Super Pow|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0372.Super-Pow)|37.6%|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.8%|Medium|| -|0374|Guess Number Higher or Lower|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0374.Guess-Number-Higher-or-Lower)|49.2%|Easy|| -|0375|Guess Number Higher or Lower II||45.4%|Medium|| -|0376|Wiggle Subsequence|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0376.Wiggle-Subsequence)|44.9%|Medium|| -|0377|Combination Sum IV|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0377.Combination-Sum-IV)|49.4%|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)|59.7%|Medium|| -|0379|Design Phone Directory||50.3%|Medium|| -|0380|Insert Delete GetRandom O(1)||51.4%|Medium|| -|0381|Insert Delete GetRandom O(1) - Duplicates allowed||35.5%|Hard|| -|0382|Linked List Random Node|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0382.Linked-List-Random-Node)|59.0%|Medium|| -|0383|Ransom Note|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0383.Ransom-Note)|55.8%|Easy|| -|0384|Shuffle an Array|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0384.Shuffle-an-Array)|57.0%|Medium|| -|0385|Mini Parser|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0385.Mini-Parser)|35.9%|Medium|| -|0386|Lexicographical Numbers|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0386.Lexicographical-Numbers)|58.9%|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)|57.1%|Easy|| -|0388|Longest Absolute File Path||45.9%|Medium|| -|0389|Find the Difference|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0389.Find-the-Difference)|60.5%|Easy|| -|0390|Elimination Game|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0390.Elimination-Game)|46.4%|Medium|| -|0391|Perfect Rectangle|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0391.Perfect-Rectangle)|32.1%|Hard|| -|0392|Is Subsequence|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0392.Is-Subsequence)|51.0%|Easy|| -|0393|UTF-8 Validation|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0393.UTF-8-Validation)|39.2%|Medium|| -|0394|Decode String|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0394.Decode-String)|56.3%|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.6%|Medium|| -|0396|Rotate Function||39.3%|Medium|| -|0397|Integer Replacement|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0397.Integer-Replacement)|34.7%|Medium|| -|0398|Random Pick Index||63.7%|Medium|| -|0399|Evaluate Division|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0399.Evaluate-Division)|58.6%|Medium|| -|0400|Nth Digit|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0400.Nth-Digit)|33.5%|Medium|| -|0401|Binary Watch|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0401.Binary-Watch)|50.5%|Easy|| +|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.0%|Hard|| -|0404|Sum of Left Leaves|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0404.Sum-of-Left-Leaves)|55.1%|Easy|| -|0405|Convert a Number to Hexadecimal|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0405.Convert-a-Number-to-Hexadecimal)|45.8%|Easy|| -|0406|Queue Reconstruction by Height||70.1%|Medium|| -|0407|Trapping Rain Water II||47.0%|Hard|| +|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)|53.6%|Easy|| -|0410|Split Array Largest Sum|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0410.Split-Array-Largest-Sum)|52.1%|Hard|| -|0411|Minimum Unique Word Abbreviation||38.4%|Hard|| -|0412|Fizz Buzz|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0412.Fizz-Buzz)|66.7%|Easy|| -|0413|Arithmetic Slices|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0413.Arithmetic-Slices)|64.5%|Medium|| -|0414|Third Maximum Number|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0414.Third-Maximum-Number)|31.8%|Easy|| -|0415|Add Strings||52.2%|Easy|| -|0416|Partition Equal Subset Sum|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0416.Partition-Equal-Subset-Sum)|46.4%|Medium|| -|0417|Pacific Atlantic Water Flow|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0417.Pacific-Atlantic-Water-Flow)|49.3%|Medium|| -|0418|Sentence Screen Fitting||35.4%|Medium|| -|0419|Battleships in a Board||73.5%|Medium|| -|0420|Strong Password Checker||14.2%|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.3%|Medium|| -|0422|Valid Word Square||38.7%|Easy|| -|0423|Reconstruct Original Digits from English|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0423.Reconstruct-Original-Digits-from-English)|51.2%|Medium|| -|0424|Longest Repeating Character Replacement|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0424.Longest-Repeating-Character-Replacement)|50.8%|Medium|| -|0425|Word Squares||52.2%|Hard|| -|0426|Convert Binary Search Tree to Sorted Doubly Linked List||64.4%|Medium|| -|0427|Construct Quad Tree||65.3%|Medium|| -|0428|Serialize and Deserialize N-ary Tree||64.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)|68.9%|Medium|| -|0430|Flatten a Multilevel Doubly Linked List||58.9%|Medium|| -|0431|Encode N-ary Tree to Binary Tree||78.0%|Hard|| -|0432|All O`one Data Structure||36.0%|Hard|| -|0433|Minimum Genetic Mutation|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0433.Minimum-Genetic-Mutation)|46.8%|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.9%|Easy|| -|0435|Non-overlapping Intervals|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0435.Non-overlapping-Intervals)|48.3%|Medium|| -|0436|Find Right Interval|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0436.Find-Right-Interval)|49.6%|Medium|| -|0437|Path Sum III|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0437.Path-Sum-III)|50.1%|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.3%|Medium|| -|0439|Ternary Expression Parser||57.8%|Medium|| -|0440|K-th Smallest in Lexicographical Order||30.6%|Hard|| -|0441|Arranging Coins|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0441.Arranging-Coins)|45.4%|Easy|| -|0442|Find All Duplicates in an Array||72.4%|Medium|| -|0443|String Compression||47.5%|Medium|| -|0444|Sequence Reconstruction||25.1%|Medium|| -|0445|Add Two Numbers II|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0445.Add-Two-Numbers-II)|58.7%|Medium|| -|0446|Arithmetic Slices II - Subsequence||39.4%|Hard|| -|0447|Number of Boomerangs|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0447.Number-of-Boomerangs)|54.2%|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.1%|Easy|| -|0449|Serialize and Deserialize BST||56.2%|Medium|| -|0450|Delete Node in a BST||49.0%|Medium|| -|0451|Sort Characters By Frequency|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0451.Sort-Characters-By-Frequency)|67.8%|Medium|| -|0452|Minimum Number of Arrows to Burst Balloons||52.9%|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)|54.1%|Medium|| -|0454|4Sum II|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0454.4Sum-II)|57.1%|Medium|| -|0455|Assign Cookies|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0455.Assign-Cookies)|50.7%|Easy|| -|0456|132 Pattern|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0456.132-Pattern)|31.0%|Medium|| -|0457|Circular Array Loop|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0457.Circular-Array-Loop)|31.7%|Medium|| -|0458|Poor Pigs|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0458.Poor-Pigs)|55.6%|Hard|| -|0459|Repeated Substring Pattern||43.6%|Easy|| -|0460|LFU Cache|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0460.LFU-Cache)|39.4%|Hard|| -|0461|Hamming Distance|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0461.Hamming-Distance)|74.5%|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)|57.0%|Medium|| -|0463|Island Perimeter|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0463.Island-Perimeter)|69.0%|Easy|| -|0464|Can I Win||29.9%|Medium|| -|0465|Optimal Account Balancing||48.9%|Hard|| -|0466|Count The Repetitions||29.0%|Hard|| -|0467|Unique Substrings in Wraparound String||37.6%|Medium|| -|0468|Validate IP Address||26.2%|Medium|| -|0469|Convex Polygon||38.3%|Medium|| +|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.6%|Hard|| -|0472|Concatenated Words||43.0%|Hard|| -|0473|Matchsticks to Square|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0473.Matchsticks-to-Square)|40.3%|Medium|| -|0474|Ones and Zeroes|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0474.Ones-and-Zeroes)|44.6%|Medium|| -|0475|Heaters|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0475.Heaters)|35.3%|Medium|| -|0476|Number Complement|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0476.Number-Complement)|66.8%|Easy|| -|0477|Total Hamming Distance|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0477.Total-Hamming-Distance)|52.0%|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.4%|Medium|| -|0479|Largest Palindrome Product||31.2%|Hard|| -|0480|Sliding Window Median|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0480.Sliding-Window-Median)|41.0%|Hard|| -|0481|Magical String||49.7%|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)|37.9%|Hard|| -|0484|Find Permutation||65.2%|Medium|| -|0485|Max Consecutive Ones|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0485.Max-Consecutive-Ones)|55.1%|Easy|| -|0486|Predict the Winner||50.2%|Medium|| -|0487|Max Consecutive Ones II||48.9%|Medium|| -|0488|Zuma Game|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0488.Zuma-Game)|36.1%|Hard|| -|0489|Robot Room Cleaner||75.8%|Hard|| -|0490|The Maze||54.7%|Medium|| -|0491|Increasing Subsequences|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0491.Increasing-Subsequences)|50.9%|Medium|| -|0492|Construct the Rectangle|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0492.Construct-the-Rectangle)|52.7%|Easy|| -|0493|Reverse Pairs|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0493.Reverse-Pairs)|29.9%|Hard|| -|0494|Target Sum|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0494.Target-Sum)|45.4%|Medium|| -|0495|Teemo Attacking|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0495.Teemo-Attacking)|56.9%|Easy|| -|0496|Next Greater Element I|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0496.Next-Greater-Element-I)|70.1%|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.1%|Medium|| -|0498|Diagonal Traverse|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0498.Diagonal-Traverse)|56.8%|Medium|| -|0499|The Maze III||45.3%|Hard|| -|0500|Keyboard Row|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0500.Keyboard-Row)|68.0%|Easy|| -|0501|Find Mode in Binary Search Tree||47.2%|Easy|| -|0502|IPO||44.1%|Hard|| -|0503|Next Greater Element II|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0503.Next-Greater-Element-II)|62.1%|Medium|| -|0504|Base 7||47.5%|Easy|| -|0505|The Maze II||51.3%|Medium|| -|0506|Relative Ranks|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0506.Relative-Ranks)|56.8%|Easy|| -|0507|Perfect Number|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0507.Perfect-Number)|37.6%|Easy|| -|0508|Most Frequent Subtree Sum|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0508.Most-Frequent-Subtree-Sum)|62.8%|Medium|| -|0509|Fibonacci Number|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0509.Fibonacci-Number)|68.2%|Easy|| -|0510|Inorder Successor in BST II||61.3%|Medium|| -|0511|Game Play Analysis I||80.4%|Easy|| -|0512|Game Play Analysis II||54.4%|Easy|| -|0513|Find Bottom Left Tree Value|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0513.Find-Bottom-Left-Tree-Value)|65.2%|Medium|| -|0514|Freedom Trail||46.3%|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.5%|Medium|| -|0516|Longest Palindromic Subsequence||59.4%|Medium|| -|0517|Super Washing Machines||39.4%|Hard|| -|0518|Coin Change 2|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0518.Coin-Change-2)|57.5%|Medium|| -|0519|Random Flip Matrix|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0519.Random-Flip-Matrix)|39.2%|Medium|| -|0520|Detect Capital|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0520.Detect-Capital)|55.7%|Easy|| -|0521|Longest Uncommon Subsequence I||60.1%|Easy|| -|0522|Longest Uncommon Subsequence II||40.1%|Medium|| -|0523|Continuous Subarray Sum|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0523.Continuous-Subarray-Sum)|27.3%|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)|50.9%|Medium|| -|0525|Contiguous Array|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0525.Contiguous-Array)|46.3%|Medium|| -|0526|Beautiful Arrangement|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0526.Beautiful-Arrangement)|64.4%|Medium|| -|0527|Word Abbreviation||58.2%|Hard|| +|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)|64.7%|Medium|| -|0530|Minimum Absolute Difference in BST|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0530.Minimum-Absolute-Difference-in-BST)|56.3%|Easy|| -|0531|Lonely Pixel I||60.7%|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.2%|Medium|| -|0533|Lonely Pixel II||48.3%|Medium|| -|0534|Game Play Analysis III||82.1%|Medium|| -|0535|Encode and Decode TinyURL|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0535.Encode-and-Decode-TinyURL)|85.4%|Medium|| -|0536|Construct Binary Tree from String||55.8%|Medium|| -|0537|Complex Number Multiplication|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0537.Complex-Number-Multiplication)|71.1%|Medium|| -|0538|Convert BST to Greater Tree|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0538.Convert-BST-to-Greater-Tree)|66.2%|Medium|| -|0539|Minimum Time Difference||54.9%|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.7%|Medium|| -|0541|Reverse String II|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0541.Reverse-String-II)|50.2%|Easy|| -|0542|01 Matrix|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0542.01-Matrix)|43.8%|Medium|| -|0543|Diameter of Binary Tree|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0543.Diameter-of-Binary-Tree)|54.3%|Easy|| -|0544|Output Contest Matches||76.5%|Medium|| -|0545|Boundary of Binary Tree||43.3%|Medium|| -|0546|Remove Boxes||47.4%|Hard|| -|0547|Number of Provinces|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0547.Number-of-Provinces)|62.6%|Medium|| -|0548|Split Array with Equal Sum||49.9%|Hard|| -|0549|Binary Tree Longest Consecutive Sequence II||48.6%|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)|47.6%|Easy|| -|0552|Student Attendance Record II||40.6%|Hard|| -|0553|Optimal Division||59.0%|Medium|| -|0554|Brick Wall|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0554.Brick-Wall)|52.6%|Medium|| -|0555|Split Concatenated Strings||43.2%|Medium|| -|0556|Next Greater Element III||33.8%|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)|78.8%|Easy|| -|0558|Logical OR of Two Binary Grids Represented as Quad-Trees||47.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.1%|Easy|| -|0560|Subarray Sum Equals K|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0560.Subarray-Sum-Equals-K)|44.2%|Medium|| -|0561|Array Partition I|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0561.Array-Partition-I)|75.7%|Easy|| -|0562|Longest Line of Consecutive One in Matrix||49.1%|Medium|| -|0563|Binary Tree Tilt|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0563.Binary-Tree-Tilt)|58.5%|Easy|| -|0564|Find the Closest Palindrome||21.4%|Hard|| -|0565|Array Nesting||56.3%|Medium|| -|0566|Reshape the Matrix|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0566.Reshape-the-Matrix)|62.5%|Easy|| -|0567|Permutation in String|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0567.Permutation-in-String)|44.7%|Medium|| -|0568|Maximum Vacation Days||44.4%|Hard|| -|0569|Median Employee Salary||66.8%|Hard|| -|0570|Managers with at Least 5 Direct Reports||67.0%|Medium|| -|0571|Find Median Given Frequency of Numbers||44.4%|Hard|| -|0572|Subtree of Another Tree|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0572.Subtree-of-Another-Tree)|45.4%|Easy|| -|0573|Squirrel Simulation||54.7%|Medium|| -|0574|Winning Candidate||58.4%|Medium|| -|0575|Distribute Candies|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0575.Distribute-Candies)|65.7%|Easy|| -|0576|Out of Boundary Paths|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0576.Out-of-Boundary-Paths)|40.1%|Medium|| -|0577|Employee Bonus||74.8%|Easy|| -|0578|Get Highest Answer Rate Question||42.9%|Medium|| -|0579|Find Cumulative Salary of an Employee||43.2%|Hard|| -|0580|Count Student Number in Departments||56.8%|Medium|| -|0581|Shortest Unsorted Continuous Subarray|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0581.Shortest-Unsorted-Continuous-Subarray)|35.9%|Medium|| -|0582|Kill Process||67.1%|Medium|| -|0583|Delete Operation for Two Strings|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0583.Delete-Operation-for-Two-Strings)|55.9%|Medium|| -|0584|Find Customer Referee||76.9%|Easy|| -|0585|Investments in 2016||54.7%|Medium|| -|0586|Customer Placing the Largest Number of Orders||74.0%|Easy|| +|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.3%|Hard|| -|0589|N-ary Tree Preorder Traversal|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0589.N-ary-Tree-Preorder-Traversal)|76.1%|Easy|| -|0590|N-ary Tree Postorder Traversal||76.2%|Easy|| -|0591|Tag Validator||36.5%|Hard|| -|0592|Fraction Addition and Subtraction||51.7%|Medium|| -|0593|Valid Square||43.9%|Medium|| -|0594|Longest Harmonious Subsequence|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0594.Longest-Harmonious-Subsequence)|52.7%|Easy|| -|0595|Big Countries||76.7%|Easy|| -|0596|Classes More Than 5 Students||42.8%|Easy|| -|0597|Friend Requests I: Overall Acceptance Rate||42.6%|Easy|| -|0598|Range Addition II|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0598.Range-Addition-II)|54.7%|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.8%|Easy|| -|0600|Non-negative Integers without Consecutive Ones||38.8%|Hard|| -|0601|Human Traffic of Stadium||49.7%|Hard|| -|0602|Friend Requests II: Who Has the Most Friends||60.8%|Medium|| -|0603|Consecutive Available Seats||67.8%|Easy|| -|0604|Design Compressed String Iterator||39.1%|Easy|| -|0605|Can Place Flowers|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0605.Can-Place-Flowers)|33.1%|Easy|| -|0606|Construct String from Binary Tree||57.7%|Easy|| -|0607|Sales Person||69.2%|Easy|| -|0608|Tree Node||72.7%|Medium|| -|0609|Find Duplicate File in System|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0609.Find-Duplicate-File-in-System)|63.8%|Medium|| -|0610|Triangle Judgement||70.9%|Easy|| -|0611|Valid Triangle Number|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0611.Valid-Triangle-Number)|49.8%|Medium|| -|0612|Shortest Distance in a Plane||63.1%|Medium|| -|0613|Shortest Distance in a Line||81.2%|Easy|| -|0614|Second Degree Follower||35.6%|Medium|| -|0615|Average Salary: Departments VS Company||56.3%|Hard|| -|0616|Add Bold Tag in String||48.3%|Medium|| -|0617|Merge Two Binary Trees|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0617.Merge-Two-Binary-Trees)|77.9%|Easy|| -|0618|Students Report By Geography||63.4%|Hard|| -|0619|Biggest Single Number||47.5%|Easy|| -|0620|Not Boring Movies||72.6%|Easy|| -|0621|Task Scheduler||54.5%|Medium|| -|0622|Design Circular Queue|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0622.Design-Circular-Queue)|48.7%|Medium|| -|0623|Add One Row to Tree|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0623.Add-One-Row-to-Tree)|53.9%|Medium|| -|0624|Maximum Distance in Arrays||41.6%|Medium|| -|0625|Minimum Factorization||33.2%|Medium|| -|0626|Exchange Seats||69.3%|Medium|| -|0627|Swap Salary||79.9%|Easy|| -|0628|Maximum Product of Three Numbers|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0628.Maximum-Product-of-Three-Numbers)|46.7%|Easy|| -|0629|K Inverse Pairs Array||37.3%|Hard|| -|0630|Course Schedule III|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0630.Course-Schedule-III)|35.7%|Hard|| -|0631|Design Excel Sum Formula||41.9%|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)|58.6%|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.2%|Medium|| -|0635|Design Log Storage System||62.4%|Medium|| -|0636|Exclusive Time of Functions|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0636.Exclusive-Time-of-Functions)|60.3%|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)|68.7%|Easy|| -|0638|Shopping Offers|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0638.Shopping-Offers)|54.6%|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.2%|Medium|| -|0642|Design Search Autocomplete System||48.3%|Hard|| -|0643|Maximum Average Subarray I|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0643.Maximum-Average-Subarray-I)|43.5%|Easy|| -|0644|Maximum Average Subarray II||35.3%|Hard|| -|0645|Set Mismatch|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0645.Set-Mismatch)|41.3%|Easy|| -|0646|Maximum Length of Pair Chain||55.7%|Medium|| -|0647|Palindromic Substrings|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0647.Palindromic-Substrings)|64.7%|Medium|| -|0648|Replace Words|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0648.Replace-Words)|62.0%|Medium|| -|0649|Dota2 Senate||39.9%|Medium|| -|0650|2 Keys Keyboard||52.4%|Medium|| -|0651|4 Keys Keyboard||54.2%|Medium|| -|0652|Find Duplicate Subtrees||55.9%|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)|58.8%|Easy|| -|0654|Maximum Binary Tree||83.6%|Medium|| -|0655|Print Binary Tree||59.9%|Medium|| -|0656|Coin Path||31.2%|Hard|| -|0657|Robot Return to Origin||75.1%|Easy|| -|0658|Find K Closest Elements|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0658.Find-K-Closest-Elements)|44.6%|Medium|| -|0659|Split Array into Consecutive Subsequences||45.7%|Medium|| -|0660|Remove 9||56.0%|Hard|| -|0661|Image Smoother|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0661.Image-Smoother)|54.3%|Easy|| -|0662|Maximum Width of Binary Tree|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0662.Maximum-Width-of-Binary-Tree)|40.3%|Medium|| -|0663|Equal Tree Partition||41.2%|Medium|| -|0664|Strange Printer||46.3%|Hard|| -|0665|Non-decreasing Array|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0665.Non-decreasing-Array)|21.5%|Medium|| -|0666|Path Sum IV||58.6%|Medium|| -|0667|Beautiful Arrangement II|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0667.Beautiful-Arrangement-II)|59.4%|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.1%|Hard|| +|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.6%|Medium|| -|0671|Second Minimum Node In a Binary Tree||43.7%|Easy|| -|0672|Bulb Switcher II||50.8%|Medium|| -|0673|Number of Longest Increasing Subsequence||40.9%|Medium|| -|0674|Longest Continuous Increasing Subsequence|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0674.Longest-Continuous-Increasing-Subsequence)|48.4%|Easy|| -|0675|Cut Off Trees for Golf Event||35.4%|Hard|| -|0676|Implement Magic Dictionary|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0676.Implement-Magic-Dictionary)|56.6%|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.3%|Medium|| -|0679|24 Game||48.8%|Hard|| -|0680|Valid Palindrome II||39.4%|Easy|| +|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.1%|Easy|| -|0683|K Empty Slots||36.7%|Hard|| -|0684|Redundant Connection|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0684.Redundant-Connection)|61.2%|Medium|| -|0685|Redundant Connection II|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0685.Redundant-Connection-II)|33.8%|Hard|| -|0686|Repeated String Match||33.6%|Medium|| -|0687|Longest Univalue Path||39.4%|Medium|| -|0688|Knight Probability in Chessboard||51.5%|Medium|| -|0689|Maximum Sum of 3 Non-Overlapping Subarrays||48.5%|Hard|| -|0690|Employee Importance|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0690.Employee-Importance)|64.1%|Medium|| -|0691|Stickers to Spell Word||46.7%|Hard|| -|0692|Top K Frequent Words|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0692.Top-K-Frequent-Words)|54.4%|Medium|| -|0693|Binary Number with Alternating Bits|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0693.Binary-Number-with-Alternating-Bits)|60.9%|Easy|| -|0694|Number of Distinct Islands||59.7%|Medium|| -|0695|Max Area of Island|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0695.Max-Area-of-Island)|69.7%|Medium|| -|0696|Count Binary Substrings|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0696.Count-Binary-Substrings)|64.9%|Easy|| -|0697|Degree of an Array|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0697.Degree-of-an-Array)|55.7%|Easy|| -|0698|Partition to K Equal Sum Subsets||43.9%|Medium|| -|0699|Falling Squares|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0699.Falling-Squares)|43.8%|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)|76.4%|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.9%|Medium|| -|0702|Search in a Sorted Array of Unknown Size||70.9%|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)|54.8%|Easy|| -|0704|Binary Search|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0704.Binary-Search)|55.3%|Easy|| -|0705|Design HashSet|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0705.Design-HashSet)|66.5%|Easy|| -|0706|Design HashMap|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0706.Design-HashMap)|65.3%|Easy|| -|0707|Design Linked List|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0707.Design-Linked-List)|27.0%|Medium|| -|0708|Insert into a Sorted Circular Linked List||34.4%|Medium|| -|0709|To Lower Case|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0709.To-Lower-Case)|81.4%|Easy|| -|0710|Random Pick with Blacklist|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0710.Random-Pick-with-Blacklist)|33.2%|Hard|| -|0711|Number of Distinct Islands II||51.0%|Hard|| -|0712|Minimum ASCII Delete Sum for Two Strings||61.5%|Medium|| -|0713|Subarray Product Less Than K|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0713.Subarray-Product-Less-Than-K)|43.8%|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)|62.2%|Medium|| -|0715|Range Module|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0715.Range-Module)|43.6%|Hard|| -|0716|Max Stack||45.1%|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)|46.2%|Easy|| -|0718|Maximum Length of Repeated Subarray|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0718.Maximum-Length-of-Repeated-Subarray)|51.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)|35.1%|Hard|| -|0720|Longest Word in Dictionary|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0720.Longest-Word-in-Dictionary)|51.0%|Medium|| -|0721|Accounts Merge|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0721.Accounts-Merge)|55.9%|Medium|| -|0722|Remove Comments||37.4%|Medium|| -|0723|Candy Crush||75.2%|Medium|| -|0724|Find Pivot Index|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0724.Find-Pivot-Index)|51.6%|Easy|| -|0725|Split Linked List in Parts|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0725.Split-Linked-List-in-Parts)|56.9%|Medium|| -|0726|Number of Atoms|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0726.Number-of-Atoms)|51.7%|Hard|| +|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||77.0%|Easy|| -|0729|My Calendar I|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0729.My-Calendar-I)|55.2%|Medium|| -|0730|Count Different Palindromic Subsequences||44.3%|Hard|| -|0731|My Calendar II||53.4%|Medium|| -|0732|My Calendar III|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0732.My-Calendar-III)|66.5%|Hard|| -|0733|Flood Fill|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0733.Flood-Fill)|58.3%|Easy|| -|0734|Sentence Similarity||43.0%|Easy|| +|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.2%|Hard|| -|0737|Sentence Similarity II||48.2%|Medium|| -|0738|Monotone Increasing Digits||46.8%|Medium|| -|0739|Daily Temperatures|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0739.Daily-Temperatures)|67.2%|Medium|| -|0740|Delete and Earn||57.3%|Medium|| -|0741|Cherry Pickup||36.2%|Hard|| -|0742|Closest Leaf in a Binary Tree||45.7%|Medium|| -|0743|Network Delay Time||48.6%|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.1%|Easy|| -|0745|Prefix and Suffix Search|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0745.Prefix-and-Suffix-Search)|36.5%|Hard|| -|0746|Min Cost Climbing Stairs|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0746.Min-Cost-Climbing-Stairs)|58.8%|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)|45.3%|Easy|| -|0748|Shortest Completing Word|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0748.Shortest-Completing-Word)|58.9%|Easy|| -|0749|Contain Virus||50.1%|Hard|| +|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.8%|Medium|| -|0752|Open the Lock|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0752.Open-the-Lock)|55.3%|Medium|| -|0753|Cracking the Safe|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0753.Cracking-the-Safe)|54.6%|Hard|| -|0754|Reach a Number||41.8%|Medium|| -|0755|Pour Water||45.6%|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||43.1%|Hard|| -|0758|Bold Words in String||50.3%|Medium|| -|0759|Employee Free Time||71.1%|Hard|| -|0760|Find Anagram Mappings||82.7%|Easy|| -|0761|Special Binary String||59.8%|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)|66.8%|Easy|| -|0763|Partition Labels|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0763.Partition-Labels)|79.6%|Medium|| -|0764|Largest Plus Sign||48.6%|Medium|| -|0765|Couples Holding Hands|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0765.Couples-Holding-Hands)|56.5%|Hard|| -|0766|Toeplitz Matrix|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0766.Toeplitz-Matrix)|68.0%|Easy|| -|0767|Reorganize String|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0767.Reorganize-String)|52.1%|Medium|| -|0768|Max Chunks To Make Sorted II||52.0%|Hard|| -|0769|Max Chunks To Make Sorted||57.7%|Medium|| -|0770|Basic Calculator IV||55.8%|Hard|| -|0771|Jewels and Stones|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0771.Jewels-and-Stones)|87.7%|Easy|| -|0772|Basic Calculator III||47.5%|Hard|| -|0773|Sliding Puzzle||63.1%|Hard|| -|0774|Minimize Max Distance to Gas Station||50.5%|Hard|| -|0775|Global and Local Inversions|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0775.Global-and-Local-Inversions)|45.1%|Medium|| -|0776|Split BST||58.4%|Medium|| -|0777|Swap Adjacent in LR String||36.4%|Medium|| -|0778|Swim in Rising Water|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0778.Swim-in-Rising-Water)|58.7%|Hard|| -|0779|K-th Symbol in Grammar||39.9%|Medium|| -|0780|Reaching Points||31.6%|Hard|| -|0781|Rabbits in Forest|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0781.Rabbits-in-Forest)|55.7%|Medium|| -|0782|Transform to Chessboard||52.0%|Hard|| -|0783|Minimum Distance Between BST Nodes|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0783.Minimum-Distance-Between-BST-Nodes)|56.1%|Easy|| -|0784|Letter Case Permutation|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0784.Letter-Case-Permutation)|72.4%|Medium|| -|0785|Is Graph Bipartite?|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0785.Is-Graph-Bipartite)|51.7%|Medium|| -|0786|K-th Smallest Prime Fraction|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0786.K-th-Smallest-Prime-Fraction)|48.6%|Hard|| -|0787|Cheapest Flights Within K Stops||36.0%|Medium|| -|0788|Rotated Digits||57.2%|Medium|| -|0789|Escape The Ghosts||60.1%|Medium|| -|0790|Domino and Tromino Tiling||47.9%|Medium|| -|0791|Custom Sort String|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0791.Custom-Sort-String)|69.2%|Medium|| -|0792|Number of Matching Subsequences|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0792.Number-of-Matching-Subsequences)|50.5%|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)|41.8%|Hard|| +|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.4%|Medium|| -|0796|Rotate String||52.3%|Easy|| -|0797|All Paths From Source to Target||80.9%|Medium|| -|0798|Smallest Rotation with Highest Score||47.6%|Hard|| +|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||63.8%|Easy|| -|0801|Minimum Swaps To Make Sequences Increasing||39.1%|Hard|| -|0802|Find Eventual Safe States|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0802.Find-Eventual-Safe-States)|52.6%|Medium|| -|0803|Bricks Falling When Hit|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0803.Bricks-Falling-When-Hit)|33.9%|Hard|| -|0804|Unique Morse Code Words||80.0%|Easy|| -|0805|Split Array With Same Average||26.5%|Hard|| -|0806|Number of Lines To Write String||66.0%|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.5%|Medium|| -|0808|Soup Servings||42.4%|Medium|| -|0809|Expressive Words||46.4%|Medium|| -|0810|Chalkboard XOR Game|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0810.Chalkboard-XOR-Game)|53.4%|Hard|| -|0811|Subdomain Visit Count|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0811.Subdomain-Visit-Count)|74.2%|Medium|| -|0812|Largest Triangle Area|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0812.Largest-Triangle-Area)|59.6%|Easy|| -|0813|Largest Sum of Averages||52.5%|Medium|| -|0814|Binary Tree Pruning||71.0%|Medium|| -|0815|Bus Routes|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0815.Bus-Routes)|45.3%|Hard|| -|0816|Ambiguous Coordinates|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0816.Ambiguous-Coordinates)|55.9%|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||42.9%|Hard|| -|0819|Most Common Word|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0819.Most-Common-Word)|45.2%|Easy|| -|0820|Short Encoding of Words|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0820.Short-Encoding-of-Words)|55.3%|Medium|| -|0821|Shortest Distance to a Character|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0821.Shortest-Distance-to-a-Character)|71.0%|Easy|| -|0822|Card Flipping Game||44.7%|Medium|| -|0823|Binary Trees With Factors|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0823.Binary-Trees-With-Factors)|43.7%|Medium|| -|0824|Goat Latin||67.6%|Easy|| -|0825|Friends Of Appropriate Ages|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0825.Friends-Of-Appropriate-Ages)|46.0%|Medium|| -|0826|Most Profit Assigning Work|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0826.Most-Profit-Assigning-Work)|42.1%|Medium|| -|0827|Making A Large Island||44.8%|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)|50.0%|Hard|| -|0829|Consecutive Numbers Sum||41.1%|Hard|| -|0830|Positions of Large Groups|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0830.Positions-of-Large-Groups)|51.4%|Easy|| -|0831|Masking Personal Information||46.0%|Medium|| -|0832|Flipping an Image|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0832.Flipping-an-Image)|79.7%|Easy|| -|0833|Find And Replace in String||54.3%|Medium|| -|0834|Sum of Distances in Tree|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0834.Sum-of-Distances-in-Tree)|53.0%|Hard|| -|0835|Image Overlap||61.2%|Medium|| -|0836|Rectangle Overlap|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0836.Rectangle-Overlap)|43.2%|Easy|| -|0837|New 21 Game||36.0%|Medium|| -|0838|Push Dominoes|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0838.Push-Dominoes)|52.3%|Medium|| -|0839|Similar String Groups|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0839.Similar-String-Groups)|45.5%|Hard|| -|0840|Magic Squares In Grid||38.4%|Medium|| -|0841|Keys and Rooms|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0841.Keys-and-Rooms)|69.0%|Medium|| -|0842|Split Array into Fibonacci Sequence|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0842.Split-Array-into-Fibonacci-Sequence)|37.8%|Medium|| -|0843|Guess the Word||43.0%|Hard|| +|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)|39.8%|Medium|| -|0846|Hand of Straights|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0846.Hand-of-Straights)|56.2%|Medium|| +|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.4%|Medium|| -|0850|Rectangle Area II|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0850.Rectangle-Area-II)|53.3%|Hard|| -|0851|Loud and Rich|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0851.Loud-and-Rich)|56.8%|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)|70.4%|Easy|| -|0853|Car Fleet|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0853.Car-Fleet)|48.2%|Medium|| -|0854|K-Similar Strings||39.2%|Hard|| -|0855|Exam Room||43.6%|Medium|| -|0856|Score of Parentheses|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0856.Score-of-Parentheses)|65.4%|Medium|| -|0857|Minimum Cost to Hire K Workers||51.7%|Hard|| -|0858|Mirror Reflection||59.6%|Medium|| -|0859|Buddy Strings|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0859.Buddy-Strings)|28.8%|Easy|| -|0860|Lemonade Change||52.5%|Easy|| -|0861|Score After Flipping Matrix||74.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)|26.2%|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)|61.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)|44.6%|Hard|| -|0865|Smallest Subtree with all the Deepest Nodes||67.9%|Medium|| -|0866|Prime Palindrome||25.9%|Medium|| -|0867|Transpose Matrix|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0867.Transpose-Matrix)|61.0%|Easy|| -|0868|Binary Gap||61.8%|Easy|| -|0869|Reordered Power of 2|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0869.Reordered-Power-of-2)|61.3%|Medium|| -|0870|Advantage Shuffle|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0870.Advantage-Shuffle)|51.2%|Medium|| -|0871|Minimum Number of Refueling Stops||35.7%|Hard|| -|0872|Leaf-Similar Trees|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0872.Leaf-Similar-Trees)|65.0%|Easy|| +|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)|37.8%|Medium|| -|0875|Koko Eating Bananas|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0875.Koko-Eating-Bananas)|54.6%|Medium|| -|0876|Middle of the Linked List|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0876.Middle-of-the-Linked-List)|72.7%|Easy|| -|0877|Stone Game|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0877.Stone-Game)|69.2%|Medium|| -|0878|Nth Magical Number|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0878.Nth-Magical-Number)|35.8%|Hard|| -|0879|Profitable Schemes||40.6%|Hard|| +|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.5%|Medium|| -|0882|Reachable Nodes In Subdivided Graph||50.0%|Hard|| -|0883|Projection Area of 3D Shapes||70.1%|Easy|| -|0884|Uncommon Words from Two Sentences|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0884.Uncommon-Words-from-Two-Sentences)|65.6%|Easy|| -|0885|Spiral Matrix III|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0885.Spiral-Matrix-III)|72.5%|Medium|| -|0886|Possible Bipartition||47.4%|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.4%|Easy|| -|0889|Construct Binary Tree from Preorder and Postorder Traversal||69.9%|Medium|| -|0890|Find and Replace Pattern|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0890.Find-and-Replace-Pattern)|75.6%|Medium|| -|0891|Sum of Subsequence Widths|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0891.Sum-of-Subsequence-Widths)|35.6%|Hard|| -|0892|Surface Area of 3D Shapes|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0892.Surface-Area-of-3D-Shapes)|61.9%|Easy|| -|0893|Groups of Special-Equivalent Strings||70.5%|Medium|| -|0894|All Possible Full Binary Trees||79.5%|Medium|| -|0895|Maximum Frequency Stack|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0895.Maximum-Frequency-Stack)|66.4%|Hard|| -|0896|Monotonic Array|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0896.Monotonic-Array)|58.4%|Easy|| -|0897|Increasing Order Search Tree|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0897.Increasing-Order-Search-Tree)|78.3%|Easy|| -|0898|Bitwise ORs of Subarrays|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0898.Bitwise-ORs-of-Subarrays)|36.3%|Medium|| -|0899|Orderly Queue||58.5%|Hard|| -|0900|RLE Iterator||58.7%|Medium|| -|0901|Online Stock Span|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0901.Online-Stock-Span)|63.1%|Medium|| -|0902|Numbers At Most N Given Digit Set||40.9%|Hard|| -|0903|Valid Permutations for DI Sequence||57.0%|Hard|| -|0904|Fruit Into Baskets|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0904.Fruit-Into-Baskets)|42.8%|Medium|| +|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.3%|Hard|| -|0907|Sum of Subarray Minimums|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0907.Sum-of-Subarray-Minimums)|33.9%|Medium|| -|0908|Smallest Range I||67.3%|Easy|| -|0909|Snakes and Ladders|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0909.Snakes-and-Ladders)|40.5%|Medium|| -|0910|Smallest Range II|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0910.Smallest-Range-II)|32.8%|Medium|| -|0911|Online Election|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0911.Online-Election)|51.6%|Medium|| -|0912|Sort an Array||61.4%|Medium|| -|0913|Cat and Mouse||35.7%|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.9%|Easy|| -|0915|Partition Array into Disjoint Intervals||48.4%|Medium|| -|0916|Word Subsets|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0916.Word-Subsets)|52.6%|Medium|| -|0917|Reverse Only Letters||61.0%|Easy|| -|0918|Maximum Sum Circular Subarray|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0918.Maximum-Sum-Circular-Subarray)|37.2%|Medium|| -|0919|Complete Binary Tree Inserter||64.1%|Medium|| -|0920|Number of Music Playlists|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0920.Number-of-Music-Playlists)|49.9%|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)|77.1%|Medium|| -|0922|Sort Array By Parity II|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0922.Sort-Array-By-Parity-II)|70.6%|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)|41.9%|Hard|| -|0925|Long Pressed Name|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0925.Long-Pressed-Name)|34.6%|Easy|| -|0926|Flip String to Monotone Increasing||58.8%|Medium|| -|0927|Three Equal Parts|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0927.Three-Equal-Parts)|39.4%|Hard|| -|0928|Minimize Malware Spread II|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0928.Minimize-Malware-Spread-II)|42.3%|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)|48.9%|Medium|| -|0931|Minimum Falling Path Sum||67.4%|Medium|| -|0932|Beautiful Array||64.8%|Medium|| -|0933|Number of Recent Calls|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0933.Number-of-Recent-Calls)|73.1%|Easy|| -|0934|Shortest Bridge||52.7%|Medium|| -|0935|Knight Dialer||49.1%|Medium|| -|0936|Stamping The Sequence||53.6%|Hard|| -|0937|Reorder Data in Log Files||56.0%|Easy|| -|0938|Range Sum of BST|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0938.Range-Sum-of-BST)|85.1%|Easy|| -|0939|Minimum Area Rectangle||53.5%|Medium|| -|0940|Distinct Subsequences II||44.3%|Hard|| -|0941|Valid Mountain Array||33.7%|Easy|| -|0942|DI String Match|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0942.DI-String-Match)|75.9%|Easy|| -|0943|Find the Shortest Superstring||45.4%|Hard|| -|0944|Delete Columns to Make Sorted||69.9%|Easy|| -|0945|Minimum Increment to Make Array Unique||49.1%|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)|56.3%|Medium|| -|0948|Bag of Tokens||46.2%|Medium|| -|0949|Largest Time for Given Digits|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0949.Largest-Time-for-Given-Digits)|35.4%|Medium|| -|0950|Reveal Cards In Increasing Order||77.1%|Medium|| -|0951|Flip Equivalent Binary Trees||66.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)|40.2%|Hard|| -|0953|Verifying an Alien Dictionary|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0953.Verifying-an-Alien-Dictionary)|52.5%|Easy|| -|0954|Array of Doubled Pairs||38.7%|Medium|| -|0955|Delete Columns to Make Sorted II||34.2%|Medium|| -|0956|Tallest Billboard||39.9%|Hard|| -|0957|Prison Cells After N Days||39.4%|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.7%|Medium|| -|0959|Regions Cut By Slashes|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0959.Regions-Cut-By-Slashes)|68.7%|Medium|| -|0960|Delete Columns to Make Sorted III||56.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)|75.5%|Easy|| -|0962|Maximum Width Ramp||48.2%|Medium|| -|0963|Minimum Area Rectangle II||54.5%|Medium|| -|0964|Least Operators to Express Number||47.5%|Hard|| -|0965|Univalued Binary Tree||69.0%|Easy|| -|0966|Vowel Spellchecker|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0966.Vowel-Spellchecker)|51.6%|Medium|| -|0967|Numbers With Same Consecutive Differences||47.3%|Medium|| -|0968|Binary Tree Cameras|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0968.Binary-Tree-Cameras)|41.9%|Hard|| -|0969|Pancake Sorting|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0969.Pancake-Sorting)|69.7%|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||42.5%|Hard|| -|0973|K Closest Points to Origin|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0973.K-Closest-Points-to-Origin)|66.0%|Medium|| -|0974|Subarray Sums Divisible by K||53.2%|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)|55.5%|Easy|| -|0977|Squares of a Sorted Array|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0977.Squares-of-a-Sorted-Array)|71.6%|Easy|| -|0978|Longest Turbulent Subarray|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0978.Longest-Turbulent-Subarray)|47.5%|Medium|| -|0979|Distribute Coins in Binary Tree|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0979.Distribute-Coins-in-Binary-Tree)|71.6%|Medium|| -|0980|Unique Paths III|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0980.Unique-Paths-III)|79.4%|Hard|| -|0981|Time Based Key-Value Store|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0981.Time-Based-Key-Value-Store)|52.7%|Medium|| -|0982|Triples with Bitwise AND Equal To Zero||57.5%|Hard|| -|0983|Minimum Cost For Tickets||64.1%|Medium|| -|0984|String Without AAA or BBB|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0984.String-Without-AAA-or-BBB)|42.3%|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.0%|Medium|| -|0986|Interval List Intersections|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0986.Interval-List-Intersections)|71.1%|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)|41.6%|Hard|| -|0988|Smallest String Starting From Leaf||48.7%|Medium|| +|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.1%|Medium|| -|0991|Broken Calculator|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0991.Broken-Calculator)|54.2%|Medium|| -|0992|Subarrays with K Different Integers|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0992.Subarrays-with-K-Different-Integers)|53.4%|Hard|| -|0993|Cousins in Binary Tree|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0993.Cousins-in-Binary-Tree)|53.8%|Easy|| -|0994|Rotting Oranges||51.7%|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)|50.8%|Hard|| -|0996|Number of Squareful Arrays|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0996.Number-of-Squareful-Arrays)|49.1%|Hard|| -|0997|Find the Town Judge|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0997.Find-the-Town-Judge)|49.8%|Easy|| -|0998|Maximum Binary Tree II||65.6%|Medium|| -|0999|Available Captures for Rook|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0999.Available-Captures-for-Rook)|67.6%|Easy|| -|1000|Minimum Cost to Merge Stones||41.9%|Hard|| -|1001|Grid Illumination||36.1%|Hard|| -|1002|Find Common Characters|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1002.Find-Common-Characters)|68.4%|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)|57.9%|Medium|| -|1004|Max Consecutive Ones III|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1004.Max-Consecutive-Ones-III)|63.0%|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.4%|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.6%|Medium|| -|1008|Construct Binary Search Tree from Preorder Traversal||80.3%|Medium|| -|1009|Complement of Base 10 Integer|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1009.Complement-of-Base-10-Integer)|62.2%|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.6%|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)|63.6%|Medium|| -|1012|Numbers With Repeated Digits||38.5%|Hard|| -|1013|Partition Array Into Three Parts With Equal Sum||44.5%|Easy|| -|1014|Best Sightseeing Pair||58.6%|Medium|| -|1015|Smallest Integer Divisible by K||47.0%|Medium|| -|1016|Binary String With Substrings Representing 1 To N||57.9%|Medium|| -|1017|Convert to Base -2|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1017.Convert-to-Base-2)|60.3%|Medium|| -|1018|Binary Prefix Divisible By 5|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1018.Binary-Prefix-Divisible-By-5)|47.5%|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.6%|Medium|| -|1020|Number of Enclaves|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1020.Number-of-Enclaves)|62.8%|Medium|| -|1021|Remove Outermost Parentheses|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1021.Remove-Outermost-Parentheses)|79.8%|Easy|| -|1022|Sum of Root To Leaf Binary Numbers||73.9%|Easy|| -|1023|Camelcase Matching||59.2%|Medium|| -|1024|Video Stitching||50.1%|Medium|| -|1025|Divisor Game|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1025.Divisor-Game)|66.6%|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.2%|Medium|| -|1027|Longest Arithmetic Subsequence||48.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.4%|Hard|| -|1029|Two City Scheduling||63.6%|Medium|| -|1030|Matrix Cells in Distance Order|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1030.Matrix-Cells-in-Distance-Order)|69.1%|Easy|| -|1031|Maximum Sum of Two Non-Overlapping Subarrays||59.2%|Medium|| -|1032|Stream of Characters||51.4%|Hard|| -|1033|Moving Stones Until Consecutive||45.0%|Medium|| -|1034|Coloring A Border|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1034.Coloring-A-Border)|48.4%|Medium|| -|1035|Uncrossed Lines||57.9%|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)|84.8%|Medium|| -|1039|Minimum Score Triangulation of Polygon||52.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.5%|Medium|| -|1041|Robot Bounded In Circle||55.4%|Medium|| -|1042|Flower Planting With No Adjacent||49.9%|Medium|| -|1043|Partition Array for Maximum Sum||70.3%|Medium|| -|1044|Longest Duplicate Substring||31.2%|Hard|| -|1045|Customers Who Bought All Products||67.5%|Medium|| -|1046|Last Stone Weight||64.4%|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)|71.1%|Easy|| -|1048|Longest String Chain|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1048.Longest-String-Chain)|57.8%|Medium|| -|1049|Last Stone Weight II|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1049.Last-Stone-Weight-II)|51.1%|Medium|| -|1050|Actors and Directors Who Cooperated At Least Three Times||72.7%|Easy|| -|1051|Height Checker|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1051.Height-Checker)|74.3%|Easy|| -|1052|Grumpy Bookstore Owner|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1052.Grumpy-Bookstore-Owner)|56.7%|Medium|| -|1053|Previous Permutation With One Swap||51.7%|Medium|| -|1054|Distant Barcodes|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1054.Distant-Barcodes)|45.2%|Medium|| -|1055|Shortest Way to Form String||58.3%|Medium|| -|1056|Confusing Number||46.0%|Easy|| -|1057|Campus Bikes||58.1%|Medium|| -|1058|Minimize Rounding Error to Meet Target||44.7%|Medium|| -|1059|All Paths from Source Lead to Destination||41.7%|Medium|| -|1060|Missing Element in Sorted Array||55.0%|Medium|| -|1061|Lexicographically Smallest Equivalent String||69.3%|Medium|| -|1062|Longest Repeating Substring||59.2%|Medium|| -|1063|Number of Valid Subarrays||73.7%|Hard|| -|1064|Fixed Point||63.9%|Easy|| -|1065|Index Pairs of a String||62.3%|Easy|| -|1066|Campus Bikes II||54.7%|Medium|| -|1067|Digit Count in Range||43.0%|Hard|| -|1068|Product Sales Analysis I||81.0%|Easy|| -|1069|Product Sales Analysis II||82.4%|Easy|| -|1070|Product Sales Analysis III||49.7%|Medium|| -|1071|Greatest Common Divisor of Strings||51.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)|35.9%|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)|66.3%|Hard|| -|1075|Project Employees I||67.0%|Easy|| -|1076|Project Employees II||51.2%|Easy|| -|1077|Project Employees III||78.4%|Medium|| -|1078|Occurrences After Bigram|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1078.Occurrences-After-Bigram)|64.2%|Easy|| +|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||51.9%|Medium|| -|1081|Smallest Subsequence of Distinct Characters||56.9%|Medium|| -|1082|Sales Analysis I||75.2%|Easy|| +|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||53.7%|Easy|| -|1085|Sum of Digits in the Minimum Number||75.7%|Easy|| -|1086|High Five||75.4%|Easy|| -|1087|Brace Expansion||65.8%|Medium|| -|1088|Confusing Number II||46.4%|Hard|| -|1089|Duplicate Zeros|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1089.Duplicate-Zeros)|51.2%|Easy|| -|1090|Largest Values From Labels||60.6%|Medium|| -|1091|Shortest Path in Binary Matrix|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1091.Shortest-Path-in-Binary-Matrix)|42.7%|Medium|| -|1092|Shortest Common Supersequence||56.0%|Hard|| -|1093|Statistics from a Large Sample|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1093.Statistics-from-a-Large-Sample)|45.8%|Medium|| -|1094|Car Pooling||58.2%|Medium|| -|1095|Find in Mountain Array||35.9%|Hard|| -|1096|Brace Expansion II||62.7%|Hard|| -|1097|Game Play Analysis V||55.6%|Hard|| +|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.6%|Easy|| -|1100|Find K-Length Substrings With No Repeated Characters||74.8%|Medium|| -|1101|The Earliest Moment When Everyone Become Friends||64.3%|Medium|| -|1102|Path With Maximum Minimum Value||53.0%|Medium|| -|1103|Distribute Candies to People||63.7%|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.6%|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.9%|Hard|| -|1107|New Users Daily Count||45.8%|Medium|| -|1108|Defanging an IP Address|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1108.Defanging-an-IP-Address)|89.0%|Easy|| -|1109|Corporate Flight Bookings||58.7%|Medium|| -|1110|Delete Nodes And Return Forest|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1110.Delete-Nodes-And-Return-Forest)|69.3%|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.2%|Medium|| -|1112|Highest Grade For Each Student||73.6%|Medium|| -|1113|Reported Posts||66.2%|Easy|| -|1114|Print in Order||68.2%|Easy|| -|1115|Print FooBar Alternately||60.8%|Medium|| -|1116|Print Zero Even Odd||59.5%|Medium|| -|1117|Building H2O||54.6%|Medium|| -|1118|Number of Days in a Month||56.8%|Easy|| +|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.2%|Medium|| -|1121|Divide Array Into Increasing Sequences||59.8%|Hard|| -|1122|Relative Sort Array|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1122.Relative-Sort-Array)|68.2%|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.2%|Medium|| -|1124|Longest Well-Performing Interval||34.3%|Medium|| -|1125|Smallest Sufficient Team||47.7%|Hard|| -|1126|Active Businesses||67.7%|Medium|| -|1127|User Purchase Platform||51.3%|Hard|| -|1128|Number of Equivalent Domino Pairs|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1128.Number-of-Equivalent-Domino-Pairs)|46.3%|Easy|| -|1129|Shortest Path with Alternating Colors||42.2%|Medium|| +|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.9%|Medium|| -|1132|Reported Posts II||33.7%|Medium|| -|1133|Largest Unique Number||67.4%|Easy|| -|1134|Armstrong Number||78.2%|Easy|| -|1135|Connecting Cities With Minimum Cost||60.8%|Medium|| -|1136|Parallel Courses||60.9%|Medium|| -|1137|N-th Tribonacci Number|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1137.N-th-Tribonacci-Number)|62.9%|Easy|| +|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||49.6%|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||53.0%|Easy|| -|1142|User Activity for the Past 30 Days II||35.9%|Easy|| -|1143|Longest Common Subsequence|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1143.Longest-Common-Subsequence)|58.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.2%|Medium|| -|1146|Snapshot Array||37.0%|Medium|| -|1147|Longest Chunked Palindrome Decomposition||60.2%|Hard|| -|1148|Article Views I||76.9%|Easy|| -|1149|Article Views II||47.8%|Medium|| -|1150|Check If a Number Is Majority Element in a Sorted Array||56.7%|Easy|| -|1151|Minimum Swaps to Group All 1's Together||59.3%|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.5%|Hard|| -|1154|Day of the Year|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1154.Day-of-the-Year)|50.9%|Easy|| -|1155|Number of Dice Rolls With Target Sum||47.7%|Medium|| -|1156|Swap For Longest Repeated Character Substring||46.1%|Medium|| -|1157|Online Majority Element In Subarray|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1157.Online-Majority-Element-In-Subarray)|42.2%|Hard|| -|1158|Market Analysis I||65.7%|Medium|| -|1159|Market Analysis II||58.1%|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.7%|Easy|| -|1161|Maximum Level Sum of a Binary Tree||66.6%|Medium|| -|1162|As Far from Land as Possible||48.0%|Medium|| -|1163|Last Substring in Lexicographical Order||35.5%|Hard|| +|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.6%|Easy|| -|1166|Design File System||61.6%|Medium|| -|1167|Minimum Cost to Connect Sticks||67.1%|Medium|| -|1168|Optimize Water Distribution in a Village||63.9%|Hard|| -|1169|Invalid Transactions||30.1%|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.1%|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.6%|Medium|| -|1172|Dinner Plate Stacks||34.3%|Hard|| -|1173|Immediate Food Delivery I||83.2%|Easy|| -|1174|Immediate Food Delivery II||63.8%|Medium|| -|1175|Prime Arrangements|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1175.Prime-Arrangements)|52.9%|Easy|| -|1176|Diet Plan Performance||52.5%|Easy|| -|1177|Can Make Palindrome from Substring||37.3%|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.8%|Hard|| -|1179|Reformat Department Table||82.4%|Easy|| -|1180|Count Substrings with Only One Distinct Letter||78.8%|Easy|| -|1181|Before and After Puzzle||44.9%|Medium|| -|1182|Shortest Distance to Target Color||54.2%|Medium|| -|1183|Maximum Number of Ones||60.5%|Hard|| +|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)|58.4%|Easy|| -|1186|Maximum Subarray Sum with One Deletion||40.6%|Medium|| -|1187|Make Array Strictly Increasing||44.5%|Hard|| -|1188|Design Bounded Blocking Queue||73.0%|Medium|| -|1189|Maximum Number of Balloons|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1189.Maximum-Number-of-Balloons)|62.5%|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.7%|Medium|| -|1191|K-Concatenation Maximum Sum||24.1%|Medium|| -|1192|Critical Connections in a Network||52.1%|Hard|| -|1193|Monthly Transactions I||67.3%|Medium|| -|1194|Tournament Winners||52.0%|Hard|| -|1195|Fizz Buzz Multithreaded||72.2%|Medium|| -|1196|How Many Apples Can You Put into the Basket||67.4%|Easy|| -|1197|Minimum Knight Moves||39.6%|Medium|| -|1198|Find Smallest Common Element in All Rows||75.9%|Medium|| -|1199|Minimum Time to Build Blocks||40.4%|Hard|| +|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.1%|Medium|| -|1202|Smallest String With Swaps|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1202.Smallest-String-With-Swaps)|57.1%|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)|49.6%|Hard|| -|1204|Last Person to Fit in the Bus||73.7%|Medium|| -|1205|Monthly Transactions II||44.6%|Medium|| -|1206|Design Skiplist||59.9%|Hard|| -|1207|Unique Number of Occurrences|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1207.Unique-Number-of-Occurrences)|71.9%|Easy|| -|1208|Get Equal Substrings Within Budget|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1208.Get-Equal-Substrings-Within-Budget)|46.5%|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.3%|Medium|| -|1210|Minimum Moves to Reach Target with Rotations||48.2%|Hard|| -|1211|Queries Quality and Percentage||70.8%|Easy|| -|1212|Team Scores in Football Tournament||57.4%|Medium|| +|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.5%|Medium|| -|1215|Stepping Numbers||45.5%|Medium|| -|1216|Valid Palindrome III||50.7%|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.6%|Easy|| -|1218|Longest Arithmetic Subsequence of Given Difference||51.5%|Medium|| -|1219|Path with Maximum Gold||65.7%|Medium|| -|1220|Count Vowels Permutation||56.2%|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.6%|Easy|| -|1222|Queens That Can Attack the King||71.2%|Medium|| -|1223|Dice Roll Simulation||47.9%|Hard|| -|1224|Maximum Equal Frequency||36.6%|Hard|| -|1225|Report Contiguous Dates||63.3%|Hard|| -|1226|The Dining Philosophers||57.3%|Medium|| -|1227|Airplane Seat Assignment Probability||64.2%|Medium|| -|1228|Missing Number In Arithmetic Progression||51.2%|Easy|| -|1229|Meeting Scheduler||54.8%|Medium|| -|1230|Toss Strange Coins||52.7%|Medium|| -|1231|Divide Chocolate||56.4%|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.9%|Easy|| -|1233|Remove Sub-Folders from the Filesystem||65.2%|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.2%|Medium|| -|1235|Maximum Profit in Job Scheduling|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1235.Maximum-Profit-in-Job-Scheduling)|50.9%|Hard|| -|1236|Web Crawler||65.7%|Medium|| +|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.1%|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.5%|Medium|| -|1240|Tiling a Rectangle with the Fewest Squares||53.7%|Hard|| -|1241|Number of Comments per Post||67.9%|Easy|| -|1242|Web Crawler Multithreaded||48.6%|Medium|| -|1243|Array Transformation||50.4%|Easy|| -|1244|Design A Leaderboard||68.1%|Medium|| -|1245|Tree Diameter||62.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||58.6%|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.7%|Medium|| -|1250|Check If It Is a Good Array||58.1%|Hard|| -|1251|Average Selling Price||83.3%|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.5%|Easy|| -|1253|Reconstruct a 2-Row Binary Matrix||43.3%|Medium|| -|1254|Number of Closed Islands|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1254.Number-of-Closed-Islands)|63.4%|Medium|| -|1255|Maximum Score Words Formed by Letters||72.1%|Hard|| -|1256|Encode Number||69.7%|Medium|| -|1257|Smallest Common Region||63.3%|Medium|| -|1258|Synonymous Sentences||56.6%|Medium|| -|1259|Handshakes That Don't Cross||56.1%|Hard|| -|1260|Shift 2D Grid|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1260.Shift-2D-Grid)|68.1%|Easy|| -|1261|Find Elements in a Contaminated Binary Tree||75.8%|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||48.5%|Hard|| +|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||58.4%|Medium|| -|1268|Search Suggestions System|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1268.Search-Suggestions-System)|65.3%|Medium|| -|1269|Number of Ways to Stay in the Same Place After Some Steps||43.4%|Hard|| +|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||56.4%|Easy|| -|1272|Remove Interval||61.3%|Medium|| -|1273|Delete Tree Nodes||61.1%|Medium|| -|1274|Number of Ships in a Rectangle||68.6%|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.8%|Easy|| +|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.2%|Medium|| -|1278|Palindrome Partitioning III||60.9%|Hard|| -|1279|Traffic Light Controlled Intersection||75.3%|Easy|| -|1280|Students and Examinations||74.3%|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.4%|Easy|| -|1282|Group the People Given the Group Size They Belong To||85.3%|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)|53.9%|Medium|| -|1284|Minimum Number of Flips to Convert Binary Matrix to Zero Matrix||72.2%|Hard|| +|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.2%|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.6%|Easy|| -|1288|Remove Covered Intervals||57.4%|Medium|| -|1289|Minimum Falling Path Sum II||61.1%|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.7%|Easy|| -|1291|Sequential Digits||60.9%|Medium|| -|1292|Maximum Side Length of a Square with Sum Less than or Equal to Threshold||52.6%|Medium|| -|1293|Shortest Path in a Grid with Obstacles Elimination||43.6%|Hard|| -|1294|Weather Type in Each Country||67.5%|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)|77.1%|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.5%|Medium|| -|1297|Maximum Number of Occurrences of a Substring||52.4%|Medium|| -|1298|Maximum Candies You Can Get from Boxes||60.8%|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.5%|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)|42.8%|Medium|| -|1301|Number of Paths with Max Score||38.9%|Hard|| -|1302|Deepest Leaves Sum|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1302.Deepest-Leaves-Sum)|85.7%|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.0%|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.6%|Medium|| -|1306|Jump Game III|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1306.Jump-Game-III)|62.8%|Medium|| -|1307|Verbal Arithmetic Puzzle||34.7%|Hard|| -|1308|Running Total for Different Genders||88.2%|Medium|| -|1309|Decrypt String from Alphabet to Integer Mapping||78.8%|Easy|| -|1310|XOR Queries of a Subarray|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1310.XOR-Queries-of-a-Subarray)|71.2%|Medium|| -|1311|Get Watched Videos by Your Friends||45.2%|Medium|| -|1312|Minimum Insertion Steps to Make a String Palindrome||63.7%|Hard|| +|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.2%|Medium|| -|1315|Sum of Nodes with Even-Valued Grandparent||85.2%|Medium|| -|1316|Distinct Echo Substrings||49.9%|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.9%|Easy|| -|1318|Minimum Flips to Make a OR b Equal to c||65.3%|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)|57.8%|Medium|| -|1320|Minimum Distance to Type a Word Using Two Fingers||60.3%|Hard|| -|1321|Restaurant Growth||72.5%|Medium|| -|1322|Ads Performance||60.2%|Easy|| -|1323|Maximum 69 Number||78.9%|Easy|| -|1324|Print Words Vertically||59.7%|Medium|| +|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||48.1%|Hard|| +|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||52.3%|Medium|| -|1329|Sort the Matrix Diagonally|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1329.Sort-the-Matrix-Diagonally)|81.4%|Medium|| -|1330|Reverse Subarray To Maximize Array Value||39.0%|Hard|| -|1331|Rank Transform of an Array||58.5%|Easy|| -|1332|Remove Palindromic Subsequences|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1332.Remove-Palindromic-Subsequences)|69.6%|Easy|| -|1333|Filter Restaurants by Vegan-Friendly, Price and Distance||58.9%|Medium|| -|1334|Find the City With the Smallest Number of Neighbors at a Threshold Distance||51.3%|Medium|| -|1335|Minimum Difficulty of a Job Schedule||56.5%|Hard|| +|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)|74.3%|Easy|| -|1338|Reduce Array Size to The Half||68.4%|Medium|| -|1339|Maximum Product of Splitted Binary Tree||43.0%|Medium|| -|1340|Jump Game V||62.1%|Hard|| -|1341|Movie Rating||58.2%|Medium|| +|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.9%|Medium|| -|1344|Angle Between Hands of a Clock||63.3%|Medium|| -|1345|Jump Game IV||44.4%|Hard|| -|1346|Check If N and Its Double Exist||35.7%|Easy|| -|1347|Minimum Number of Steps to Make Two Strings Anagram||76.4%|Medium|| -|1348|Tweet Counts Per Frequency||43.1%|Medium|| -|1349|Maximum Students Taking Exam||46.9%|Hard|| +|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.2%|Easy|| -|1352|Product of the Last K Numbers||47.9%|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)|33.4%|Medium|| -|1354|Construct Target Array With Multiple Sums||31.2%|Hard|| -|1355|Activity Participants||74.6%|Medium|| -|1356|Sort Integers by The Number of 1 Bits||71.4%|Easy|| -|1357|Apply Discount Every n Orders||69.0%|Medium|| -|1358|Number of Substrings Containing All Three Characters||62.1%|Medium|| -|1359|Count All Valid Pickup and Delivery Options||63.3%|Hard|| -|1360|Number of Days Between Two Dates||46.8%|Easy|| -|1361|Validate Binary Tree Nodes||41.4%|Medium|| -|1362|Closest Divisors||59.1%|Medium|| -|1363|Largest Multiple of Three||34.1%|Hard|| -|1364|Number of Trusted Contacts of a Customer||78.8%|Medium|| -|1365|How Many Numbers Are Smaller Than the Current Number||86.4%|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||42.8%|Medium|| -|1368|Minimum Cost to Make at Least One Valid Path in a Grid||60.7%|Hard|| -|1369|Get the Second Most Recent Activity||68.9%|Hard|| -|1370|Increasing Decreasing String||77.8%|Easy|| -|1371|Find the Longest Substring Containing Vowels in Even Counts||62.6%|Medium|| -|1372|Longest ZigZag Path in a Binary Tree||58.4%|Medium|| -|1373|Maximum Sum BST in Binary Tree||38.7%|Hard|| -|1374|Generate a String With Characters That Have Odd Counts||77.4%|Easy|| -|1375|Number of Times Binary String Is Prefix-Aligned||65.7%|Medium|| -|1376|Time Needed to Inform All Employees||58.1%|Medium|| -|1377|Frog Position After T Seconds||36.3%|Hard|| -|1378|Replace Employee ID With The Unique Identifier||91.2%|Easy|| -|1379|Find a Corresponding Node of a Binary Tree in a Clone of That Tree||85.5%|Medium|| -|1380|Lucky Numbers in a Matrix|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1380.Lucky-Numbers-in-a-Matrix)|70.9%|Easy|| -|1381|Design a Stack With Increment Operation||77.1%|Medium|| -|1382|Balance a Binary Search Tree||80.4%|Medium|| -|1383|Maximum Performance of a Team|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1383.Maximum-Performance-of-a-Team)|41.5%|Hard|| -|1384|Total Sales Amount by Year||66.3%|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.8%|Easy|| -|1386|Cinema Seat Allocation||39.7%|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||48.8%|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.6%|Easy|| -|1390|Four Divisors||40.9%|Medium|| -|1391|Check if There is a Valid Path in a Grid||46.6%|Medium|| -|1392|Longest Happy Prefix||44.4%|Hard|| -|1393|Capital Gain/Loss||91.0%|Medium|| -|1394|Find Lucky Integer in an Array||63.6%|Easy|| -|1395|Count Number of Teams||69.4%|Medium|| -|1396|Design Underground System|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1396.Design-Underground-System)|73.5%|Medium|| -|1397|Find All Good Strings||41.3%|Hard|| -|1398|Customers Who Bought Products A and B but Not C||78.5%|Medium|| -|1399|Count Largest Group||66.8%|Easy|| -|1400|Construct K Palindrome Strings||63.7%|Medium|| -|1401|Circle and Rectangle Overlapping||43.6%|Medium|| -|1402|Reducing Dishes||72.4%|Hard|| -|1403|Minimum Subsequence in Non-Increasing Order||72.1%|Easy|| -|1404|Number of Steps to Reduce a Number in Binary Representation to One||50.9%|Medium|| -|1405|Longest Happy String||56.6%|Medium|| -|1406|Stone Game III||60.2%|Hard|| -|1407|Top Travellers||83.4%|Easy|| +|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||82.8%|Medium|| -|1410|HTML Entity Parser||52.6%|Medium|| -|1411|Number of Ways to Paint N × 3 Grid||61.8%|Hard|| -|1412|Find the Quiet Students in All Exams||62.7%|Hard|| -|1413|Minimum Value to Get Positive Step by Step Sum||68.6%|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||71.4%|Medium|| -|1416|Restore The Array||38.0%|Hard|| -|1417|Reformat The String||56.3%|Easy|| -|1418|Display Table of Food Orders in a Restaurant||72.5%|Medium|| -|1419|Minimum Number of Frogs Croaking||49.7%|Medium|| -|1420|Build Array Where You Can Find The Maximum Exactly K Comparisons||64.3%|Hard|| -|1421|NPV Queries||83.7%|Easy|| +|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)|50.0%|Medium|| -|1424|Diagonal Traverse II||50.0%|Medium|| -|1425|Constrained Subsequence Sum||46.7%|Hard|| +|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.0%|Easy|| -|1428|Leftmost Column with at Least a One||52.5%|Medium|| -|1429|First Unique Number||52.3%|Medium|| -|1430|Check If a String Is a Valid Sequence from Root to Leaves Path in a Binary Tree||45.8%|Medium|| -|1431|Kids With the Greatest Number of Candies||87.7%|Easy|| -|1432|Max Difference You Can Get From Changing an Integer||43.2%|Medium|| -|1433|Check If a String Can Break Another String||68.4%|Medium|| -|1434|Number of Ways to Wear Different Hats to Each Other||42.1%|Hard|| -|1435|Create a Session Bar Chart||78.2%|Easy|| -|1436|Destination City||77.7%|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.9%|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)|46.4%|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.5%|Hard|| -|1440|Evaluate Boolean Expression||75.5%|Medium|| -|1441|Build an Array With Stack Operations||71.0%|Easy|| -|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)|74.8%|Medium|| -|1443|Minimum Time to Collect All Apples in a Tree||55.6%|Medium|| -|1444|Number of Ways of Cutting a Pizza||55.3%|Hard|| -|1445|Apples & Oranges||91.5%|Medium|| -|1446|Consecutive Characters|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1446.Consecutive-Characters)|62.0%|Easy|| -|1447|Simplified Fractions||64.0%|Medium|| -|1448|Count Good Nodes in Binary Tree||73.0%|Medium|| -|1449|Form Largest Integer With Digits That Add up to Target||46.5%|Hard|| -|1450|Number of Students Doing Homework at a Given Time||76.4%|Easy|| -|1451|Rearrange Words in a Sentence||62.0%|Medium|| -|1452|People Whose List of Favorite Companies Is Not a Subset of Another List||56.6%|Medium|| -|1453|Maximum Number of Darts Inside of a Circular Dartboard||36.6%|Hard|| -|1454|Active Users||38.3%|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.5%|Easy|| -|1456|Maximum Number of Vowels in a Substring of Given Length||57.4%|Medium|| -|1457|Pseudo-Palindromic Paths in a Binary Tree||67.2%|Medium|| -|1458|Max Dot Product of Two Subsequences||45.2%|Hard|| -|1459|Rectangles Area||68.5%|Medium|| -|1460|Make Two Arrays Equal by Reversing Sub-arrays||72.5%|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)|54.4%|Medium|| -|1462|Course Schedule IV||47.9%|Medium|| -|1463|Cherry Pickup II|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1463.Cherry-Pickup-II)|70.7%|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.5%|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)|37.2%|Medium|| -|1466|Reorder Routes to Make All Paths Lead to the City Zero||61.0%|Medium|| -|1467|Probability of a Two Boxes Having The Same Number of Distinct Balls||60.9%|Hard|| -|1468|Calculate Salaries||82.3%|Medium|| +|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.3%|Easy|| -|1471|The k Strongest Values in an Array||59.8%|Medium|| -|1472|Design Browser History||75.0%|Medium|| -|1473|Paint House III||50.8%|Hard|| -|1474|Delete N Nodes After M Nodes of a Linked List||73.4%|Easy|| -|1475|Final Prices With a Special Discount in a Shop||75.2%|Easy|| -|1476|Subrectangle Queries||88.2%|Medium|| -|1477|Find Two Non-overlapping Sub-arrays Each With Target Sum||36.8%|Medium|| -|1478|Allocate Mailboxes||55.4%|Hard|| +|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.6%|Easy|| -|1481|Least Number of Unique Integers after K Removals||60.3%|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.0%|Medium|| -|1483|Kth Ancestor of a Tree Node||33.4%|Hard|| -|1484|Group Sold Products By The Date||84.3%|Easy|| -|1485|Clone Binary Tree With Random Pointer||79.7%|Medium|| +|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||34.9%|Medium|| -|1488|Avoid Flood in The City||25.5%|Medium|| -|1489|Find Critical and Pseudo-Critical Edges in Minimum Spanning Tree||52.9%|Hard|| -|1490|Clone N-ary Tree||83.8%|Medium|| -|1491|Average Salary Excluding the Minimum and Maximum Salary||65.0%|Easy|| -|1492|The kth Factor of n||62.1%|Medium|| -|1493|Longest Subarray of 1's After Deleting One Element||60.0%|Medium|| -|1494|Parallel Courses II||31.7%|Hard|| -|1495|Friendly Movies Streamed Last Month||50.3%|Easy|| -|1496|Path Crossing||55.7%|Easy|| -|1497|Check If Array Pairs Are Divisible by k||40.5%|Medium|| -|1498|Number of Subsequences That Satisfy the Given Sum Condition||39.2%|Medium|| -|1499|Max Value of Equation||46.9%|Hard|| -|1500|Design a File Sharing System||44.8%|Medium|| -|1501|Countries You Can Safely Invest In||57.6%|Medium|| -|1502|Can Make Arithmetic Progression From Sequence||69.6%|Easy|| -|1503|Last Moment Before All Ants Fall Out of a Plank||54.9%|Medium|| -|1504|Count Submatrices With All Ones||58.5%|Medium|| -|1505|Minimum Possible Integer After at Most K Adjacent Swaps On Digits||37.8%|Hard|| -|1506|Find Root of N-Ary Tree||78.0%|Medium|| -|1507|Reformat Date||61.8%|Easy|| -|1508|Range Sum of Sorted Subarray Sums||59.2%|Medium|| -|1509|Minimum Difference Between Largest and Smallest Value in Three Moves||55.4%|Medium|| -|1510|Stone Game IV||60.8%|Hard|| -|1511|Customer Order Frequency||73.2%|Easy|| -|1512|Number of Good Pairs|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1512.Number-of-Good-Pairs)|88.0%|Easy|| -|1513|Number of Substrings With Only 1s||44.3%|Medium|| -|1514|Path with Maximum Probability||46.6%|Medium|| -|1515|Best Position for a Service Centre||38.5%|Hard|| -|1516|Move Sub-Tree of N-Ary Tree||64.5%|Hard|| -|1517|Find Users With Valid E-Mails||60.4%|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||39.9%|Medium|| -|1520|Maximum Number of Non-Overlapping Substrings||37.5%|Hard|| -|1521|Find a Value of a Mysterious Function Closest to Target||43.5%|Hard|| -|1522|Diameter of N-Ary Tree||73.2%|Medium|| -|1523|Count Odd Numbers in an Interval Range||47.8%|Easy|| -|1524|Number of Sub-arrays With Odd Sum||43.5%|Medium|| -|1525|Number of Good Ways to Split a String||70.1%|Medium|| -|1526|Minimum Number of Increments on Subarrays to Form a Target Array||68.0%|Hard|| -|1527|Patients With a Condition||47.0%|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.4%|Medium|| -|1530|Number of Good Leaf Nodes Pairs||59.6%|Medium|| -|1531|String Compression II||38.0%|Hard|| -|1532|The Most Recent Three Orders||71.0%|Medium|| -|1533|Find the Index of the Large Integer||50.8%|Medium|| -|1534|Count Good Triplets||80.6%|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||45.8%|Medium|| -|1537|Get the Maximum Score||39.2%|Hard|| -|1538|Guess the Majority in a Hidden Array||62.5%|Medium|| -|1539|Kth Missing Positive Number|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1539.Kth-Missing-Positive-Number)|55.5%|Easy|| -|1540|Can Convert String in K Moves||32.5%|Medium|| -|1541|Minimum Insertions to Balance a Parentheses String||49.3%|Medium|| -|1542|Find Longest Awesome Substring||40.8%|Hard|| -|1543|Fix Product Name Format||63.1%|Easy|| -|1544|Make The String Great||56.5%|Easy|| -|1545|Find Kth Bit in Nth Binary String||58.1%|Medium|| -|1546|Maximum Number of Non-Overlapping Subarrays With Sum Equals Target||46.4%|Medium|| -|1547|Minimum Cost to Cut a Stick||55.1%|Hard|| -|1548|The Most Similar Path in a Graph||56.8%|Hard|| -|1549|The Most Recent Orders for Each Product||67.7%|Medium|| -|1550|Three Consecutive Odds||64.1%|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)|80.8%|Medium|| -|1552|Magnetic Force Between Two Balls||54.9%|Medium|| -|1553|Minimum Number of Days to Eat N Oranges||32.9%|Hard|| -|1554|Strings Differ by One Character||54.2%|Medium|| -|1555|Bank Account Summary||53.3%|Medium|| -|1556|Thousand Separator||55.8%|Easy|| -|1557|Minimum Number of Vertices to Reach All Nodes||78.7%|Medium|| -|1558|Minimum Numbers of Function Calls to Make Target Array||64.0%|Medium|| -|1559|Detect Cycles in 2D Grid||48.0%|Medium|| -|1560|Most Visited Sector in a Circular Track||58.2%|Easy|| -|1561|Maximum Number of Coins You Can Get||78.2%|Medium|| -|1562|Find Latest Group of Size M||41.0%|Medium|| -|1563|Stone Game V||40.9%|Hard|| -|1564|Put Boxes Into the Warehouse I||64.5%|Medium|| -|1565|Unique Orders and Customers Per Month||83.3%|Easy|| -|1566|Detect Pattern of Length M Repeated K or More Times||43.5%|Easy|| -|1567|Maximum Length of Subarray With Positive Product||43.0%|Medium|| -|1568|Minimum Number of Days to Disconnect Island||48.6%|Hard|| -|1569|Number of Ways to Reorder Array to Get Same BST||49.2%|Hard|| -|1570|Dot Product of Two Sparse Vectors||90.3%|Medium|| -|1571|Warehouse Manager||89.9%|Easy|| -|1572|Matrix Diagonal Sum|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1572.Matrix-Diagonal-Sum)|79.1%|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.1%|Medium|| -|1574|Shortest Subarray to be Removed to Make Array Sorted||35.7%|Medium|| -|1575|Count All Possible Routes||57.5%|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.7%|Easy|| -|1577|Number of Ways Where Square of Number Is Equal to Product of Two Numbers||39.3%|Medium|| -|1578|Minimum Time to Make Rope Colorful||61.2%|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)|51.1%|Hard|| -|1580|Put Boxes Into the Warehouse II||63.6%|Medium|| -|1581|Customer Who Visited but Did Not Make Any Transactions||89.9%|Easy|| -|1582|Special Positions in a Binary Matrix||65.0%|Easy|| -|1583|Count Unhappy Friends||58.0%|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.3%|Hard|| -|1586|Binary Search Tree Iterator II||70.3%|Medium|| -|1587|Bank Account Summary II||90.0%|Easy|| -|1588|Sum of All Odd Length Subarrays||83.4%|Easy|| -|1589|Maximum Sum Obtained of Any Permutation||36.3%|Medium|| -|1590|Make Sum Divisible by P||28.2%|Medium|| -|1591|Strange Printer II||57.0%|Hard|| -|1592|Rearrange Spaces Between Words||44.0%|Easy|| -|1593|Split a String Into the Max Number of Unique Substrings||54.4%|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||45.9%|Hard|| -|1596|The Most Frequently Ordered Products for Each Customer||85.0%|Medium|| -|1597|Build Binary Expression Tree From Infix Expression||60.3%|Hard|| -|1598|Crawler Log Folder||64.4%|Easy|| -|1599|Maximum Profit of Operating a Centennial Wheel||43.9%|Medium|| -|1600|Throne Inheritance|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1600.Throne-Inheritance)|63.2%|Medium|| -|1601|Maximum Number of Achievable Transfer Requests||50.7%|Hard|| +|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)|87.6%|Easy|| -|1604|Alert Using Same Key-Card Three or More Times in a One Hour Period||47.0%|Medium|| -|1605|Find Valid Matrix Given Row and Column Sums||78.3%|Medium|| -|1606|Find Servers That Handled Most Number of Requests||41.0%|Hard|| -|1607|Sellers With No Sales||54.6%|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.5%|Easy|| -|1609|Even Odd Tree|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1609.Even-Odd-Tree)|53.0%|Medium|| -|1610|Maximum Number of Visible Points||36.7%|Hard|| -|1611|Minimum One Bit Operations to Make Integers Zero||62.4%|Hard|| -|1612|Check If Two Expression Trees are Equivalent||69.4%|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.9%|Easy|| -|1615|Maximal Network Rank||56.8%|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.4%|Hard|| -|1618|Maximum Font to Fit a Sentence in a Screen||58.0%|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.5%|Easy|| -|1620|Coordinate With Maximum Network Quality||37.1%|Medium|| -|1621|Number of Sets of K Non-Overlapping Line Segments||42.4%|Medium|| -|1622|Fancy Sequence||15.5%|Hard|| -|1623|All Valid Triplets That Can Represent a Country||88.5%|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.3%|Easy|| +|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||40.7%|Medium|| -|1627|Graph Connectivity With Threshold||44.7%|Hard|| -|1628|Design an Expression Tree With Evaluate Function||81.8%|Medium|| -|1629|Slowest Key|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1629.Slowest-Key)|59.6%|Easy|| -|1630|Arithmetic Subarrays||78.8%|Medium|| -|1631|Path With Minimum Effort|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1631.Path-With-Minimum-Effort)|55.0%|Medium|| -|1632|Rank Transform of a Matrix||40.6%|Hard|| -|1633|Percentage of Users Attended a Contest||69.4%|Easy|| -|1634|Add Two Polynomials Represented as Linked Lists||53.7%|Medium|| -|1635|Hopper Company Queries I||53.5%|Hard|| -|1636|Sort Array by Increasing Frequency|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1636.Sort-Array-by-Increasing-Frequency)|68.4%|Easy|| -|1637|Widest Vertical Area Between Two Points Containing No Points||84.0%|Medium|| -|1638|Count Substrings That Differ by One Character||72.0%|Medium|| -|1639|Number of Ways to Form a Target String Given a Dictionary||42.4%|Hard|| -|1640|Check Array Formation Through Concatenation|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1640.Check-Array-Formation-Through-Concatenation)|55.9%|Easy|| -|1641|Count Sorted Vowel Strings|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1641.Count-Sorted-Vowel-Strings)|74.9%|Medium|| -|1642|Furthest Building You Can Reach|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1642.Furthest-Building-You-Can-Reach)|45.1%|Medium|| -|1643|Kth Smallest Instructions||45.8%|Hard|| -|1644|Lowest Common Ancestor of a Binary Tree II||58.9%|Medium|| -|1645|Hopper Company Queries II||38.9%|Hard|| -|1646|Get Maximum in Generated Array|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1646.Get-Maximum-in-Generated-Array)|50.8%|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)|56.5%|Medium|| -|1648|Sell Diminishing-Valued Colored Balls|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1648.Sell-Diminishing-Valued-Colored-Balls)|30.8%|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.4%|Medium|| -|1651|Hopper Company Queries III||67.1%|Hard|| -|1652|Defuse the Bomb|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1652.Defuse-the-Bomb)|60.8%|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)|56.7%|Medium|| -|1654|Minimum Jumps to Reach Home|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1654.Minimum-Jumps-to-Reach-Home)|27.1%|Medium|| -|1655|Distribute Repeating Integers|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1655.Distribute-Repeating-Integers)|40.2%|Hard|| -|1656|Design an Ordered Stream|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1656.Design-an-Ordered-Stream)|83.8%|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.5%|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)|33.6%|Medium|| -|1659|Maximize Grid Happiness|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1659.Maximize-Grid-Happiness)|37.7%|Hard|| -|1660|Correct a Binary Tree||72.7%|Medium|| -|1661|Average Time of Process per Machine||79.9%|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)|82.0%|Easy|| +|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.2%|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)|55.8%|Hard|| -|1666|Change the Root of a Binary Tree||68.7%|Medium|| -|1667|Fix Names in a Table||63.4%|Easy|| +|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)|55.6%|Medium|| -|1671|Minimum Number of Removals to Make Mountain Array||43.1%|Hard|| -|1672|Richest Customer Wealth|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1672.Richest-Customer-Wealth)|89.2%|Easy|| -|1673|Find the Most Competitive Subsequence|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1673.Find-the-Most-Competitive-Subsequence)|48.5%|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)|37.3%|Medium|| -|1675|Minimize Deviation in Array|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1675.Minimize-Deviation-in-Array)|52.5%|Hard|| -|1676|Lowest Common Ancestor of a Binary Tree IV||79.5%|Medium|| -|1677|Product's Worth Over Invoices||40.6%|Easy|| -|1678|Goal Parser Interpretation|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1678.Goal-Parser-Interpretation)|85.8%|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.7%|Medium|| -|1680|Concatenation of Consecutive Binary Numbers|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1680.Concatenation-of-Consecutive-Binary-Numbers)|52.6%|Medium|| -|1681|Minimum Incompatibility|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1681.Minimum-Incompatibility)|37.1%|Hard|| -|1682|Longest Palindromic Subsequence II||50.6%|Medium|| -|1683|Invalid Tweets||90.9%|Easy|| +|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.6%|Medium|| -|1686|Stone Game VI||53.7%|Medium|| -|1687|Delivering Boxes from Storage to Ports||37.7%|Hard|| -|1688|Count of Matches in Tournament|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1688.Count-of-Matches-in-Tournament)|82.7%|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)|87.8%|Medium|| +|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)|53.7%|Hard|| -|1692|Count Ways to Distribute Candies||61.1%|Hard|| -|1693|Daily Leads and Partners||91.7%|Easy|| -|1694|Reformat Phone Number|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1694.Reformat-Phone-Number)|64.9%|Easy|| -|1695|Maximum Erasure Value|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1695.Maximum-Erasure-Value)|52.4%|Medium|| -|1696|Jump Game VI|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1696.Jump-Game-VI)|42.8%|Medium|| -|1697|Checking Existence of Edge Length Limited Paths||48.9%|Hard|| -|1698|Number of Distinct Substrings in a String||62.3%|Medium|| -|1699|Number of Calls Between Two Persons||86.1%|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||61.8%|Medium|| -|1702|Maximum Binary String After Change||45.3%|Medium|| -|1703|Minimum Adjacent Swaps for K Consecutive Ones||41.4%|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)|78.0%|Easy|| -|1705|Maximum Number of Eaten Apples|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1705.Maximum-Number-of-Eaten-Apples)|36.4%|Medium|| -|1706|Where Will the Ball Fall||66.6%|Medium|| -|1707|Maximum XOR With an Element From Array||43.3%|Hard|| +|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||78.1%|Medium|| -|1710|Maximum Units on a Truck|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1710.Maximum-Units-on-a-Truck)|72.0%|Easy|| -|1711|Count Good Meals||28.6%|Medium|| -|1712|Ways to Split Array Into Three Subarrays||31.6%|Medium|| -|1713|Minimum Operations to Make a Subsequence||48.9%|Hard|| -|1714|Sum Of Special Evenly-Spaced Elements In Array||52.0%|Hard|| -|1715|Count Apples and Oranges||78.1%|Medium|| -|1716|Calculate Money in Leetcode Bank|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1716.Calculate-Money-in-Leetcode-Bank)|64.9%|Easy|| -|1717|Maximum Score From Removing Substrings||45.1%|Medium|| -|1718|Construct the Lexicographically Largest Valid Sequence||51.3%|Medium|| -|1719|Number Of Ways To Reconstruct A Tree||42.1%|Hard|| -|1720|Decode XORed Array|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1720.Decode-XORed-Array)|85.9%|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)|68.4%|Medium|| -|1722|Minimize Hamming Distance After Swap Operations||48.0%|Medium|| -|1723|Find Minimum Time to Finish All Jobs||43.0%|Hard|| -|1724|Checking Existence of Edge Length Limited Paths II||52.6%|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.8%|Easy|| -|1726|Tuple with Same Product||60.5%|Medium|| -|1727|Largest Submatrix With Rearrangements||60.4%|Medium|| -|1728|Cat and Mouse II||41.2%|Hard|| -|1729|Find Followers Count||71.5%|Easy|| -|1730|Shortest Path to Get Food||54.3%|Medium|| -|1731|The Number of Employees Which Report to Each Employee||49.2%|Easy|| -|1732|Find the Highest Altitude|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1732.Find-the-Highest-Altitude)|78.9%|Easy|| -|1733|Minimum Number of People to Teach||40.8%|Medium|| -|1734|Decode XORed Permutation|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1734.Decode-XORed-Permutation)|60.8%|Medium|| -|1735|Count Ways to Make Array With Product||49.5%|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.1%|Easy|| -|1737|Change Minimum Characters to Satisfy One of Three Conditions||34.3%|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.9%|Medium|| -|1739|Building Boxes||50.8%|Hard|| -|1740|Find Distance in a Binary Tree||68.3%|Medium|| -|1741|Find Total Time Spent by Each Employee||91.8%|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.7%|Easy|| -|1743|Restore the Array From Adjacent Pairs||68.3%|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.3%|Medium|| -|1745|Palindrome Partitioning IV||48.9%|Hard|| -|1746|Maximum Subarray Sum After One Operation||61.8%|Medium|| -|1747|Leetflex Banned Accounts||67.3%|Medium|| +|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||57.0%|Medium|| -|1750|Minimum Length of String After Deleting Similar Ends||43.3%|Medium|| -|1751|Maximum Number of Events That Can Be Attended II||54.7%|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)|47.9%|Easy|| -|1753|Maximum Score From Removing Stones||65.2%|Medium|| -|1754|Largest Merge Of Two Strings||44.0%|Medium|| -|1755|Closest Subsequence Sum||36.4%|Hard|| -|1756|Design Most Recently Used Queue||78.9%|Medium|| -|1757|Recyclable and Low Fat Products||94.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)|59.2%|Easy|| -|1759|Count Number of Homogenous Substrings||46.5%|Medium|| -|1760|Minimum Limit of Balls in a Bag||57.9%|Medium|| -|1761|Minimum Degree of a Connected Trio in a Graph||41.5%|Hard|| -|1762|Buildings With an Ocean View||79.8%|Medium|| +|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||53.0%|Medium|| -|1765|Map of Highest Peak||59.8%|Medium|| -|1766|Tree of Coprimes||38.1%|Hard|| -|1767|Find the Subtasks That Did Not Execute||84.3%|Hard|| -|1768|Merge Strings Alternately||75.6%|Easy|| -|1769|Minimum Number of Operations to Move All Balls to Each Box||85.7%|Medium|| -|1770|Maximum Score from Performing Multiplication Operations||35.6%|Medium|| -|1771|Maximize Palindrome Length From Subsequences||34.7%|Hard|| -|1772|Sort Features by Popularity||65.6%|Medium|| -|1773|Count Items Matching a Rule||84.4%|Easy|| -|1774|Closest Dessert Cost||45.9%|Medium|| -|1775|Equal Sum Arrays With Minimum Number of Operations||51.5%|Medium|| -|1776|Car Fleet II||52.7%|Hard|| -|1777|Product's Price for Each Store||85.9%|Easy|| -|1778|Shortest Path in a Hidden Grid||41.3%|Medium|| -|1779|Find Nearest Point That Has the Same X or Y Coordinate||68.0%|Easy|| -|1780|Check if Number is a Sum of Powers of Three||64.9%|Medium|| -|1781|Sum of Beauty of All Substrings||59.8%|Medium|| -|1782|Count Pairs Of Nodes||37.4%|Hard|| -|1783|Grand Slam Titles||89.2%|Medium|| -|1784|Check if Binary String Has at Most One Segment of Ones||40.9%|Easy|| -|1785|Minimum Elements to Add to Form a Given Sum||41.6%|Medium|| -|1786|Number of Restricted Paths From First to Last Node||38.6%|Medium|| -|1787|Make the XOR of All Segments Equal to Zero||39.2%|Hard|| -|1788|Maximize the Beauty of the Garden||67.1%|Hard|| -|1789|Primary Department for Each Employee||79.3%|Easy|| -|1790|Check if One String Swap Can Make Strings Equal||45.9%|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||50.9%|Medium|| -|1793|Maximum Score of a Good Subarray||51.6%|Hard|| -|1794|Count Pairs of Equal Substrings With Minimum Difference||65.0%|Medium|| -|1795|Rearrange Products Table||90.8%|Easy|| -|1796|Second Largest Digit in a String||49.1%|Easy|| -|1797|Design Authentication Manager||54.2%|Medium|| -|1798|Maximum Number of Consecutive Values You Can Make||51.8%|Medium|| -|1799|Maximize Score After N Operations||46.6%|Hard|| -|1800|Maximum Ascending Subarray Sum||64.3%|Easy|| -|1801|Number of Orders in the Backlog||46.0%|Medium|| -|1802|Maximum Value at a Given Index in a Bounded Array||30.5%|Medium|| -|1803|Count Pairs With XOR in a Range||46.3%|Hard|| -|1804|Implement Trie II (Prefix Tree)||59.4%|Medium|| -|1805|Number of Different Integers in a String||35.7%|Easy|| -|1806|Minimum Number of Operations to Reinitialize a Permutation||70.9%|Medium|| +|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||30.4%|Hard|| -|1809|Ad-Free Sessions||59.9%|Easy|| -|1810|Minimum Path Cost in a Hidden Grid||53.7%|Medium|| -|1811|Find Interview Candidates||65.2%|Medium|| -|1812|Determine Color of a Chessboard Square||77.6%|Easy|| -|1813|Sentence Similarity III||32.4%|Medium|| -|1814|Count Nice Pairs in an Array||40.4%|Medium|| -|1815|Maximum Number of Groups Getting Fresh Donuts||39.8%|Hard|| -|1816|Truncate Sentence|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1816.Truncate-Sentence)|81.3%|Easy|| -|1817|Finding the Users Active Minutes||80.8%|Medium|| -|1818|Minimum Absolute Sum Difference|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1818.Minimum-Absolute-Sum-Difference)|29.4%|Medium|| -|1819|Number of Different Subsequences GCDs||37.1%|Hard|| -|1820|Maximum Number of Accepted Invitations||47.2%|Medium|| -|1821|Find Customers With Positive Revenue this Year||89.7%|Easy|| -|1822|Sign of the Product of an Array||67.0%|Easy|| -|1823|Find the Winner of the Circular Game||76.3%|Medium|| -|1824|Minimum Sideway Jumps||49.2%|Medium|| -|1825|Finding MK Average||33.6%|Hard|| -|1826|Faulty Sensor||49.6%|Easy|| -|1827|Minimum Operations to Make the Array Increasing||78.3%|Easy|| -|1828|Queries on Number of Points Inside a Circle||86.4%|Medium|| -|1829|Maximum XOR for Each Query||76.1%|Medium|| -|1830|Minimum Number of Operations to Make String Sorted||47.9%|Hard|| -|1831|Maximum Transaction Each Day||82.8%|Medium|| -|1832|Check if the Sentence Is Pangram||81.4%|Easy|| -|1833|Maximum Ice Cream Bars||64.8%|Medium|| -|1834|Single-Threaded CPU||41.0%|Medium|| -|1835|Find XOR Sum of All Pairs Bitwise AND||58.8%|Hard|| -|1836|Remove Duplicates From an Unsorted Linked List||69.8%|Medium|| -|1837|Sum of Digits in Base K||76.4%|Easy|| -|1838|Frequency of the Most Frequent Element||37.0%|Medium|| -|1839|Longest Substring Of All Vowels in Order||47.9%|Medium|| -|1840|Maximum Building Height||34.8%|Hard|| -|1841|League Statistics||57.2%|Medium|| -|1842|Next Palindrome Using Same Digits||54.5%|Hard|| -|1843|Suspicious Bank Accounts||48.1%|Medium|| -|1844|Replace All Digits with Characters||80.0%|Easy|| -|1845|Seat Reservation Manager||61.6%|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)|58.0%|Medium|| -|1847|Closest Room||33.4%|Hard|| -|1848|Minimum Distance to the Target Element||59.7%|Easy|| -|1849|Splitting a String Into Descending Consecutive Values||31.4%|Medium|| -|1850|Minimum Adjacent Swaps to Reach the Kth Smallest Number||72.1%|Medium|| -|1851|Minimum Interval to Include Each Query||45.6%|Hard|| -|1852|Distinct Numbers in Each Subarray||72.4%|Medium|| -|1853|Convert Date Format||87.7%|Easy|| -|1854|Maximum Population Year||58.7%|Easy|| -|1855|Maximum Distance Between a Pair of Values||50.6%|Medium|| -|1856|Maximum Subarray Min-Product||35.5%|Medium|| -|1857|Largest Color Value in a Directed Graph||39.8%|Hard|| -|1858|Longest Word With All Prefixes||66.5%|Medium|| -|1859|Sorting the Sentence||84.5%|Easy|| -|1860|Incremental Memory Leak||71.0%|Medium|| -|1861|Rotating the Box||64.6%|Medium|| -|1862|Sum of Floored Pairs||28.0%|Hard|| -|1863|Sum of All Subset XOR Totals||78.5%|Easy|| -|1864|Minimum Number of Swaps to Make the Binary String Alternating||38.9%|Medium|| -|1865|Finding Pairs With a Certain Sum||49.4%|Medium|| -|1866|Number of Ways to Rearrange Sticks With K Sticks Visible||55.3%|Hard|| -|1867|Orders With Maximum Quantity Above Average||76.1%|Medium|| -|1868|Product of Two Run-Length Encoded Arrays||58.2%|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||36.2%|Medium|| -|1871|Jump Game VII||24.8%|Medium|| -|1872|Stone Game VIII||52.2%|Hard|| -|1873|Calculate Special Bonus||89.1%|Easy|| -|1874|Minimize Product Sum of Two Arrays||91.1%|Medium|| -|1875|Group Employees of the Same Salary||75.7%|Medium|| -|1876|Substrings of Size Three with Distinct Characters||69.7%|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.7%|Medium|| -|1878|Get Biggest Three Rhombus Sums in a Grid||45.1%|Medium|| -|1879|Minimum XOR Sum of Two Arrays||42.4%|Hard|| -|1880|Check if Word Equals Summation of Two Words||73.2%|Easy|| -|1881|Maximum Value after Insertion||35.9%|Medium|| -|1882|Process Tasks Using Servers||37.5%|Medium|| +|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.0%|Medium|| -|1885|Count Pairs in Two Arrays||58.1%|Medium|| -|1886|Determine Whether Matrix Can Be Obtained By Rotation||55.4%|Easy|| -|1887|Reduction Operations to Make the Array Elements Equal||61.6%|Medium|| -|1888|Minimum Number of Flips to Make the Binary String Alternating||37.2%|Medium|| -|1889|Minimum Space Wasted From Packaging||30.0%|Hard|| -|1890|The Latest Login in 2020||83.3%|Easy|| +|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.3%|Hard|| -|1893|Check if All the Integers in a Range Are Covered||50.7%|Easy|| -|1894|Find the Student that Will Replace the Chalk||41.8%|Medium|| -|1895|Largest Magic Square||51.3%|Medium|| -|1896|Minimum Cost to Change the Final Value of Expression||53.9%|Hard|| -|1897|Redistribute Characters to Make All Strings Equal||60.1%|Easy|| -|1898|Maximum Number of Removable Characters||36.9%|Medium|| -|1899|Merge Triplets to Form Target Triplet||61.4%|Medium|| -|1900|The Earliest and Latest Rounds Where Players Compete||51.7%|Hard|| -|1901|Find a Peak Element II||53.6%|Medium|| -|1902|Depth of BST Given Insertion Order||46.2%|Medium|| -|1903|Largest Odd Number in String||56.7%|Easy|| -|1904|The Number of Full Rounds You Have Played||46.8%|Medium|| -|1905|Count Sub Islands||66.0%|Medium|| -|1906|Minimum Absolute Difference Queries||42.9%|Medium|| -|1907|Count Salary Categories||66.1%|Medium|| -|1908|Game of Nim||58.0%|Medium|| -|1909|Remove One Element to Make the Array Strictly Increasing||27.1%|Easy|| -|1910|Remove All Occurrences of a Substring||72.1%|Medium|| -|1911|Maximum Alternating Subsequence Sum||59.1%|Medium|| -|1912|Design Movie Rental System||41.6%|Hard|| -|1913|Maximum Product Difference Between Two Pairs||81.3%|Easy|| -|1914|Cyclically Rotating a Grid||47.1%|Medium|| -|1915|Number of Wonderful Substrings||43.6%|Medium|| -|1916|Count Ways to Build Rooms in an Ant Colony||48.2%|Hard|| -|1917|Leetcodify Friends Recommendations||30.3%|Hard|| -|1918|Kth Smallest Subarray Sum||53.8%|Medium|| -|1919|Leetcodify Similar Friends||42.7%|Hard|| -|1920|Build Array from Permutation||91.6%|Easy|| -|1921|Eliminate Maximum Number of Monsters||37.5%|Medium|| -|1922|Count Good Numbers||38.2%|Medium|| -|1923|Longest Common Subpath||28.2%|Hard|| -|1924|Erect the Fence II||56.1%|Hard|| -|1925|Count Square Sum Triples||67.6%|Easy|| -|1926|Nearest Exit from Entrance in Maze||40.7%|Medium|| -|1927|Sum Game||47.3%|Medium|| -|1928|Minimum Cost to Reach Destination in Time||37.4%|Hard|| -|1929|Concatenation of Array||91.6%|Easy|| -|1930|Unique Length-3 Palindromic Subsequences||51.1%|Medium|| -|1931|Painting a Grid With Three Different Colors||57.0%|Hard|| -|1932|Merge BSTs to Create Single BST||34.9%|Hard|| -|1933|Check if String Is Decomposable Into Value-Equal Substrings||51.2%|Easy|| -|1934|Confirmation Rate||77.3%|Medium|| -|1935|Maximum Number of Words You Can Type||71.4%|Easy|| -|1936|Add Minimum Number of Rungs||42.5%|Medium|| -|1937|Maximum Number of Points with Cost||35.5%|Medium|| -|1938|Maximum Genetic Difference Query||39.1%|Hard|| -|1939|Users That Actively Request Confirmation Messages||61.5%|Easy|| -|1940|Longest Common Subsequence Between Sorted Arrays||79.2%|Medium|| -|1941|Check if All Characters Have Equal Number of Occurrences||77.1%|Easy|| -|1942|The Number of the Smallest Unoccupied Chair||39.1%|Medium|| -|1943|Describe the Painting||46.5%|Medium|| -|1944|Number of Visible People in a Queue||70.1%|Hard|| -|1945|Sum of Digits of String After Convert||61.4%|Easy|| -|1946|Largest Number After Mutating Substring||34.0%|Medium|| -|1947|Maximum Compatibility Score Sum||60.2%|Medium|| -|1948|Delete Duplicate Folders in System||58.7%|Hard|| -|1949|Strong Friendship||59.4%|Medium|| -|1950|Maximum of Minimum Values in All Subarrays||51.2%|Medium|| -|1951|All the Pairs With the Maximum Number of Common Followers||72.7%|Medium|| -|1952|Three Divisors||56.6%|Easy|| -|1953|Maximum Number of Weeks for Which You Can Work||37.7%|Medium|| -|1954|Minimum Garden Perimeter to Collect Enough Apples||52.5%|Medium|| -|1955|Count Number of Special Subsequences||50.8%|Hard|| -|1956|Minimum Time For K Virus Variants to Spread||43.8%|Hard|| -|1957|Delete Characters to Make Fancy String||56.9%|Easy|| -|1958|Check if Move is Legal||43.5%|Medium|| -|1959|Minimum Total Space Wasted With K Resizing Operations||41.8%|Medium|| -|1960|Maximum Product of the Length of Two Palindromic Substrings||29.2%|Hard|| -|1961|Check If String Is a Prefix of Array||54.6%|Easy|| -|1962|Remove Stones to Minimize the Total||56.6%|Medium|| -|1963|Minimum Number of Swaps to Make the String Balanced||67.5%|Medium|| -|1964|Find the Longest Valid Obstacle Course at Each Position||45.4%|Hard|| -|1965|Employees With Missing Information||81.6%|Easy|| -|1966|Binary Searchable Numbers in an Unsorted Array||66.6%|Medium|| -|1967|Number of Strings That Appear as Substrings in Word||79.5%|Easy|| -|1968|Array With Elements Not Equal to Average of Neighbors||48.6%|Medium|| -|1969|Minimum Non-Zero Product of the Array Elements||32.5%|Medium|| -|1970|Last Day Where You Can Still Cross||48.9%|Hard|| -|1971|Find if Path Exists in Graph||50.1%|Easy|| -|1972|First and Last Call On the Same Day||52.5%|Hard|| -|1973|Count Nodes Equal to Sum of Descendants||75.5%|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||44.9%|Medium|| -|1976|Number of Ways to Arrive at Destination||33.0%|Medium|| -|1977|Number of Ways to Separate Numbers||22.2%|Hard|| -|1978|Employees Whose Manager Left the Company||50.1%|Easy|| -|1979|Find Greatest Common Divisor of Array||77.8%|Easy|| -|1980|Find Unique Binary String||63.3%|Medium|| -|1981|Minimize the Difference Between Target and Chosen Elements||32.7%|Medium|| -|1982|Find Array Given Subset Sums||48.4%|Hard|| -|1983|Widest Pair of Indices With Equal Range Sum||53.9%|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.4%|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||31.7%|Medium|| -|1987|Number of Unique Good Subsequences||52.1%|Hard|| -|1988|Find Cutoff Score for Each School||69.3%|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.3%|Medium|| -|1991|Find the Middle Index in Array||66.2%|Easy|| -|1992|Find All Groups of Farmland||67.2%|Medium|| -|1993|Operations on Tree||42.2%|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||57.9%|Easy|| -|1996|The Number of Weak Characters in the Game||33.6%|Medium|| -|1997|First Day Where You Have Been in All the Rooms||35.4%|Medium|| +|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||52.4%|Medium|| -|2000|Reverse Prefix of Word||77.9%|Easy|| -|2001|Number of Pairs of Interchangeable Rectangles||43.3%|Medium|| -|2002|Maximum Product of the Length of Two Palindromic Subsequences||53.0%|Medium|| -|2003|Smallest Missing Genetic Value in Each Subtree||42.4%|Hard|| -|2004|The Number of Seniors and Juniors to Join the Company||38.5%|Hard|| -|2005|Subtree Removal Game with Fibonacci Tree||62.3%|Hard|| -|2006|Count Number of Pairs With Absolute Difference K||82.8%|Easy|| -|2007|Find Original Array From Doubled Array||38.1%|Medium|| -|2008|Maximum Earnings From Taxi||42.6%|Medium|| -|2009|Minimum Number of Operations to Make Array Continuous||45.6%|Hard|| -|2010|The Number of Seniors and Juniors to Join the Company II||57.2%|Hard|| -|2011|Final Value of Variable After Performing Operations||89.1%|Easy|| -|2012|Sum of Beauty in the Array||46.0%|Medium|| -|2013|Detect Squares||46.9%|Medium|| -|2014|Longest Subsequence Repeated k Times||55.1%|Hard|| -|2015|Average Height of Buildings in Each Segment||57.8%|Medium|| -|2016|Maximum Difference Between Increasing Elements||54.5%|Easy|| -|2017|Grid Game||41.6%|Medium|| -|2018|Check if Word Can Be Placed In Crossword||48.2%|Medium|| -|2019|The Score of Students Solving Math Expression||33.9%|Hard|| -|2020|Number of Accounts That Did Not Stream||72.9%|Medium|| -|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)|59.0%|Easy|| -|2023|Number of Pairs of Strings With Concatenation Equal to Target||72.9%|Medium|| -|2024|Maximize the Confusion of an Exam||57.4%|Medium|| -|2025|Maximum Number of Ways to Partition an Array||31.4%|Hard|| -|2026|Low-Quality Problems||85.6%|Easy|| -|2027|Minimum Moves to Convert String||53.5%|Easy|| -|2028|Find Missing Observations||42.1%|Medium|| -|2029|Stone Game IX||24.9%|Medium|| -|2030|Smallest K-Length Subsequence With Occurrences of a Letter||38.8%|Hard|| -|2031|Count Subarrays With More Ones Than Zeros||53.6%|Medium|| -|2032|Two Out of Three||72.9%|Easy|| -|2033|Minimum Operations to Make a Uni-Value Grid||50.7%|Medium|| -|2034|Stock Price Fluctuation||47.9%|Medium|| -|2035|Partition Array Into Two Arrays to Minimize Sum Difference||21.3%|Hard|| -|2036|Maximum Alternating Subarray Sum||40.9%|Medium|| -|2037|Minimum Number of Moves to Seat Everyone||82.7%|Easy|| -|2038|Remove Colored Pieces if Both Neighbors are the Same Color||56.4%|Medium|| -|2039|The Time When the Network Becomes Idle||49.5%|Medium|| -|2040|Kth Smallest Product of Two Sorted Arrays||28.5%|Hard|| -|2041|Accepted Candidates From the Interviews||77.6%|Medium|| -|2042|Check if Numbers Are Ascending in a Sentence||67.6%|Easy|| -|2043|Simple Bank System||65.3%|Medium|| +|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||36.7%|Hard|| -|2046|Sort Linked List Already Sorted Using Absolute Values||69.6%|Medium|| -|2047|Number of Valid Words in a Sentence||29.3%|Easy|| -|2048|Next Greater Numerically Balanced Number||46.4%|Medium|| -|2049|Count Nodes With the Highest Score||46.8%|Medium|| -|2050|Parallel Courses III||59.6%|Hard|| -|2051|The Category of Each Member in the Store||73.3%|Medium|| -|2052|Minimum Cost to Separate Sentence Into Rows||52.3%|Medium|| -|2053|Kth Distinct String in an Array||72.7%|Easy|| -|2054|Two Best Non-Overlapping Events||43.4%|Medium|| -|2055|Plates Between Candles||45.5%|Medium|| -|2056|Number of Valid Move Combinations On Chessboard||58.7%|Hard|| -|2057|Smallest Index With Equal Value||73.0%|Easy|| -|2058|Find the Minimum and Maximum Number of Nodes Between Critical Points||57.7%|Medium|| -|2059|Minimum Operations to Convert Number||46.1%|Medium|| -|2060|Check if an Original String Exists Given Two Encoded Strings||40.8%|Hard|| -|2061|Number of Spaces Cleaning Robot Cleaned||53.9%|Medium|| -|2062|Count Vowel Substrings of a String||65.8%|Easy|| -|2063|Vowels of All Substrings||54.3%|Medium|| -|2064|Minimized Maximum of Products Distributed to Any Store||49.1%|Medium|| -|2065|Maximum Path Quality of a Graph||57.9%|Hard|| -|2066|Account Balance||85.4%|Medium|| -|2067|Number of Equal Count Substrings||50.0%|Medium|| -|2068|Check Whether Two Strings are Almost Equivalent||66.1%|Easy|| -|2069|Walking Robot Simulation II||21.6%|Medium|| -|2070|Most Beautiful Item for Each Query||48.4%|Medium|| -|2071|Maximum Number of Tasks You Can Assign||36.8%|Hard|| -|2072|The Winner University||73.4%|Easy|| -|2073|Time Needed to Buy Tickets||62.3%|Easy|| -|2074|Reverse Nodes in Even Length Groups||50.5%|Medium|| -|2075|Decode the Slanted Ciphertext||49.8%|Medium|| -|2076|Process Restricted Friend Requests||54.1%|Hard|| -|2077|Paths in Maze That Lead to Same Room||57.0%|Medium|| -|2078|Two Furthest Houses With Different Colors||68.5%|Easy|| -|2079|Watering Plants||80.5%|Medium|| -|2080|Range Frequency Queries||36.6%|Medium|| -|2081|Sum of k-Mirror Numbers||41.2%|Hard|| -|2082|The Number of Rich Customers||81.1%|Easy|| -|2083|Substrings That Begin and End With the Same Letter||68.5%|Medium|| -|2084|Drop Type 1 Orders for Customers With Type 0 Orders||91.1%|Medium|| -|2085|Count Common Words With One Occurrence||70.1%|Easy|| -|2086|Minimum Number of Buckets Required to Collect Rainwater from Houses||45.1%|Medium|| -|2087|Minimum Cost Homecoming of a Robot in a Grid||50.1%|Medium|| -|2088|Count Fertile Pyramids in a Land||62.6%|Hard|| -|2089|Find Target Indices After Sorting Array||78.7%|Easy|| -|2090|K Radius Subarray Averages||41.2%|Medium|| -|2091|Removing Minimum and Maximum From Array||57.4%|Medium|| -|2092|Find All People With Secret||33.3%|Hard|| -|2093|Minimum Cost to Reach City With Discounts||56.8%|Medium|| -|2094|Finding 3-Digit Even Numbers||56.6%|Easy|| -|2095|Delete the Middle Node of a Linked List||57.0%|Medium|| -|2096|Step-By-Step Directions From a Binary Tree Node to Another||48.7%|Medium|| -|2097|Valid Arrangement of Pairs||39.9%|Hard|| -|2098|Subsequence of Size K With the Largest Even Sum||39.2%|Medium|| -|2099|Find Subsequence of Length K With the Largest Sum||43.6%|Easy|| -|2100|Find Good Days to Rob the Bank||46.7%|Medium|| -|2101|Detonate the Maximum Bombs||40.1%|Medium|| -|2102|Sequentially Ordinal Rank Tracker||62.7%|Hard|| -|2103|Rings and Rods||81.7%|Easy|| -|2104|Sum of Subarray Ranges||60.3%|Medium|| -|2105|Watering Plants II||51.3%|Medium|| -|2106|Maximum Fruits Harvested After at Most K Steps||35.2%|Hard|| -|2107|Number of Unique Flavors After Sharing K Candies||57.6%|Medium|| -|2108|Find First Palindromic String in the Array||79.2%|Easy|| -|2109|Adding Spaces to a String||56.1%|Medium|| -|2110|Number of Smooth Descent Periods of a Stock||55.5%|Medium|| -|2111|Minimum Operations to Make the Array K-Increasing||36.5%|Hard|| -|2112|The Airport With the Most Traffic||70.0%|Medium|| -|2113|Elements in Array After Removing and Replacing Elements||73.5%|Medium|| -|2114|Maximum Number of Words Found in Sentences||88.8%|Easy|| -|2115|Find All Possible Recipes from Given Supplies||44.0%|Medium|| -|2116|Check if a Parentheses String Can Be Valid||31.3%|Medium|| -|2117|Abbreviating the Product of a Range||28.4%|Hard|| -|2118|Build the Equation||57.9%|Hard|| -|2119|A Number After a Double Reversal||76.7%|Easy|| -|2120|Execution of All Suffix Instructions Staying in a Grid||83.4%|Medium|| -|2121|Intervals Between Identical Elements||42.2%|Medium|| -|2122|Recover the Original Array||37.5%|Hard|| -|2123|Minimum Operations to Remove Adjacent Ones in Matrix||40.6%|Hard|| -|2124|Check if All A's Appears Before All B's||72.4%|Easy|| -|2125|Number of Laser Beams in a Bank||83.2%|Medium|| -|2126|Destroying Asteroids||48.4%|Medium|| -|2127|Maximum Employees to Be Invited to a Meeting||30.1%|Hard|| -|2128|Remove All Ones With Row and Column Flips||76.8%|Medium|| -|2129|Capitalize the Title||59.9%|Easy|| -|2130|Maximum Twin Sum of a Linked List||82.2%|Medium|| -|2131|Longest Palindrome by Concatenating Two Letter Words||38.5%|Medium|| -|2132|Stamping the Grid||28.8%|Hard|| -|2133|Check if Every Row and Column Contains All Numbers||52.4%|Easy|| -|2134|Minimum Swaps to Group All 1's Together II||47.8%|Medium|| -|2135|Count Words Obtained After Adding a Letter||39.1%|Medium|| -|2136|Earliest Possible Day of Full Bloom||67.5%|Hard|| -|2137|Pour Water Between Buckets to Make Water Levels Equal||67.7%|Medium|| -|2138|Divide a String Into Groups of Size k||65.5%|Easy|| -|2139|Minimum Moves to Reach Target Score||48.6%|Medium|| -|2140|Solving Questions With Brainpower||44.5%|Medium|| -|2141|Maximum Running Time of N Computers||38.2%|Hard|| -|2142|The Number of Passengers in Each Bus I||50.6%|Medium|| -|2143|Choose Numbers From Two Arrays in Range||53.5%|Hard|| -|2144|Minimum Cost of Buying Candies With Discount||60.6%|Easy|| -|2145|Count the Hidden Sequences||35.3%|Medium|| -|2146|K Highest Ranked Items Within a Price Range||40.5%|Medium|| -|2147|Number of Ways to Divide a Long Corridor||40.0%|Hard|| -|2148|Count Elements With Strictly Smaller and Greater Elements||60.4%|Easy|| -|2149|Rearrange Array Elements by Sign||82.1%|Medium|| -|2150|Find All Lonely Numbers in the Array||60.6%|Medium|| -|2151|Maximum Good People Based on Statements||46.4%|Hard|| -|2152|Minimum Number of Lines to Cover Points||45.3%|Medium|| -|2153|The Number of Passengers in Each Bus II||51.5%|Hard|| -|2154|Keep Multiplying Found Values by Two||73.6%|Easy|| -|2155|All Divisions With the Highest Score of a Binary Array||62.1%|Medium|| -|2156|Find Substring With Given Hash Value||21.0%|Hard|| -|2157|Groups of Strings||24.6%|Hard|| -|2158|Amount of New Area Painted Each Day||60.2%|Hard|| -|2159|Order Two Columns Independently||63.7%|Medium|| -|2160|Minimum Sum of Four Digit Number After Splitting Digits||88.0%|Easy|| -|2161|Partition Array According to Given Pivot||82.6%|Medium|| -|2162|Minimum Cost to Set Cooking Time||34.0%|Medium|| -|2163|Minimum Difference in Sums After Removal of Elements||45.6%|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)|67.4%|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)|50.7%|Medium|| -|2166|Design Bitset|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/2166.Design-Bitset)|29.8%|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)|39.1%|Hard|| -|2168|Unique Substrings With Equal Digit Frequency||60.1%|Medium|| -|2169|Count Operations to Obtain Zero|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/2169.Count-Operations-to-Obtain-Zero)|75.3%|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)|32.8%|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)|41.1%|Medium|| -|2172|Maximum AND Sum of Array||43.3%|Hard|| -|2173|Longest Winning Streak||52.7%|Hard|| -|2174|Remove All Ones With Row and Column Flips II||70.2%|Medium|| -|2175|The Change in Global Rankings||66.0%|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||60.8%|Medium|| -|2178|Maximum Split of Positive Even Integers||56.0%|Medium|| -|2179|Count Good Triplets in an Array||34.3%|Hard|| +|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)|87.1%|Medium|| -|2182|Construct String With Repeat Limit|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/2182.Construct-String-With-Repeat-Limit)|51.1%|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)|26.9%|Hard|| -|2184|Number of Ways to Build Sturdy Brick Wall||56.5%|Medium|| -|2185|Counting Words With a Given Prefix||77.6%|Easy|| -|2186|Minimum Number of Steps to Make Two Strings Anagram II||70.7%|Medium|| -|2187|Minimum Time to Complete Trips||29.9%|Medium|| -|2188|Minimum Time to Finish the Race||40.6%|Hard|| -|2189|Number of Ways to Build House of Cards||64.2%|Medium|| -|2190|Most Frequent Number Following Key In an Array||60.5%|Easy|| -|2191|Sort the Jumbled Numbers||43.5%|Medium|| -|2192|All Ancestors of a Node in a Directed Acyclic Graph||46.8%|Medium|| -|2193|Minimum Number of Moves to Make Palindrome||42.0%|Hard|| -|2194|Cells in a Range on an Excel Sheet||85.6%|Easy|| -|2195|Append K Integers With Minimal Sum||23.0%|Medium|| -|2196|Create Binary Tree From Descriptions||70.3%|Medium|| -|2197|Replace Non-Coprime Numbers in Array||35.5%|Hard|| -|2198|Number of Single Divisor Triplets||57.5%|Medium|| -|2199|Finding the Topic of Each Post||43.1%|Hard|| -|2200|Find All K-Distant Indices in an Array||64.1%|Easy|| -|2201|Count Artifacts That Can Be Extracted||54.0%|Medium|| -|2202|Maximize the Topmost Element After K Moves||22.0%|Medium|| -|2203|Minimum Weighted Subgraph With the Required Paths||35.2%|Hard|| -|2204|Distance to a Cycle in Undirected Graph||69.6%|Hard|| -|2205|The Number of Users That Are Eligible for Discount||47.6%|Easy|| -|2206|Divide Array Into Equal Pairs||76.9%|Easy|| -|2207|Maximize Number of Subsequences in a String||31.0%|Medium|| -|2208|Minimum Operations to Halve Array Sum||43.6%|Medium|| -|2209|Minimum White Tiles After Covering With Carpets||31.7%|Hard|| -|2210|Count Hills and Valleys in an Array||56.5%|Easy|| -|2211|Count Collisions on a Road||40.0%|Medium|| -|2212|Maximum Points in an Archery Competition||47.4%|Medium|| -|2213|Longest Substring of One Repeating Character||28.4%|Hard|| -|2214|Minimum Health to Beat Game||58.0%|Medium|| -|2215|Find the Difference of Two Arrays||69.0%|Easy|| -|2216|Minimum Deletions to Make Array Beautiful||43.9%|Medium|| -|2217|Find Palindrome With Fixed Length||34.2%|Medium|| -|2218|Maximum Value of K Coins From Piles||49.0%|Hard|| -|2219|Maximum Sum Score of Array||66.1%|Medium|| -|2220|Minimum Bit Flips to Convert Number||81.2%|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||45.3%|Medium|| -|2223|Sum of Scores of Built Strings||33.6%|Hard|| -|2224|Minimum Number of Operations to Convert Time||62.5%|Easy|| -|2225|Find Players With Zero or One Losses||67.6%|Medium|| -|2226|Maximum Candies Allocated to K Children||34.8%|Medium|| -|2227|Encrypt and Decrypt Strings||38.1%|Hard|| -|2228|Users With Two Purchases Within Seven Days||46.5%|Medium|| -|2229|Check if an Array Is Consecutive||63.3%|Easy|| -|2230|The Users That Are Eligible for Discount||51.0%|Easy|| -|2231|Largest Number After Digit Swaps by Parity||57.6%|Easy|| -|2232|Minimize Result by Adding Parentheses to Expression||63.4%|Medium|| -|2233|Maximum Product After K Increments||39.4%|Medium|| -|2234|Maximum Total Beauty of the Gardens||25.8%|Hard|| -|2235|Add Two Integers||93.1%|Easy|| -|2236|Root Equals Sum of Children||89.8%|Easy|| -|2237|Count Positions on Street With Required Brightness||71.6%|Medium|| -|2238|Number of Times a Driver Was a Passenger||78.3%|Medium|| -|2239|Find Closest Number to Zero||46.3%|Easy|| -|2240|Number of Ways to Buy Pens and Pencils||54.8%|Medium|| -|2241|Design an ATM Machine||36.5%|Medium|| -|2242|Maximum Score of a Node Sequence||31.3%|Hard|| -|2243|Calculate Digit Sum of a String||66.0%|Easy|| -|2244|Minimum Rounds to Complete All Tasks||54.1%|Medium|| -|2245|Maximum Trailing Zeros in a Cornered Path||33.1%|Medium|| -|2246|Longest Path With Different Adjacent Characters||42.7%|Hard|| -|2247|Maximum Cost of Trip With K Highways||52.4%|Hard|| -|2248|Intersection of Multiple Arrays||69.7%|Easy|| -|2249|Count Lattice Points Inside a Circle||50.0%|Medium|| -|2250|Count Number of Rectangles Containing Each Point||31.4%|Medium|| -|2251|Number of Flowers in Full Bloom||49.8%|Hard|| -|2252|Dynamic Pivoting of a Table||55.8%|Hard|| -|2253|Dynamic Unpivoting of a Table||57.9%|Hard|| -|2254|Design Video Sharing Platform||68.5%|Hard|| -|2255|Count Prefixes of a Given String||70.8%|Easy|| -|2256|Minimum Average Difference||34.3%|Medium|| -|2257|Count Unguarded Cells in the Grid||49.6%|Medium|| -|2258|Escape the Spreading Fire||32.6%|Hard|| -|2259|Remove Digit From Number to Maximize Result||45.5%|Easy|| -|2260|Minimum Consecutive Cards to Pick Up||53.8%|Medium|| -|2261|K Divisible Elements Subarrays||44.5%|Medium|| -|2262|Total Appeal of A String||50.3%|Hard|| -|2263|Make Array Non-decreasing or Non-increasing||67.0%|Hard|| +|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|| |------------|-------------------------------------------------------|-------| ----------------| ---------------|-------------| ------------------------------------------------------------------ diff --git a/ctl/meta/PDFPreface b/ctl/meta/PDFPreface index 24bc7a3b1..465400d8a 100644 --- a/ctl/meta/PDFPreface +++ b/ctl/meta/PDFPreface @@ -3,7 +3,7 @@ # 说明 -此版本是 https://books.halfrost.com/leetcode 网页的离线版,由于网页版实时会更新,所以此 PDF 版难免会有一些排版或者错别字。如果读者遇到了,可以到网页版相应页面,点击页面 edit 按钮,提交 pr 进行更改。此 PDF 版本号是 V1.5.20。PDF 永久更新地址是 https://github.com/halfrost/LeetCode-Go/releases/,以版本号区分不同版本。笔者还是强烈推荐看在线版,有任何错误都会立即更新。如果觉得此书对刷题有一点点帮助,可以给此书点一个 star,鼓励一下笔者早点更新更多题解。 +此版本是 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 。 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/mdrow.go b/ctl/models/mdrow.go index 338ce2ee2..5ad90ec0e 100644 --- a/ctl/models/mdrow.go +++ b/ctl/models/mdrow.go @@ -29,7 +29,7 @@ func GenerateMdRows(solutionIds []int, mdrows []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)), + 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, @@ -52,7 +52,7 @@ func GenerateMdRows(solutionIds []int, mdrows []Mdrow) { // 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 | | +// | 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) } diff --git a/ctl/models/tagproblem.go b/ctl/models/tagproblem.go index 13a4409e3..5bc04ab8c 100644 --- a/ctl/models/tagproblem.go +++ b/ctl/models/tagproblem.go @@ -180,8 +180,8 @@ type TagLists struct { TagLists []TagList } -//| No. | Title | Solution | Difficulty | TimeComplexity | SpaceComplexity |Favorite| Acceptance | -//|:--------:|:------- | :--------: | :----------: | :----: | :-----: | :-----: |:-----: | +// | 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" diff --git a/ctl/pdf.go b/ctl/pdf.go index 342829565..d481df4c5 100644 --- a/ctl/pdf.go +++ b/ctl/pdf.go @@ -3,14 +3,15 @@ package main import ( "bufio" "fmt" - "github.com/halfrost/LeetCode-Go/ctl/util" - "github.com/spf13/cobra" "io" "io/ioutil" "os" "regexp" "strconv" "strings" + + "github.com/halfrost/LeetCode-Go/ctl/util" + "github.com/spf13/cobra" ) var ( @@ -23,7 +24,7 @@ var ( # 说明 -此版本是 https://books.halfrost.com/leetcode 网页的离线版,由于网页版实时会更新,所以此 PDF 版难免会有一些排版或者错别字。如果读者遇到了,可以到网页版相应页面,点击页面 edit 按钮,提交 pr 进行更改。此 PDF 版本号是 V%v.%v.%v。PDF 永久更新地址是 https://github.com/halfrost/LeetCode-Go/releases/,以版本号区分不同版本。笔者还是强烈推荐看在线版,有任何错误都会立即更新。如果觉得此书对刷题有一点点帮助,可以给此书点一个 star,鼓励一下笔者早点更新更多题解。 +此版本是 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 。 diff --git a/ctl/render.go b/ctl/render.go index a8cc6b85b..3e62a36eb 100644 --- a/ctl/render.go +++ b/ctl/render.go @@ -163,7 +163,8 @@ func renderReadme(filePath string, total, try int, mdrows, omdrows m.Mdrows, use } // internal: true 渲染的链接都是 hugo 内部链接,用户生成 hugo web -// false 渲染的链接是外部 HTTPS 链接,用于生成 PDF +// +// false 渲染的链接是外部 HTTPS 链接,用于生成 PDF func buildChapterTwo(internal bool) { var ( gr m.GraphQLResp diff --git a/ctl/request.go b/ctl/request.go index 056d5e141..8222a1fc0 100644 --- a/ctl/request.go +++ b/ctl/request.go @@ -3,9 +3,10 @@ package main import ( "bytes" "fmt" - "github.com/mozillazg/request" "io/ioutil" "net/http" + + "github.com/mozillazg/request" ) const ( diff --git a/ctl/statistic.go b/ctl/statistic.go index c796dc44e..20b84ccb9 100644 --- a/ctl/statistic.go +++ b/ctl/statistic.go @@ -1,9 +1,10 @@ package main import ( + "sort" + m "github.com/halfrost/LeetCode-Go/ctl/models" "github.com/halfrost/LeetCode-Go/ctl/util" - "sort" ) func statisticalData(problemsMap map[int]m.StatStatusPairs, solutionIds []int) (easyTotal, mediumTotal, hardTotal, optimizingEasy, optimizingMedium, optimizingHard int32, optimizingIds []int) { diff --git a/ctl/template/template.markdown b/ctl/template/template.markdown index 089c448a2..c0b24343e 100644 --- a/ctl/template/template.markdown +++ b/ctl/template/template.markdown @@ -10,9 +10,9 @@ ![](./website/static/wechat-qr-code.png)

-GitHub All Releases +GitHub All Releases - + @@ -23,7 +23,7 @@

-GitHub +GitHub @@ -32,7 +32,7 @@ - +

支持 Progressive Web Apps 和 Dark Mode 的题解电子书《LeetCode Cookbook》 Online Reading @@ -42,10 +42,10 @@

-离线版本的电子书《LeetCode Cookbook》PDF Download here +离线版本的电子书《LeetCode Cookbook》PDF Download here

- +

通过 iOS / Android 浏览器安装 PWA 版《LeetCode Cookbook》至设备桌面随时学习 @@ -550,7 +550,7 @@ Problems List in [there](https://books.halfrost.com/leetcode/ChapterTwo/Bit_Mani ![](./topic/Union_Find.png) -- 灵活使用并查集的思想,熟练掌握并查集的[模板](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。 +- 灵活使用并查集的思想,熟练掌握并查集的[模板](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 题。 @@ -630,10 +630,10 @@ Problems List in [there](https://books.halfrost.com/leetcode/ChapterTwo/Binary_I ----------------------------------------------------------------------------------------

- +

-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/) +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/) diff --git a/ctl/template_render.go b/ctl/template_render.go index 374b36f8c..01c65f28f 100644 --- a/ctl/template_render.go +++ b/ctl/template_render.go @@ -3,11 +3,12 @@ package main import ( "bytes" "fmt" - m "github.com/halfrost/LeetCode-Go/ctl/models" - "github.com/halfrost/LeetCode-Go/ctl/util" "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) { 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/go.mod b/go.mod index 8fdb4bcec..3b163f0e1 100644 --- a/go.mod +++ b/go.mod @@ -1,13 +1,30 @@ module github.com/halfrost/LeetCode-Go -go 1.15 +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/BurntSushi/toml v0.3.1 github.com/bitly/go-simplejson v0.5.0 // indirect github.com/bmizerany/assert v0.0.0-20160611221934-b7ed37b82869 // indirect - github.com/mozillazg/request v0.8.0 - github.com/spf13/cobra v1.1.1 - github.com/stretchr/testify v1.3.0 - golang.org/x/net v0.0.0-20201021035429-f5854403a974 // 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 index 0fbb291ac..d1e5e64b1 100644 --- a/go.sum +++ b/go.sum @@ -1,303 +1,36 @@ -cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= -cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= -cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU= -cloud.google.com/go v0.44.1/go.mod h1:iSa0KzasP4Uvy3f1mN/7PiObzGgflwredwwASm/v6AU= -cloud.google.com/go v0.44.2/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY= -cloud.google.com/go v0.45.1/go.mod h1:RpBamKRgapWJb87xiFSdk4g1CME7QZg3uwTez+TSTjc= -cloud.google.com/go v0.46.3/go.mod h1:a6bKKbmY7er1mI7TEI4lsAkts/mkhTSZK8w33B4RAg0= -cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o= -cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE= -cloud.google.com/go/firestore v1.1.0/go.mod h1:ulACoGHTpvq5r8rxGJ4ddJZBZqakUQqClKRT5SZwBmk= -cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2kNxGRt3I= -cloud.google.com/go/storage v1.0.0/go.mod h1:IhtSnM/ZTZV8YYJWCY8RULGVqBDmpoyjwiyrjsg+URw= -dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= -github.com/BurntSushi/toml v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ= -github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= -github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= -github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= -github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= -github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= -github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o= -github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmVTwzkszR9V5SSuryQ31EELlFMUz1kKyl939pY= -github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= -github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= -github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= -github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= +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/bketelsen/crypt v0.0.3-0.20200106085610-5cbc8cc4026c/go.mod h1:MKsuJmJgSg28kpZDP6UIiPt0e0Oz0kqKNGyRaWEPv84= 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/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= -github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= -github.com/coreos/bbolt v1.3.2/go.mod h1:iRUV2dpdMOn7Bo10OQBFzIJO9kkE559Wcmn+qkEiiKk= -github.com/coreos/etcd v3.3.13+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= -github.com/coreos/go-semver v0.3.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= -github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= -github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= -github.com/cpuguy83/go-md2man/v2 v2.0.0/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= -github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +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/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= -github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954/go.mod h1:vAd38F8PWV+bWy6jNmig1y/TA+kYO4g3RSRF0IAv0no= -github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= -github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= -github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= -github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= -github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= -github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= -github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk= -github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= -github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= -github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zVXpSg4= -github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= -github.com/golang/groupcache v0.0.0-20190129154638-5b532d6fd5ef/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= -github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= -github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= -github.com/golang/mock v1.3.1/go.mod h1:sBzyDLLjw3U8JLTeZvSv8jJB+tU5PVekmnlKIyFUx0Y= -github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= -github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= -github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= -github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= -github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= -github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= -github.com/google/pprof v0.0.0-20190515194954-54271f7e092f/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= -github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= -github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= -github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= -github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= -github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= -github.com/grpc-ecosystem/go-grpc-middleware v1.0.0/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs= -github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk= -github.com/grpc-ecosystem/grpc-gateway v1.9.0/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= -github.com/hashicorp/consul/api v1.1.0/go.mod h1:VmuI/Lkw1nC05EYQWNKwWGbkg+FbDBtguAZLlVdkD9Q= -github.com/hashicorp/consul/sdk v0.1.1/go.mod h1:VKf9jXwCTEY1QZP2MOLRhb5i/I/ssyNV1vwHyQBF0x8= -github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= -github.com/hashicorp/go-cleanhttp v0.5.1/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= -github.com/hashicorp/go-immutable-radix v1.0.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= -github.com/hashicorp/go-msgpack v0.5.3/go.mod h1:ahLV/dePpqEmjfWmKiqvPkv/twdG7iPBM1vqhUKIvfM= -github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk= -github.com/hashicorp/go-rootcerts v1.0.0/go.mod h1:K6zTfqpRlCUIjkwsN4Z+hiSfzSTQa6eBIzfwKfwNnHU= -github.com/hashicorp/go-sockaddr v1.0.0/go.mod h1:7Xibr9yA9JjQq1JpNB2Vw7kxv8xerXegt+ozgdvDeDU= -github.com/hashicorp/go-syslog v1.0.0/go.mod h1:qPfqrKkXGihmCqbJM2mZgkZGvKG1dFdvsLplgctolz4= -github.com/hashicorp/go-uuid v1.0.0/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= -github.com/hashicorp/go-uuid v1.0.1/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= -github.com/hashicorp/go.net v0.0.1/go.mod h1:hjKkEWcCURg++eb33jQU7oqQcI9XDCnUzHA0oac0k90= -github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= -github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= -github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= -github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO+LraFDTW64= -github.com/hashicorp/mdns v1.0.0/go.mod h1:tL+uN++7HEJ6SQLQ2/p+z2pH24WQKWjBPkE0mNTz8vQ= -github.com/hashicorp/memberlist v0.1.3/go.mod h1:ajVTdAv/9Im8oMAAj5G31PhhMCZJV2pPBoIllUwCN7I= -github.com/hashicorp/serf v0.8.2/go.mod h1:6hOLApaqBFA1NXqRQAsxw9QxuDEvNxSQRwA/JwenrHc= github.com/inconshreveable/mousetrap v1.0.0 h1:Z8tu5sraLXCXIcARxBp/8cbvlwVa7Z1NHg9XEKhtSvM= github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= -github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo= -github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= -github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= -github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= -github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= -github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q= -github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= -github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= -github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= -github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI= 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 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= -github.com/magiconair/properties v1.8.1/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= -github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= -github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= -github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= -github.com/miekg/dns v1.0.14/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= -github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc= -github.com/mitchellh/go-homedir v1.0.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= -github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= -github.com/mitchellh/go-testing-interface v1.0.0/go.mod h1:kRemZodwjscx+RGhAo8eIhFbs2+BFgRtFPeD/KE+zxI= -github.com/mitchellh/gox v0.4.0/go.mod h1:Sd9lOJ0+aimLBi73mGofS1ycjY8lL3uZM3JPS42BGNg= -github.com/mitchellh/iochan v1.0.0/go.mod h1:JwYml1nuB7xOzsp52dPpHFffvOCDupsG0QubkSMEySY= -github.com/mitchellh/mapstructure v0.0.0-20160808181253-ca63d7c062ee/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= -github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= -github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= -github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= +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/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= -github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U= -github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= -github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= -github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= -github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= -github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndrE9hABlRI= -github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= -github.com/prometheus/client_golang v0.9.3/go.mod h1:/TN21ttK/J9q6uSwhBd54HahCDft0ttaMvbicHlPoso= -github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= -github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= -github.com/prometheus/common v0.0.0-20181113130724-41aa239b4cce/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro= -github.com/prometheus/common v0.4.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= -github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= -github.com/prometheus/procfs v0.0.0-20190507164030-5867b95ac084/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= -github.com/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40TwIPHuXU= -github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg= -github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= -github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= -github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= -github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc= -github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= -github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= -github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= -github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= -github.com/soheilhy/cmux v0.1.4/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4kGIyLM= -github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= -github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ= -github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= -github.com/spf13/cobra v1.1.1 h1:KfztREH0tPxJJ+geloSLaAkaPkr4ki2Er5quFV1TDo4= -github.com/spf13/cobra v1.1.1/go.mod h1:WnodtKOvamDL/PwE2M4iKs8aMDBZ5Q5klgD3qfVJQMI= -github.com/spf13/jwalterweatherman v1.0.0/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo= -github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= +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/spf13/viper v1.7.0/go.mod h1:8WkrPz2fc9jxqZNCJI/76HCieCp4Q8HaLFoCha5qpdg= -github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= -github.com/stretchr/testify v1.3.0 h1:TivCn/peBQ7UY8ooIcPgZFpTNSz0Q2U6UrFlUfqbe0Q= -github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= -github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw= -github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= -github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU= -go.etcd.io/bbolt v1.3.2/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= -go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= -go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= -go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= -go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= -go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= -golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= -golang.org/x/crypto v0.0.0-20181029021203-45a5f77698d3/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= -golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= -golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= -golang.org/x/exp v0.0.0-20190829153037-c13cbed26979/go.mod h1:86+5VVa7VpoJ4kLfm080zCjGlMRFzhUhsZKEZO7MGek= -golang.org/x/exp v0.0.0-20191030013958-a1ab85dbe136/go.mod h1:JXzH8nQsPlswgeRAPE3MuO9GYsAcnJvJ4vnMwN/5qkY= -golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= -golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= -golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= -golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= -golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= -golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= -golang.org/x/lint v0.0.0-20190409202823-959b441ac422/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= -golang.org/x/lint v0.0.0-20190909230951-414d861bb4ac/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= -golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= -golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE= -golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o= -golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc= -golang.org/x/mod v0.1.0/go.mod h1:0QHyrYULN0/3qlju5TqG8bIK38QM8yzMo5ekMj3DlcY= -golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20181023162649-9b4f9f5ad519/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20181201002055-351d144fa1fc/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20181220203305-927f97764cc3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190501004415-9ce7a6920f09/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= -golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20201021035429-f5854403a974 h1:IX6qOQeG5uLjB/hjjwjedwfjND0hgjPMMyO1RoIXQNI= -golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= -golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= -golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= -golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20181026203630-95b1ffbd15a5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20181107165924-66b7b1311ac8/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= -golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= -golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190312151545-0bb0c0a6e846/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190328211700-ab21143f2384/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190425150028-36563e24a262/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= -golang.org/x/tools v0.0.0-20190506145303-2d16b83fe98c/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= -golang.org/x/tools v0.0.0-20190606124116-d0a3d012864b/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= -golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= -golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= -golang.org/x/tools v0.0.0-20190816200558-6889da9d5479/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20190911174233-4f2ddba30aff/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191012152004-8de300cfc20a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191112195655-aa38f8e97acc/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= -google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M= -google.golang.org/api v0.8.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= -google.golang.org/api v0.9.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= -google.golang.org/api v0.13.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= -google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= -google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= -google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= -google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0= -google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= -google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= -google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= -google.golang.org/genproto v0.0.0-20190425155659-357c62f0e4bb/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= -google.golang.org/genproto v0.0.0-20190502173448-54afdca5d873/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= -google.golang.org/genproto v0.0.0-20190801165951-fa694d86fc64/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= -google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= -google.golang.org/genproto v0.0.0-20190911173649-1774047e7e51/go.mod h1:IbNlFCBrqXvoKpeg0TB2l7cyZUmoaFKYIwrEpbDKLA8= -google.golang.org/genproto v0.0.0-20191108220845-16a3f7862a1a/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= -google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= -google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= -gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= +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/ini.v1 v1.51.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= -gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo= -gopkg.in/yaml.v2 v2.0.0-20170812160011-eb3733d160e7/go.mod h1:JAlM8MvJe8wmxCU4Bli9HhUf9+ttbYbLASfIpnQbh74= -gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= -rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= +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/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/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.Implement-strStr/README.md b/leetcode/0028.Find-the-Index-of-the-First-Occurrence-in-a-String/README.md similarity index 85% rename from leetcode/0028.Implement-strStr/README.md rename to leetcode/0028.Find-the-Index-of-the-First-Occurrence-in-a-String/README.md index 5fb575296..d1e643bd9 100644 --- a/leetcode/0028.Implement-strStr/README.md +++ b/leetcode/0028.Find-the-Index-of-the-First-Occurrence-in-a-String/README.md @@ -1,4 +1,4 @@ -# [28. Implement strStr()](https://leetcode.com/problems/implement-strstr/) +# [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/) ## 题目 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/0066.Plus-One/66. Plus One.go b/leetcode/0066.Plus-One/66. Plus One.go index a396cf45f..9a58ea973 100644 --- a/leetcode/0066.Plus-One/66. Plus One.go +++ b/leetcode/0066.Plus-One/66. Plus One.go @@ -2,16 +2,11 @@ package leetcode func plusOne(digits []int) []int { for i := len(digits) - 1; i >= 0; i-- { - digits[i]++ - if digits[i] != 10 { - // no carry + if digits[i] != 9 { + digits[i]++ return digits } - // carry digits[i] = 0 } - // all carry - digits[0] = 1 - digits = append(digits, 0) - return digits + return append([]int{1}, digits...) } diff --git a/leetcode/0098.Validate-Binary-Search-Tree/98. Validate Binary Search Tree.go b/leetcode/0098.Validate-Binary-Search-Tree/98. Validate Binary Search Tree.go index 801e8ff53..1a4d530b9 100644 --- a/leetcode/0098.Validate-Binary-Search-Tree/98. Validate Binary Search Tree.go +++ b/leetcode/0098.Validate-Binary-Search-Tree/98. Validate Binary Search Tree.go @@ -1,8 +1,8 @@ package leetcode -import "math" - import ( + "math" + "github.com/halfrost/LeetCode-Go/structures" ) diff --git a/leetcode/0114.Flatten-Binary-Tree-to-Linked-List/114. Flatten Binary Tree to Linked List.go b/leetcode/0114.Flatten-Binary-Tree-to-Linked-List/114. Flatten Binary Tree to Linked List.go index 5fe89309d..74860eae8 100644 --- a/leetcode/0114.Flatten-Binary-Tree-to-Linked-List/114. Flatten Binary Tree to Linked List.go +++ b/leetcode/0114.Flatten-Binary-Tree-to-Linked-List/114. Flatten Binary Tree to Linked List.go @@ -18,23 +18,21 @@ type TreeNode = structures.TreeNode // 解法一 非递归 func flatten(root *TreeNode) { - list, cur := []int{}, &TreeNode{} - preorder(root, &list) - cur = root + list := preorder(root) for i := 1; i < len(list); i++ { - cur.Left = nil - cur.Right = &TreeNode{Val: list[i], Left: nil, Right: nil} - cur = cur.Right + prev, cur := list[i-1], list[i] + prev.Left, prev.Right = nil, cur } return } -func preorder(root *TreeNode, output *[]int) { +func preorder(root *TreeNode) (ans []*TreeNode) { if root != nil { - *output = append(*output, root.Val) - preorder(root.Left, output) - preorder(root.Right, output) + ans = append(ans, root) + ans = append(ans, preorder(root.Left)...) + ans = append(ans, preorder(root.Right)...) } + return } // 解法二 递归 diff --git a/leetcode/0114.Flatten-Binary-Tree-to-Linked-List/114. Flatten Binary Tree to Linked List_test.go b/leetcode/0114.Flatten-Binary-Tree-to-Linked-List/114. Flatten Binary Tree to Linked List_test.go index 299093969..aa20ab605 100644 --- a/leetcode/0114.Flatten-Binary-Tree-to-Linked-List/114. Flatten Binary Tree to Linked List_test.go +++ b/leetcode/0114.Flatten-Binary-Tree-to-Linked-List/114. Flatten Binary Tree to Linked List_test.go @@ -15,13 +15,13 @@ type question114 struct { // para 是参数 // one 代表第一个参数 type para114 struct { - one []int + one []string } // ans 是答案 // one 代表第一个答案 type ans114 struct { - one []int + one []string } func Test_Problem114(t *testing.T) { @@ -29,8 +29,18 @@ func Test_Problem114(t *testing.T) { qs := []question114{ { - para114{[]int{1, 2, 3, 4, 5, 6}}, - ans114{[]int{1, 2, 3, 4, 5, 6}}, + para114{[]string{"1", "2", "5", "3", "4", "null", "6"}}, + ans114{[]string{"1", "null", "2", "null", "3", "null", "4", "null", "5", "null", "6"}}, + }, + + { + para114{[]string{"0"}}, + ans114{[]string{"0"}}, + }, + + { + para114{[]string{"1", "2", "3", "4", "5", "6"}}, + ans114{[]string{"1", "2", "4", "5", "3", "6", "null"}}, }, } @@ -39,9 +49,10 @@ func Test_Problem114(t *testing.T) { for _, q := range qs { _, p := q.ans114, q.para114 fmt.Printf("【input】:%v \n", p) - rootOne := structures.Ints2TreeNode(p.one) + rootOne := structures.Strings2TreeNode(p.one) flatten(rootOne) - fmt.Printf("【output】:%v \n", structures.Tree2Preorder(rootOne)) + fmt.Printf("【levelorder output】:%v \n", structures.Tree2LevelOrderStrings(rootOne)) + fmt.Printf("【preorder output】:%v \n", structures.Tree2PreOrderStrings(rootOne)) } fmt.Printf("\n\n\n") } diff --git a/leetcode/0116.Populating-Next-Right-Pointers-in-Each-Node/116.Populating Next Right Pointers in Each Node.go b/leetcode/0116.Populating-Next-Right-Pointers-in-Each-Node/116.Populating Next Right Pointers in Each Node.go index fdaa074c4..4587c39d5 100644 --- a/leetcode/0116.Populating-Next-Right-Pointers-in-Each-Node/116.Populating Next Right Pointers in Each Node.go +++ b/leetcode/0116.Populating-Next-Right-Pointers-in-Each-Node/116.Populating Next Right Pointers in Each Node.go @@ -7,7 +7,7 @@ type Node struct { Next *Node } -//解法一:迭代 +// 解法一:迭代 func connect(root *Node) *Node { if root == nil { return root diff --git a/leetcode/0116.Populating-Next-Right-Pointers-in-Each-Node/116.Populating Next Right Pointers in Each Node_test.go b/leetcode/0116.Populating-Next-Right-Pointers-in-Each-Node/116.Populating Next Right Pointers in Each Node_test.go index c156db296..6146f1579 100644 --- a/leetcode/0116.Populating-Next-Right-Pointers-in-Each-Node/116.Populating Next Right Pointers in Each Node_test.go +++ b/leetcode/0116.Populating-Next-Right-Pointers-in-Each-Node/116.Populating Next Right Pointers in Each Node_test.go @@ -22,7 +22,7 @@ type ans116 struct { one *Node } -func newQuestionNode()*Node{ +func newQuestionNode() *Node { node7 := &Node{} node7.Val = 7 @@ -55,7 +55,7 @@ func newQuestionNode()*Node{ return node1 } -func newResultNode()*Node{ +func newResultNode() *Node { node7 := &Node{} node7.Val = 7 @@ -114,4 +114,4 @@ func Test_Problem116(t *testing.T) { fmt.Printf("【output】:%v \n", connect(p.one)) } fmt.Printf("\n\n\n") -} \ No newline at end of file +} diff --git a/leetcode/0118.Pascals-Triangle/118. Pascal's Triangle.go b/leetcode/0118.Pascals-Triangle/118. Pascals Triangle.go similarity index 100% rename from leetcode/0118.Pascals-Triangle/118. Pascal's Triangle.go rename to leetcode/0118.Pascals-Triangle/118. Pascals Triangle.go diff --git a/leetcode/0118.Pascals-Triangle/118. Pascal's Triangle_test.go b/leetcode/0118.Pascals-Triangle/118. Pascals Triangle_test.go similarity index 100% rename from leetcode/0118.Pascals-Triangle/118. Pascal's Triangle_test.go rename to leetcode/0118.Pascals-Triangle/118. Pascals Triangle_test.go diff --git a/leetcode/0119.Pascals-Triangle-II/119. Pascal's Triangle II.go b/leetcode/0119.Pascals-Triangle-II/119. Pascals Triangle II.go similarity index 100% rename from leetcode/0119.Pascals-Triangle-II/119. Pascal's Triangle II.go rename to leetcode/0119.Pascals-Triangle-II/119. Pascals Triangle II.go diff --git a/leetcode/0119.Pascals-Triangle-II/119. Pascal's Triangle II_test.go b/leetcode/0119.Pascals-Triangle-II/119. Pascals Triangle II_test.go similarity index 100% rename from leetcode/0119.Pascals-Triangle-II/119. Pascal's Triangle II_test.go rename to leetcode/0119.Pascals-Triangle-II/119. Pascals Triangle II_test.go diff --git a/leetcode/0124.Binary-Tree-Maximum-Path-Sum/124. Binary Tree Maximum Path Sum.go b/leetcode/0124.Binary-Tree-Maximum-Path-Sum/124. Binary Tree Maximum Path Sum.go index dc7a75e4b..058193b7b 100644 --- a/leetcode/0124.Binary-Tree-Maximum-Path-Sum/124. Binary Tree Maximum Path Sum.go +++ b/leetcode/0124.Binary-Tree-Maximum-Path-Sum/124. Binary Tree Maximum Path Sum.go @@ -1,8 +1,8 @@ package leetcode -import "math" - import ( + "math" + "github.com/halfrost/LeetCode-Go/structures" ) diff --git a/leetcode/0134.Gas-Station/Gas.go b/leetcode/0134.Gas-Station/Gas.go new file mode 100644 index 000000000..4277a791c --- /dev/null +++ b/leetcode/0134.Gas-Station/Gas.go @@ -0,0 +1,26 @@ +package leetcode + +func canCompleteCircuit(gas []int, cost []int) int { + totalGas := 0 + totalCost := 0 + currGas := 0 + start := 0 + + for i := 0; i < len(gas); i++ { + totalGas += gas[i] + totalCost += cost[i] + currGas += gas[i] - cost[i] + + if currGas < 0 { + start = i + 1 + currGas = 0 + } + } + + if totalGas < totalCost { + return -1 + } + + return start + +} diff --git a/leetcode/0134.Gas-Station/Gas_test.go b/leetcode/0134.Gas-Station/Gas_test.go new file mode 100644 index 000000000..f6c2a7893 --- /dev/null +++ b/leetcode/0134.Gas-Station/Gas_test.go @@ -0,0 +1,47 @@ +package leetcode + +import ( + "fmt" + "testing" +) + +type question134 struct { + para134 + ans134 +} + +// para 是参数 +// one 代表第一个参数 +type para134 struct { + one []int + two []int +} + +// ans 是答案 +// one 代表第一个答案 +type ans134 struct { + one int +} + +func Test_Problem134(t *testing.T) { + qs := []question134{ + + { + para134{[]int{1, 2, 3, 4, 5}, []int{3, 4, 5, 1, 2}}, + ans134{3}, + }, + + { + para134{[]int{2, 3, 4}, []int{3, 4, 3}}, + ans134{-1}, + }, + } + + fmt.Printf("------------------------Leetcode Problem 134------------------------\n") + + for _, q := range qs { + _, p := q.ans134, q.para134 + fmt.Printf("【input】:%v, %v 【output】:%v\n", p.one, p.two, canCompleteCircuit(p.one, p.two)) + } + fmt.Printf("\n\n\n") +} diff --git a/leetcode/0134.Gas-Station/README.md b/leetcode/0134.Gas-Station/README.md new file mode 100644 index 000000000..e4cb07821 --- /dev/null +++ b/leetcode/0134.Gas-Station/README.md @@ -0,0 +1,88 @@ +# [134. Gas Stations](https://leetcode.com/problems/gas-station/) + + +## 题目 + +You are given a list of gas stations on a circular route, where the amount of gas at station i is gas[i], and the cost to travel from station i to its next station (i+1) is cost[i]. You have a car with an unlimited gas tank and it costs cost[i] of gas to travel from station i to its next station (i+1). You begin the journey with an empty tank at one of the gas stations. + +Write a function that returns the starting gas station's index if you can travel around the circuit once in the clockwise direction, otherwise return -1. If there exists a solution, it is guaranteed to be unique. + +**Example 1:** + +``` +Input: gas = [1,2,3,4,5], cost = [3,4,5,1,2] +Output: 3 +Explanation: Start at station 3 (index 3), you have 4 liters of gas. Now you have a total of =0+4=4 liters of gas. +Travel to station 4. Now you have 4 - 1 + 5 = 8 liters of gas. +Travel to station 0. Now you have 8 - 2 + 1 = 7 liters of gas. +Travel to station 1. Now you have 7 - 3 + 2 = 6 liters of gas. +Travel to station 2. Now you have 6 - 4 + 3 = 5 liters of gas. +Travel to station 3 again. This time you will have consumed 5 liters of gas, which is exactly enough for you to return to station 3. +Therefore, 3 can be the starting index. +``` + +**Example 2:** + +``` +Input: gas = [2,3,4], cost = [3,4,3] +Output: -1 +Explanation: You cannot start at station 0 or 1 because there is not enough gas to get you to the next station. +We start at station 2, we get 4 liters of gas. Now you have a total of =0+4=4 liters of gas. +Travel to station 0. Now you have 4 - 3 + 2 = 3 liters of gas. +Travel to station 1. Now you have 3 - 3 + 3 = 3 liters of gas. +You cannot return to station 2 because it requires 4 liters of gas but you only have 3 liters in your tank. +Therefore, no matter what, you cannot travel around the ring. +``` + +**Constraints:** + +- `gas.length == n` +- `cost.length == n` +- `1 <= n <= 10^5` +- `0 <= gas[i], cost[i] <= 10^4` + +## 题目大意 + +在一条环路上有 n 个加油站,其中第 i 个加油站有汽油 gas[i] 升。 + +你有一辆油箱容量无限的的汽车,从第 i 个加油站开往第 i+1 个加油站需要消耗汽油 cost[i] 升。你从其中的一个加油站出发,开始时油箱为空。 + +给定两个整数数组 gas 和 cost ,如果你可以按顺序绕环路行驶一周,则返回出发时加油站的编号,否则返回 -1 。如果存在解,则 保证 它是 唯一 的。 + +## 解题思路 + +- 初始化总油量(totalGas)和总消耗(totalCost)为0,起始点(start)为0,当前油量(currGas)为0。 + 遍历每个加油站,累加油量和消耗,计算当前油量。 + 如果当前油量小于0,说明从上一个加油站到当前加油站的油量不足以到达下一个加油站,因此将起始点设置为当前加油站的下一个位置,并将当前油量重置为0。 + 遍历结束后,如果总油量小于总消耗,说明无法完成整个旅程,返回-1;否则返回起始点。 + +## 代码 + +```go +package leetcode + +func canCompleteCircuit(gas []int, cost []int) int { + totalGas := 0 + totalCost := 0 + currGas := 0 + start := 0 + + for i := 0; i < len(gas); i++ { + totalGas += gas[i] + totalCost += cost[i] + currGas += gas[i] - cost[i] + + if currGas < 0 { + start = i + 1 + currGas = 0 + } + } + + if totalGas < totalCost { + return -1 + } + + return start +} + +``` \ No newline at end of file diff --git a/leetcode/0143.Reorder-List/README.md b/leetcode/0143.Reorder-List/README.md index 4df8c7ff4..0e0915d02 100644 --- a/leetcode/0143.Reorder-List/README.md +++ b/leetcode/0143.Reorder-List/README.md @@ -31,4 +31,4 @@ Given 1->2->3->4->5, reorder it to 1->5->2->4->3. 更好的做法是结合之前几道题的操作:链表逆序,找中间结点。 -先找到链表的中间结点,然后利用逆序区间的操作,如 [第 92 题](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0092.Reverse-Linked-List-II) 里的 reverseBetween() 操作,只不过这里的反转区间是从中点一直到末尾。最后利用 2 个指针,一个指向头结点,一个指向中间结点,开始拼接最终的结果。这种做法的时间复杂度是 O(n),空间复杂度是 O(1)。 \ No newline at end of file +先找到链表的中间结点,然后利用逆序区间的操作,如 [第 92 题](https://github.com/halfrost/leetcode-go/tree/master/leetcode/0092.Reverse-Linked-List-II) 里的 reverseBetween() 操作,只不过这里的反转区间是从中点一直到末尾。最后利用 2 个指针,一个指向头结点,一个指向中间结点,开始拼接最终的结果。这种做法的时间复杂度是 O(n),空间复杂度是 O(1)。 \ No newline at end of file diff --git a/leetcode/0160.Intersection-of-Two-Linked-Lists/160. Intersection of Two Linked Lists.go b/leetcode/0160.Intersection-of-Two-Linked-Lists/160. Intersection of Two Linked Lists.go index 93d68a224..b7b2ee342 100644 --- a/leetcode/0160.Intersection-of-Two-Linked-Lists/160. Intersection of Two Linked Lists.go +++ b/leetcode/0160.Intersection-of-Two-Linked-Lists/160. Intersection of Two Linked Lists.go @@ -1,8 +1,8 @@ package leetcode -import "fmt" - import ( + "fmt" + "github.com/halfrost/LeetCode-Go/structures" ) diff --git a/leetcode/0190.Reverse-Bits/190. Reverse Bits_test.go b/leetcode/0190.Reverse-Bits/190. Reverse Bits_test.go index 20c677d65..12c5c23d5 100644 --- a/leetcode/0190.Reverse-Bits/190. Reverse Bits_test.go +++ b/leetcode/0190.Reverse-Bits/190. Reverse Bits_test.go @@ -2,6 +2,7 @@ package leetcode import ( "fmt" + "strconv" "testing" ) @@ -23,7 +24,6 @@ type ans190 struct { } func Test_Problem190(t *testing.T) { - qs := []question190{ { @@ -41,7 +41,12 @@ func Test_Problem190(t *testing.T) { for _, q := range qs { _, p := q.ans190, q.para190 - fmt.Printf("【input】:%v 【output】:%v\n", p, reverseBits(p.one)) + input := strconv.FormatUint(uint64(p.one), 2) // 32位无符号整数转换为二进制字符串 + input = fmt.Sprintf("%0*v", 32, input) // 格式化输出32位,保留前置0 + output := reverseBits(p.one) + outputBin := strconv.FormatUint(uint64(output), 2) // 32位无符号整数转换为二进制字符串 + outputBin = fmt.Sprintf("%0*v", 32, outputBin) // 格式化输出32位,保留前置0 + fmt.Printf("【input】:%v 【output】:%v (%v)\n", input, output, outputBin) } fmt.Printf("\n\n\n") } diff --git a/leetcode/0191.Number-of-1-Bits/191. Number of 1 Bits_test.go b/leetcode/0191.Number-of-1-Bits/191. Number of 1 Bits_test.go index f327977c6..ac789e86e 100644 --- a/leetcode/0191.Number-of-1-Bits/191. Number of 1 Bits_test.go +++ b/leetcode/0191.Number-of-1-Bits/191. Number of 1 Bits_test.go @@ -2,6 +2,7 @@ package leetcode import ( "fmt" + "strconv" "testing" ) @@ -40,7 +41,9 @@ func Test_Problem191(t *testing.T) { for _, q := range qs { _, p := q.ans191, q.para191 - fmt.Printf("【input】:%v 【output】:%v\n", p, hammingWeight(p.one)) + input := strconv.FormatUint(uint64(p.one), 2) // 32位无符号整数转换为二进制字符串 + input = fmt.Sprintf("%0*v", 32, input) // 格式化输出32位,保留前置0 + fmt.Printf("【input】:%v 【output】:%v\n", input, hammingWeight(p.one)) } fmt.Printf("\n\n\n") } diff --git a/leetcode/0215.Kth-Largest-Element-in-an-Array/README.md b/leetcode/0215.Kth-Largest-Element-in-an-Array/README.md index 63506d275..b3a2d21f3 100644 --- a/leetcode/0215.Kth-Largest-Element-in-an-Array/README.md +++ b/leetcode/0215.Kth-Largest-Element-in-an-Array/README.md @@ -29,5 +29,5 @@ You may assume k is always valid, 1 ≤ k ≤ array's length. ## 解题思路 -在快排的 partition 操作中,每次 partition 操作结束都会返回一个点,这个标定点的下标和最终排序之后有序数组中这个元素所在的下标是一致的。利用这个特性,我们可以不断的划分数组区间,最终找到第 K 大的元素。执行一次 partition 操作以后,如果这个元素的下标比 K 小,那么接着就在后边的区间继续执行 partition 操作;如果这个元素的下标比 K 大,那么就在左边的区间继续执行 partition 操作;如果相等就直接输出这个下标对应的数组元素即可。 +在快速选择 quickselect 的 partition 操作中,每次 partition 操作结束都会返回一个点,这个标定点的下标和最终排序之后有序数组中这个元素所在的下标是一致的。利用这个特性,我们可以不断的划分数组区间,最终找到第 K 大的元素。执行一次 partition 操作以后,如果这个元素的下标比 K 小,那么接着就在后边的区间继续执行 partition 操作;如果这个元素的下标比 K 大,那么就在左边的区间继续执行 partition 操作;如果相等就直接输出这个下标对应的数组元素即可。 diff --git a/leetcode/0257.Binary-Tree-Paths/257. Binary Tree Paths.go b/leetcode/0257.Binary-Tree-Paths/257. Binary Tree Paths.go index 4640cf7f6..0759ad1cc 100644 --- a/leetcode/0257.Binary-Tree-Paths/257. Binary Tree Paths.go +++ b/leetcode/0257.Binary-Tree-Paths/257. Binary Tree Paths.go @@ -2,9 +2,7 @@ package leetcode import ( "strconv" -) -import ( "github.com/halfrost/LeetCode-Go/structures" ) diff --git a/leetcode/0297.Serialize-and-Deserialize-Binary-Tree/297.Serialize and Deserialize Binary Tree_test.go b/leetcode/0297.Serialize-and-Deserialize-Binary-Tree/297.Serialize and Deserialize Binary Tree_test.go index 6069704e2..cf7031c4a 100644 --- a/leetcode/0297.Serialize-and-Deserialize-Binary-Tree/297.Serialize and Deserialize Binary Tree_test.go +++ b/leetcode/0297.Serialize-and-Deserialize-Binary-Tree/297.Serialize and Deserialize Binary Tree_test.go @@ -31,12 +31,12 @@ func Test_Problem297(t *testing.T) { ans297{[]int{}}, }, { - para297{[]int{1,2,3,-1,-1,4,5}}, - ans297{[]int{1,2,3,-1,-1,4,5}}, + para297{[]int{1, 2, 3, -1, -1, 4, 5}}, + ans297{[]int{1, 2, 3, -1, -1, 4, 5}}, }, { - para297{[]int{1,2}}, - ans297{[]int{1,2}}, + para297{[]int{1, 2}}, + ans297{[]int{1, 2}}, }, } @@ -52,4 +52,4 @@ func Test_Problem297(t *testing.T) { fmt.Printf("【output】:%v \n", structures.Tree2Preorder(tree297.deserialize(serialized))) } fmt.Printf("\n\n\n") -} \ No newline at end of file +} diff --git a/leetcode/0306.Additive-Number/306. Additive Number.go b/leetcode/0306.Additive-Number/306. Additive Number.go index 1489b05c8..bd0429a16 100644 --- a/leetcode/0306.Additive-Number/306. Additive Number.go +++ b/leetcode/0306.Additive-Number/306. Additive Number.go @@ -35,7 +35,7 @@ func max(a int, b int) int { return b } -//Propagate for rest of the string +// Propagate for rest of the string func recursiveCheck(num string, x1 int, x2 int, left int) bool { if left == len(num) { return true diff --git a/leetcode/0372.Super-Pow/372. Super Pow.go b/leetcode/0372.Super-Pow/372. Super Pow.go index aacc6c7ae..3f4082c7a 100644 --- a/leetcode/0372.Super-Pow/372. Super Pow.go +++ b/leetcode/0372.Super-Pow/372. Super Pow.go @@ -8,10 +8,11 @@ package leetcode // 模运算性质五:ab % p = ((a % p) * ( b % p)) % p, 其中 ab 是一个数字,如:2874,98374 等等 // 举个例子 // 12345^678 % 1337 = (12345^670 * 12345^8) % 1337 -// = ((12345^670 % 1337) * (12345^8 % 1337)) % 1337 ---> 利用性质 三 +// +// = ((12345^670 % 1337) * (12345^8 % 1337)) % 1337 ---> 利用性质 三 // = (((12345^67)^10 % 1337) * (12345^8 % 1337)) % 1337 ---> 乘方性质 -// = ((12345^67 % 1337)^10) % 1337 * (12345^8 % 1337)) % 1337 ---> 利用性质 四 -// = (((12345^67 % 1337)^10) * (12345^8 % 1337)) % 1337 ---> 反向利用性质 三 +// = ((12345^67 % 1337)^10) % 1337 * (12345^8 % 1337)) % 1337 ---> 利用性质 四 +// = (((12345^67 % 1337)^10) * (12345^8 % 1337)) % 1337 ---> 反向利用性质 三 func superPow(a int, b []int) int { res := 1 for i := 0; i < len(b); i++ { diff --git a/leetcode/0382.Linked-List-Random-Node/382. Linked List Random Node.go b/leetcode/0382.Linked-List-Random-Node/382. Linked List Random Node.go index 0e54f7549..892ca7075 100644 --- a/leetcode/0382.Linked-List-Random-Node/382. Linked List Random Node.go +++ b/leetcode/0382.Linked-List-Random-Node/382. Linked List Random Node.go @@ -20,8 +20,10 @@ type Solution struct { head *ListNode } -/** @param head The linked list's head. - Note that the head is guaranteed to be not null, so it contains at least one node. */ +/* + - @param head The linked list's head. + Note that the head is guaranteed to be not null, so it contains at least one node. +*/ func Constructor(head *ListNode) Solution { return Solution{head: head} } diff --git a/leetcode/0396.Rotate-Function/396. Rotate Function.go b/leetcode/0396.Rotate-Function/396. Rotate Function.go new file mode 100644 index 000000000..aecc5ae1c --- /dev/null +++ b/leetcode/0396.Rotate-Function/396. Rotate Function.go @@ -0,0 +1,18 @@ +package leetcode + +func maxRotateFunction(nums []int) int { + n := len(nums) + var sum, f int + for i, num := range nums { + sum += num + f += i * num // F(0) + } + ans := f + for i := 1; i < n; i++ { + f += sum - n*nums[n-i] // F(i) = F(i-1) + sum - n*nums[n-i] + if f > ans { + ans = f + } + } + return ans +} diff --git a/leetcode/0396.Rotate-Function/396. Rotate Function_test.go b/leetcode/0396.Rotate-Function/396. Rotate Function_test.go new file mode 100644 index 000000000..855323a15 --- /dev/null +++ b/leetcode/0396.Rotate-Function/396. Rotate Function_test.go @@ -0,0 +1,46 @@ +package leetcode + +import ( + "fmt" + "testing" +) + +type question396 struct { + para396 + ans396 +} + +// para 是参数 +// one 代表第一个参数 +type para396 struct { + one []int +} + +// ans 是答案 +// one 代表第一个答案 +type ans396 struct { + one int +} + +func Test_Problem396(t *testing.T) { + + qs := []question396{ + { + para396{[]int{4, 3, 2, 6}}, + ans396{26}, + }, + + { + para396{[]int{100}}, + ans396{0}, + }, + } + + fmt.Printf("------------------------Leetcode Problem 396------------------------\n") + + for _, q := range qs { + _, p := q.ans396, q.para396 + fmt.Printf("【input】:%v 【output】:%v\n", p, maxRotateFunction(p.one)) + } + fmt.Printf("\n\n\n") +} diff --git a/leetcode/0396.Rotate-Function/README.md b/leetcode/0396.Rotate-Function/README.md new file mode 100644 index 000000000..ed1ab9c5a --- /dev/null +++ b/leetcode/0396.Rotate-Function/README.md @@ -0,0 +1,110 @@ +# [396. Rotate Function](https://leetcode.com/problems/rotate-function/) + +## 题目 + +You are given an integer array `nums` of length `n`. + +Assume `arrk` to be an array obtained by rotating `nums` by `k` positions clock-wise. We define the **rotation function** `F` on `nums` as follow: + +- `F(k) = 0 * arrk[0] + 1 * arrk[1] + ... + (n - 1) * arrk[n - 1]`. + +Return the maximum value of `F(0), F(1), ..., F(n-1)`. + +The test cases are generated so that the answer fits in a **32-bit** integer. + +**Example 1:** + +```c +Input: nums = [4,3,2,6] +Output: 26 +Explanation: +F(0) = (0 * 4) + (1 * 3) + (2 * 2) + (3 * 6) = 0 + 3 + 4 + 18 = 25 +F(1) = (0 * 6) + (1 * 4) + (2 * 3) + (3 * 2) = 0 + 4 + 6 + 6 = 16 +F(2) = (0 * 2) + (1 * 6) + (2 * 4) + (3 * 3) = 0 + 6 + 8 + 9 = 23 +F(3) = (0 * 3) + (1 * 2) + (2 * 6) + (3 * 4) = 0 + 2 + 12 + 12 = 26 +So the maximum value of F(0), F(1), F(2), F(3) is F(3) = 26. +``` + +**Example 2:** + +```c +Input: nums = [100] +Output: 0 +``` + +**Constraints:** + +- `n == nums.length` +- `1 <= n <= 105` +- `-100 <= nums[i] <= 100` + +## 题目大意 + +给定一个长度为`n`的整数数组`nums`,设`arrk`是数组`nums`顺时针旋转`k`个位置后的数组。 + +定义`nums`的旋转函数`F`为: + +- `F(k) = 0 * arrk[0] + 1 * arrk[1] + ... + (n - 1) * arrk[n - 1]` + +返回`F(0), F(1), ..., F(n-1)`中的最大值。 + +## 解题思路 + +**抽象化观察:** + +```c +nums = [A0, A1, A2, A3] + +sum = A0 + A1 + A2+ A3 +F(0) = 0*A0 +0*A0 + 1*A1 + 2*A2 + 3*A3 + +F(1) = 0*A3 + 1*A0 + 2*A1 + 3*A2 + = F(0) + (A0 + A1 + A2) - 3*A3 + = F(0) + (sum-A3) - 3*A3 + = F(0) + sum - 4*A3 + +F(2) = 0*A2 + 1*A3 + 2*A0 + 3*A1 + = F(1) + A3 + A0 + A1 - 3*A2 + = F(1) + sum - 4*A2 + +F(3) = 0*A1 + 1*A2 + 2*A3 + 3*A0 + = F(2) + A2 + A3 + A0 - 3*A1 + = F(2) + sum - 4*A1 + +// 记sum为nums数组中所有元素和 +// 可以猜测当0 ≤ i < n时存在公式: +F(i) = F(i-1) + sum - n * A(n-i) +``` + +**数学归纳法证明迭代公式:** + +根据题目中给定的旋转函数公式可得已知条件: + +- `F(0) = 0×nums[0] + 1×nums[1] + ... + (n−1)×nums[n−1]`; + +- `F(1) = 1×nums[0] + 2×nums[1] + ... + 0×nums[n-1]`。 + +令数组`nums`中所有元素和为`sum`,用数学归纳法验证:当`1 ≤ k < n`时,`F(k) = F(k-1) + sum - n×nums[n-k]`成立。 + +**归纳奠基**:证明`k=1`时命题成立。 + +```c +F(1) = 1×nums[0] + 2×nums[1] + ... + 0×nums[n-1] + = F(0) + sum - n×nums[n-1] +``` + +**归纳假设**:假设`F(k) = F(k-1) + sum - n×nums[n-k]`成立。 + +**归纳递推**:由归纳假设推出`F(k+1) = F(k) + sum - n×nums[n-(k+1)]`成立,则假设的递推公式成立。 + +```c +F(k+1) = (k+1)×nums[0] + k×nums[1] + ... + 0×nums[n-1] + = F(k) + sum - n×nums[n-(k+1)] +``` + +因此可以得到递推公式: + +- 当`n = 0`时,`F(0) = 0×nums[0] + 1×nums[1] + ... + (n−1)×nums[n−1]` +- 当`1 ≤ k < n`时,`F(k) = F(k-1) + sum - n×nums[n-k]`成立。 + +循环遍历`0 ≤ k < n`,计算出不同的`F(k)`并不断更新最大值,就能求出`F(0), F(1), ..., F(n-1)`中的最大值。 diff --git a/leetcode/0401.Binary-Watch/401. Binary Watch.go b/leetcode/0401.Binary-Watch/401. Binary Watch.go index 88b49e539..39cbf8393 100644 --- a/leetcode/0401.Binary-Watch/401. Binary Watch.go +++ b/leetcode/0401.Binary-Watch/401. Binary Watch.go @@ -76,11 +76,11 @@ func readBinaryWatch1(num int) []string { return res } -/// --------------------------------------- -/// --------------------------------------- -/// --------------------------------------- -/// --------------------------------------- -/// --------------------------------------- +// / --------------------------------------- +// / --------------------------------------- +// / --------------------------------------- +// / --------------------------------------- +// / --------------------------------------- // 以下是打表用到的函数 // 调用 findReadBinaryWatchMinute(num, 0, c, &res) 打表 func findReadBinaryWatchMinute(target, index int, c []int, res *[]string) { 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:** + +![img](https://assets.leetcode.com/uploads/2021/04/10/battelship-grid.jpg) + +```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/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 index e69de29bb..fe56775a4 100644 --- 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 @@ -0,0 +1,10 @@ +package leetcode + +import ( + "fmt" + "testing" +) + +func Test_Problem429(t *testing.T) { + fmt.Printf("success\n") +} 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.Increasing-Subsequences/README.md b/leetcode/0491.Non-decreasing-Subsequences/README.md similarity index 95% rename from leetcode/0491.Increasing-Subsequences/README.md rename to leetcode/0491.Non-decreasing-Subsequences/README.md index 79063dbc5..f5c5e34a6 100755 --- a/leetcode/0491.Increasing-Subsequences/README.md +++ b/leetcode/0491.Non-decreasing-Subsequences/README.md @@ -1,4 +1,4 @@ -# [491. Increasing Subsequences](https://leetcode.com/problems/increasing-subsequences/) +# [491. Non-decreasing Subsequences](https://leetcode.com/problems/non-decreasing-subsequences/) ## 题目 diff --git a/leetcode/0494.Target-Sum/494. Target Sum.go b/leetcode/0494.Target-Sum/494. Target Sum.go index 804152328..8adde19c7 100644 --- a/leetcode/0494.Target-Sum/494. Target Sum.go +++ b/leetcode/0494.Target-Sum/494. Target Sum.go @@ -6,7 +6,7 @@ func findTargetSumWays(nums []int, S int) int { for _, n := range nums { total += n } - if S > total || (S+total)%2 == 1 || S+total < 0 { + if S+total < 0 || S > total || (S+total)%2 == 1 { return 0 } target := (S + total) / 2 diff --git a/leetcode/0504.Base-7/504.Base 7.go b/leetcode/0504.Base-7/504.Base 7.go new file mode 100644 index 000000000..5a143b2be --- /dev/null +++ b/leetcode/0504.Base-7/504.Base 7.go @@ -0,0 +1,28 @@ +package leetcode + +import "strconv" + +func convertToBase7(num int) string { + if num == 0 { + return "0" + } + negative := false + if num < 0 { + negative = true + num = -num + } + var ans string + var nums []int + for num != 0 { + remainder := num % 7 + nums = append(nums, remainder) + num = num / 7 + } + if negative { + ans += "-" + } + for i := len(nums) - 1; i >= 0; i-- { + ans += strconv.Itoa(nums[i]) + } + return ans +} diff --git a/leetcode/0504.Base-7/504.Base 7_test.go b/leetcode/0504.Base-7/504.Base 7_test.go new file mode 100644 index 000000000..1309c1b63 --- /dev/null +++ b/leetcode/0504.Base-7/504.Base 7_test.go @@ -0,0 +1,46 @@ +package leetcode + +import ( + "fmt" + "testing" +) + +type question504 struct { + para504 + ans504 +} + +// para 是参数 +type para504 struct { + num int +} + +// ans 是答案 +type ans504 struct { + ans string +} + +func Test_Problem504(t *testing.T) { + + qs := []question504{ + + { + para504{100}, + ans504{"202"}, + }, + + { + para504{-7}, + ans504{"-10"}, + }, + } + + fmt.Printf("------------------------Leetcode Problem 504------------------------\n") + + for _, q := range qs { + _, p := q.ans504, q.para504 + fmt.Printf("【input】:%v ", p.num) + fmt.Printf("【output】:%v \n", convertToBase7(p.num)) + } + fmt.Printf("\n\n\n") +} diff --git a/leetcode/0504.Base-7/README.md b/leetcode/0504.Base-7/README.md new file mode 100644 index 000000000..359b96a0c --- /dev/null +++ b/leetcode/0504.Base-7/README.md @@ -0,0 +1,60 @@ +# [504. Base 7](https://leetcode.com/problems/base-7/) + +## 题目 + +Given an integer num, return a string of its base 7 representation. + +**Example 1:** + + Input: num = 100 + Output: "202" + +**Example 2:** + + Input: num = -7 + Output: "-10" + +**Constraints:** + +- -10000000 <= num <= 10000000 + +## 题目大意 + +给定一个整数 num,将其转化为 7 进制,并以字符串形式输出。 + +## 解题思路 + + num反复除以7,然后倒排余数 + +# 代码 + +```go +package leetcode + +import "strconv" + +func convertToBase7(num int) string { + if num == 0 { + return "0" + } + negative := false + if num < 0 { + negative = true + num = -num + } + var ans string + var nums []int + for num != 0 { + remainder := num % 7 + nums = append(nums, remainder) + num = num / 7 + } + if negative { + ans += "-" + } + for i := len(nums) - 1; i >= 0; i-- { + ans += strconv.Itoa(nums[i]) + } + return ans +} +``` \ No newline at end of file diff --git a/leetcode/0508.Most-Frequent-Subtree-Sum/508. Most Frequent Subtree Sum.go b/leetcode/0508.Most-Frequent-Subtree-Sum/508. Most Frequent Subtree Sum.go index c35b7f7b3..98300692e 100644 --- a/leetcode/0508.Most-Frequent-Subtree-Sum/508. Most Frequent Subtree Sum.go +++ b/leetcode/0508.Most-Frequent-Subtree-Sum/508. Most Frequent Subtree Sum.go @@ -2,9 +2,7 @@ package leetcode import ( "sort" -) -import ( "github.com/halfrost/LeetCode-Go/structures" ) diff --git a/leetcode/0509.Fibonacci-Number/509. Fibonacci Number.go b/leetcode/0509.Fibonacci-Number/509. Fibonacci Number.go index 9fc98a9be..ea6d95a26 100644 --- a/leetcode/0509.Fibonacci-Number/509. Fibonacci Number.go +++ b/leetcode/0509.Fibonacci-Number/509. Fibonacci Number.go @@ -111,19 +111,19 @@ func fib5(N int) int { // 解法七 协程版,但是时间特别慢,不推荐,放在这里只是告诉大家,写 LeetCode 算法题的时候,启动 goroutine 特别慢 func fib6(N int) int { - return <-fibb(N) + return <-fibb(N) } -func fibb(n int) <- chan int { - result := make(chan int) - go func() { - defer close(result) - - if n <= 1 { - result <- n - return - } - result <- <-fibb(n-1) + <-fibb(n-2) - }() - return result -} \ No newline at end of file +func fibb(n int) <-chan int { + result := make(chan int) + go func() { + defer close(result) + + if n <= 1 { + result <- n + return + } + result <- <-fibb(n-1) + <-fibb(n-2) + }() + return result +} diff --git a/leetcode/0515.Find-Largest-Value-in-Each-Tree-Row/515. Find Largest Value in Each Tree Row.go b/leetcode/0515.Find-Largest-Value-in-Each-Tree-Row/515. Find Largest Value in Each Tree Row.go index c6a329e76..54d831dc0 100644 --- a/leetcode/0515.Find-Largest-Value-in-Each-Tree-Row/515. Find Largest Value in Each Tree Row.go +++ b/leetcode/0515.Find-Largest-Value-in-Each-Tree-Row/515. Find Largest Value in Each Tree Row.go @@ -3,9 +3,7 @@ package leetcode import ( "math" "sort" -) -import ( "github.com/halfrost/LeetCode-Go/structures" ) diff --git a/leetcode/0518.Coin-Change-2/518. Coin Change 2.go b/leetcode/0518.Coin-Change-II/518. Coin Change II.go similarity index 100% rename from leetcode/0518.Coin-Change-2/518. Coin Change 2.go rename to leetcode/0518.Coin-Change-II/518. Coin Change II.go diff --git a/leetcode/0518.Coin-Change-2/518. Coin Change 2_test.go b/leetcode/0518.Coin-Change-II/518. Coin Change II_test.go similarity index 100% rename from leetcode/0518.Coin-Change-2/518. Coin Change 2_test.go rename to leetcode/0518.Coin-Change-II/518. Coin Change II_test.go diff --git a/leetcode/0518.Coin-Change-2/README.md b/leetcode/0518.Coin-Change-II/README.md similarity index 97% rename from leetcode/0518.Coin-Change-2/README.md rename to leetcode/0518.Coin-Change-II/README.md index 7531d0419..4679d2d3c 100644 --- a/leetcode/0518.Coin-Change-2/README.md +++ b/leetcode/0518.Coin-Change-II/README.md @@ -1,4 +1,4 @@ -# [518. Coin Change 2](https://leetcode.com/problems/coin-change-2/) +# [518. Coin Change II](https://leetcode.com/problems/coin-change-ii/) ## 题目 diff --git a/leetcode/0529.Minesweeper/529. Minesweeper.go b/leetcode/0529.Minesweeper/529. Minesweeper.go index aef5d2b86..786405ee7 100644 --- a/leetcode/0529.Minesweeper/529. Minesweeper.go +++ b/leetcode/0529.Minesweeper/529. Minesweeper.go @@ -16,48 +16,31 @@ func updateBoard(board [][]byte, click []int) [][]byte { board[click[0]][click[1]] = 'X' return board } + dfs(board, click[0], click[1]) + return board +} - mineMap := make([][]int, len(board)) - for i := range board { - mineMap[i] = make([]int, len(board[i])) +func dfs(board [][]byte, x, y int) { + cnt := 0 + for i := 0; i < 8; i++ { + nx, ny := x+dir8[i][0], y+dir8[i][1] + if isInBoard(board, nx, ny) && board[nx][ny] == 'M' { + cnt++ + } } - - for i := range board { - for j := range board[i] { - if board[i][j] == 'M' { - mineMap[i][j] = -1 - for _, d := range dir8 { - nx, ny := i+d[0], j+d[1] - if isInBoard(board, nx, ny) && mineMap[nx][ny] >= 0 { - mineMap[nx][ny]++ - } - } - } + if cnt > 0 { + board[x][y] = byte(cnt + '0') + return + } + board[x][y] = 'B' + for i := 0; i < 8; i++ { + nx, ny := x+dir8[i][0], y+dir8[i][1] + if isInBoard(board, nx, ny) && board[nx][ny] != 'B' { + dfs(board, nx, ny) } } - mineSweeper(click[0], click[1], board, mineMap, dir8) - return board } func isInBoard(board [][]byte, x, y int) bool { return x >= 0 && x < len(board) && y >= 0 && y < len(board[0]) } - -func mineSweeper(x, y int, board [][]byte, mineMap [][]int, dir8 [][]int) { - if board[x][y] != 'M' && board[x][y] != 'E' { - return - } - if mineMap[x][y] == -1 { - board[x][y] = 'X' - } else if mineMap[x][y] > 0 { - board[x][y] = '0' + byte(mineMap[x][y]) - } else { - board[x][y] = 'B' - for _, d := range dir8 { - nx, ny := x+d[0], y+d[1] - if isInBoard(board, nx, ny) && mineMap[nx][ny] >= 0 { - mineSweeper(nx, ny, board, mineMap, dir8) - } - } - } -} diff --git a/leetcode/0529.Minesweeper/README.md b/leetcode/0529.Minesweeper/README.md index f2166a692..d25c79c50 100644 --- a/leetcode/0529.Minesweeper/README.md +++ b/leetcode/0529.Minesweeper/README.md @@ -103,43 +103,33 @@ func updateBoard(board [][]byte, click []int) [][]byte { board[click[0]][click[1]] = 'X' return board } - mineMap := make([][]int, len(board)) - for i := range board { - mineMap[i] = make([]int, len(board[i])) - } - for i := range board { - for j := range board[i] { - if board[i][j] == 'M' { - mineMap[i][j] = -1 - for _, d := range dir8 { - nx, ny := i+d[0], j+d[1] - if isInBoard(board, nx, ny) && mineMap[nx][ny] >= 0 { - mineMap[nx][ny]++ - } - } - } - } - } - mineSweeper(click[0], click[1], board, mineMap, dir8) + dfs(board, click[0], click[1]) return board } -func mineSweeper(x, y int, board [][]byte, mineMap [][]int, dir8 [][]int) { - if board[x][y] != 'M' && board[x][y] != 'E' { +func dfs(board [][]byte, x, y int) { + cnt := 0 + for i := 0; i < 8; i++ { + nx, ny := x+dir8[i][0], y+dir8[i][1] + if isInBoard(board, nx, ny) && board[nx][ny] == 'M' { + cnt++ + + } + } + if cnt > 0 { + board[x][y] = byte(cnt + '0') return } - if mineMap[x][y] == -1 { - board[x][y] = 'X' - } else if mineMap[x][y] > 0 { - board[x][y] = '0' + byte(mineMap[x][y]) - } else { - board[x][y] = 'B' - for _, d := range dir8 { - nx, ny := x+d[0], y+d[1] - if isInBoard(board, nx, ny) && mineMap[nx][ny] >= 0 { - mineSweeper(nx, ny, board, mineMap, dir8) - } + board[x][y] = 'B' + for i := 0; i < 8; i++ { + nx, ny := x+dir8[i][0], y+dir8[i][1] + if isInBoard(board, nx, ny) && board[nx][ny] != 'B' { + dfs(board, nx, ny) } } } + +func isInBoard(board [][]byte, x, y int) bool { + return x >= 0 && x < len(board) && y >= 0 && y < len(board[0]) +} ``` \ No newline at end of file diff --git a/leetcode/0561.Array-Partition-I/561. Array Partition I.go b/leetcode/0561.Array-Partition/561. Array Partition.go similarity index 100% rename from leetcode/0561.Array-Partition-I/561. Array Partition I.go rename to leetcode/0561.Array-Partition/561. Array Partition.go diff --git a/leetcode/0561.Array-Partition-I/561. Array Partition I_test.go b/leetcode/0561.Array-Partition/561. Array Partition_test.go similarity index 100% rename from leetcode/0561.Array-Partition-I/561. Array Partition I_test.go rename to leetcode/0561.Array-Partition/561. Array Partition_test.go diff --git a/leetcode/0561.Array-Partition-I/README.md b/leetcode/0561.Array-Partition/README.md similarity index 97% rename from leetcode/0561.Array-Partition-I/README.md rename to leetcode/0561.Array-Partition/README.md index d72ea633d..244bec8c9 100644 --- a/leetcode/0561.Array-Partition-I/README.md +++ b/leetcode/0561.Array-Partition/README.md @@ -1,4 +1,4 @@ -# [561. Array Partition I](https://leetcode.com/problems/array-partition-i/) +# [561. Array Partition](https://leetcode.com/problems/array-partition/) ## 题目 diff --git a/leetcode/0563.Binary-Tree-Tilt/563. Binary Tree Tilt.go b/leetcode/0563.Binary-Tree-Tilt/563. Binary Tree Tilt.go index 74aa00974..96127e720 100644 --- a/leetcode/0563.Binary-Tree-Tilt/563. Binary Tree Tilt.go +++ b/leetcode/0563.Binary-Tree-Tilt/563. Binary Tree Tilt.go @@ -1,8 +1,8 @@ package leetcode -import "math" - import ( + "math" + "github.com/halfrost/LeetCode-Go/structures" ) diff --git a/leetcode/0589.N-ary-Tree-Preorder-Traversal/589. N-ary Tree Preorder Traversal.go b/leetcode/0589.N-ary-Tree-Preorder-Traversal/589. N-ary Tree Preorder Traversal.go index 8daad2aa7..c0059ffd1 100644 --- a/leetcode/0589.N-ary-Tree-Preorder-Traversal/589. N-ary Tree Preorder Traversal.go +++ b/leetcode/0589.N-ary-Tree-Preorder-Traversal/589. N-ary Tree Preorder Traversal.go @@ -1,6 +1,6 @@ package leetcode -// Definition for a Node. +// Definition for a Node. type Node struct { Val int Children []*Node diff --git a/leetcode/0648.Replace-Words/648. Replace Words.go b/leetcode/0648.Replace-Words/648. Replace Words.go index d742af98f..0d26e0756 100644 --- a/leetcode/0648.Replace-Words/648. Replace Words.go +++ b/leetcode/0648.Replace-Words/648. Replace Words.go @@ -34,7 +34,7 @@ func findWord(roots map[byte][]string, word []byte) bool { return false } -//解法二 Trie +// 解法二 Trie func replaceWords1(dict []string, sentence string) string { trie := Constructor208() for _, v := range dict { diff --git a/leetcode/0725.Split-Linked-List-in-Parts/725. Split Linked List in Parts.go b/leetcode/0725.Split-Linked-List-in-Parts/725. Split Linked List in Parts.go index 9a17de211..edfae081f 100644 --- a/leetcode/0725.Split-Linked-List-in-Parts/725. Split Linked List in Parts.go +++ b/leetcode/0725.Split-Linked-List-in-Parts/725. Split Linked List in Parts.go @@ -1,8 +1,8 @@ package leetcode -import "fmt" - import ( + "fmt" + "github.com/halfrost/LeetCode-Go/structures" ) diff --git a/leetcode/0728.Self-Dividing-Numbers/728.Self Dividing Numbers.go b/leetcode/0728.Self-Dividing-Numbers/728.Self Dividing Numbers.go new file mode 100644 index 000000000..a0f3c421f --- /dev/null +++ b/leetcode/0728.Self-Dividing-Numbers/728.Self Dividing Numbers.go @@ -0,0 +1,24 @@ +package leetcode + +func selfDividingNumbers(left int, right int) []int { + var ans []int + for num := left; num <= right; num++ { + if selfDividingNum(num) { + ans = append(ans, num) + } + } + return ans +} + +func selfDividingNum(num int) bool { + for d := num; d > 0; d = d / 10 { + reminder := d % 10 + if reminder == 0 { + return false + } + if num%reminder != 0 { + return false + } + } + return true +} diff --git a/leetcode/0728.Self-Dividing-Numbers/728.Self Dividing Numbers_test.go b/leetcode/0728.Self-Dividing-Numbers/728.Self Dividing Numbers_test.go new file mode 100644 index 000000000..a4e10d425 --- /dev/null +++ b/leetcode/0728.Self-Dividing-Numbers/728.Self Dividing Numbers_test.go @@ -0,0 +1,47 @@ +package leetcode + +import ( + "fmt" + "testing" +) + +type question728 struct { + para728 + ans728 +} + +// para 是参数 +type para728 struct { + left int + right int +} + +// ans 是答案 +type ans728 struct { + ans []int +} + +func Test_Problem728(t *testing.T) { + + qs := []question728{ + + { + para728{1, 22}, + ans728{[]int{1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 12, 15, 22}}, + }, + + { + para728{47, 85}, + ans728{[]int{48, 55, 66, 77}}, + }, + } + + fmt.Printf("------------------------Leetcode Problem 728------------------------\n") + + for _, q := range qs { + _, p := q.ans728, q.para728 + fmt.Printf("【input】:%v ", p) + fmt.Printf("【output】:%v \n", selfDividingNumbers(p.left, p.right)) + } + fmt.Printf("\n\n\n") +} diff --git a/leetcode/0728.Self-Dividing-Numbers/README.md b/leetcode/0728.Self-Dividing-Numbers/README.md new file mode 100644 index 000000000..323e51ef7 --- /dev/null +++ b/leetcode/0728.Self-Dividing-Numbers/README.md @@ -0,0 +1,68 @@ +# [728. Self Dividing Numbers](https://leetcode.com/problems/self-dividing-numbers/) + +## 题目 + +A self-dividing number is a number that is divisible by every digit it contains. + +- For example, 128 is a self-dividing number because 128 % 1 == 0, 128 % 2 == 0, and 128 % 8 == 0. + +A self-dividing number is not allowed to contain the digit zero. + +Given two integers left and right, return a list of all the self-dividing numbers in the range [left, right]. + +**Example 1:** + + Input: left = 1, right = 22 + Output: [1,2,3,4,5,6,7,8,9,11,12,15,22] + +**Example 2:** + + Input: left = 47, right = 85 + Output: [48,55,66,77] + +**Constraints:** + +- 1 <= left <= right <= 10000 + +## 题目大意 + +自除数是指可以被它包含的每一位数整除的数。 + +- 例如,128 是一个 自除数 ,因为 128 % 1 == 0,128 % 2 == 0,128 % 8 == 0。 + +自除数 不允许包含 0 。 + +给定两个整数 left 和 right ,返回一个列表,列表的元素是范围 [left, right] 内所有的 自除数 。 + +## 解题思路 + +- 模拟计算 + +# 代码 + +```go +package leetcode + +func selfDividingNumbers(left int, right int) []int { + var ans []int + for num := left; num <= right; num++ { + if selfDividingNum(num) { + ans = append(ans, num) + } + } + return ans +} + +func selfDividingNum(num int) bool { + for d := num; d > 0; d = d / 10 { + reminder := d % 10 + if reminder == 0 { + return false + } + if num%reminder != 0 { + return false + } + } + return true +} +``` diff --git a/leetcode/0763.Partition-Labels/README.md b/leetcode/0763.Partition-Labels/README.md index 68ecff8a0..68d511b40 100644 --- a/leetcode/0763.Partition-Labels/README.md +++ b/leetcode/0763.Partition-Labels/README.md @@ -32,6 +32,6 @@ Note: ## 解题思路 -这一题有 2 种思路,第一种思路是先记录下每个字母的出现次数,然后对滑动窗口中的每个字母判断次数是否用尽为 0,如果这个窗口内的所有字母次数都为 0,这个窗口就是符合条件的窗口。时间复杂度为 O(n^2) +这一题有 2 种思路,第一种思路是先记录下每个字母的出现次数,然后对滑动窗口中的每个字母判断次数是否用尽为 0,如果这个窗口内的所有字母次数都为 0,这个窗口就是符合条件的窗口。时间复杂度为 O(n) 另外一种思路是记录下每个字符最后一次出现的下标,这样就不用记录次数。在每个滑动窗口中,依次判断每个字母最后一次出现的位置,如果在一个下标内,所有字母的最后一次出现的位置都包含进来了,那么这个下标就是这个满足条件的窗口大小。时间复杂度为 O(n^2) diff --git a/leetcode/0842.Split-Array-into-Fibonacci-Sequence/842. Split Array into Fibonacci Sequence.go b/leetcode/0842.Split-Array-into-Fibonacci-Sequence/842. Split Array into Fibonacci Sequence.go index 78c8b9847..f6851cbab 100644 --- a/leetcode/0842.Split-Array-into-Fibonacci-Sequence/842. Split Array into Fibonacci Sequence.go +++ b/leetcode/0842.Split-Array-into-Fibonacci-Sequence/842. Split Array into Fibonacci Sequence.go @@ -32,7 +32,7 @@ func splitIntoFibonacci(S string) []int { return res } -//Propagate for rest of the string +// Propagate for rest of the string func findRecursiveCheck(S string, x1 int, x2 int, left int, res *[]int, isComplete *bool) { if x1 >= 1<<31 || x2 >= 1<<31 { // 题目要求每个数都要小于 2^31 - 1 = 2147483647,此处剪枝很关键! return diff --git a/leetcode/1022.Sum-of-Root-To-Leaf-Binary-Numbers/1022. Sum of Root To Leaf Binary Numbers.go b/leetcode/1022.Sum-of-Root-To-Leaf-Binary-Numbers/1022. Sum of Root To Leaf Binary Numbers.go new file mode 100644 index 000000000..473564c29 --- /dev/null +++ b/leetcode/1022.Sum-of-Root-To-Leaf-Binary-Numbers/1022. Sum of Root To Leaf Binary Numbers.go @@ -0,0 +1,30 @@ +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 + * } + */ +func sumRootToLeaf(root *TreeNode) int { + var dfs func(*TreeNode, int) int + dfs = func(node *TreeNode, sum int) int { + if node == nil { + return 0 + } + sum = sum<<1 | node.Val + // 上一行也可以写作 sum = sum*2 + node.Val + if node.Left == nil && node.Right == nil { + return sum + } + return dfs(node.Left, sum) + dfs(node.Right, sum) + } + return dfs(root, 0) +} diff --git a/leetcode/1022.Sum-of-Root-To-Leaf-Binary-Numbers/1022. Sum of Root To Leaf Binary Numbers_test.go b/leetcode/1022.Sum-of-Root-To-Leaf-Binary-Numbers/1022. Sum of Root To Leaf Binary Numbers_test.go new file mode 100644 index 000000000..3b7ce6f92 --- /dev/null +++ b/leetcode/1022.Sum-of-Root-To-Leaf-Binary-Numbers/1022. Sum of Root To Leaf Binary Numbers_test.go @@ -0,0 +1,49 @@ +package leetcode + +import ( + "fmt" + "testing" + + "github.com/halfrost/LeetCode-Go/structures" +) + +type question1022 struct { + para1022 + ans1022 +} + +// para 是参数 +// one 代表第一个参数 +type para1022 struct { + one []int +} + +// ans 是答案 +// one 代表第一个答案 +type ans1022 struct { + one int +} + +func Test_Problem1022(t *testing.T) { + + qs := []question1022{ + { + para1022{[]int{1, 0, 1, 0, 1, 0, 1}}, + ans1022{22}, + }, + + { + para1022{[]int{0}}, + ans1022{0}, + }, + } + + fmt.Printf("------------------------Leetcode Problem 1022------------------------\n") + + for _, q := range qs { + _, p := q.ans1022, q.para1022 + root := structures.Ints2TreeNode(p.one) + fmt.Printf("【input】:%v 【output】:%v\n", p, sumRootToLeaf(root)) + } + fmt.Printf("\n\n\n") +} diff --git a/leetcode/1022.Sum-of-Root-To-Leaf-Binary-Numbers/README.md b/leetcode/1022.Sum-of-Root-To-Leaf-Binary-Numbers/README.md new file mode 100644 index 000000000..83578063e --- /dev/null +++ b/leetcode/1022.Sum-of-Root-To-Leaf-Binary-Numbers/README.md @@ -0,0 +1,54 @@ +# [1022. Sum of Root To Leaf Binary Numbers](https://leetcode.com/problems/sum-of-root-to-leaf-binary-numbers/) + +## 题目 + +You are given the root of a binary tree where each node has a value 0 or 1. Each root-to-leaf path represents a binary number starting with the most significant bit. + +For example, if the path is 0 -> 1 -> 1 -> 0 -> 1, then this could represent 01101 in binary, which is 13. +For all leaves in the tree, consider the numbers represented by the path from the root to that leaf. Return the sum of these numbers. + +The test cases are generated so that the answer fits in a 32-bits integer. + +**Example 1:** + +```c +Input: root = [1,0,1,0,1,0,1] +Output: 22 +Explanation: (100) + (101) + (110) + (111) = 4 + 5 + 6 + 7 = 22 +``` + +**Example 2:** + +```c +Input: root = [0] +Output: 0 +``` + +**Constraints:** + +- The number of nodes in the tree is in the range `[1, 1000]`. + +- `Node.val` is `0` or `1`. + + +## 题目大意 + +给定一棵结点值都是`0`或`1`的二叉树,每条从根结点到叶结点的路径都代表一个从最高有效位开始的二进制数。 + +返回从根节点到所有叶结点的路径所表示的数字之和。 + + +## 解题思路 + +采用递归的方式对根结点`root`进行后序遍历(左子树-右子树-根结点)。 + +**递归函数的返回值**: + +递归遍历每个结点时,计算从根结点到当前访问结点的所表示数值`sum`都用到了上次的计算结果,所以递归函数的返回值是当前访问结点的计算结果值。 + +**递归函数的逻辑**: + +- 当前遍历结点为`nil`,表示本层递归结束了,直接`return 0`。 + +- 如果当前访问结点是叶结点,则返回从根结点到该结点所表示的数值`sum`。 +- 如果当前访问结点不是叶结点,则返回左子树和右子树所对应的结果之和。 diff --git a/leetcode/1028.Recover-a-Tree-From-Preorder-Traversal/1028. Recover a Tree From Preorder Traversal.go b/leetcode/1028.Recover-a-Tree-From-Preorder-Traversal/1028. Recover a Tree From Preorder Traversal.go index c3929f74e..f597f671c 100644 --- a/leetcode/1028.Recover-a-Tree-From-Preorder-Traversal/1028. Recover a Tree From Preorder Traversal.go +++ b/leetcode/1028.Recover-a-Tree-From-Preorder-Traversal/1028. Recover a Tree From Preorder Traversal.go @@ -2,9 +2,7 @@ package leetcode import ( "strconv" -) -import ( "github.com/halfrost/LeetCode-Go/structures" ) diff --git a/leetcode/1178.Number-of-Valid-Words-for-Each-Puzzle/1178. Number of Valid Words for Each Puzzle.go b/leetcode/1178.Number-of-Valid-Words-for-Each-Puzzle/1178. Number of Valid Words for Each Puzzle.go index 6ea30b77f..8acbe9ebc 100644 --- a/leetcode/1178.Number-of-Valid-Words-for-Each-Puzzle/1178. Number of Valid Words for Each Puzzle.go +++ b/leetcode/1178.Number-of-Valid-Words-for-Each-Puzzle/1178. Number of Valid Words for Each Puzzle.go @@ -1,10 +1,10 @@ package leetcode /* - 匹配跟单词中的字母顺序,字母个数都无关,可以用 bitmap 压缩 - 1. 记录 word 中 利用 map 记录各种 bit 标示的个数 - 2. puzzles 中各个字母都不相同! 记录 bitmap,然后搜索子空间中各种 bit 标识的个数的和 - 因为 puzzles 长度最长是7,所以搜索空间 2^7 +匹配跟单词中的字母顺序,字母个数都无关,可以用 bitmap 压缩 + 1. 记录 word 中 利用 map 记录各种 bit 标示的个数 + 2. puzzles 中各个字母都不相同! 记录 bitmap,然后搜索子空间中各种 bit 标识的个数的和 + 因为 puzzles 长度最长是7,所以搜索空间 2^7 */ func findNumOfValidWords(words []string, puzzles []string) []int { wordBitStatusMap, res := make(map[uint32]int, 0), []int{} @@ -29,7 +29,7 @@ func toBitMap(word []byte) uint32 { return res } -//利用 dfs 搜索 puzzles 的子空间 +// 利用 dfs 搜索 puzzles 的子空间 func findNum(puzzles []byte, bitMap uint32, totalNum *int, m map[uint32]int) { if len(puzzles) == 0 { *totalNum = *totalNum + m[bitMap] diff --git a/leetcode/1293.Shortest-Path-in-a-Grid-with-Obstacles-Elimination/1293. Shortest Path in a Grid with Obstacles Elimination.go b/leetcode/1293.Shortest-Path-in-a-Grid-with-Obstacles-Elimination/1293. Shortest Path in a Grid with Obstacles Elimination.go new file mode 100644 index 000000000..71140a986 --- /dev/null +++ b/leetcode/1293.Shortest-Path-in-a-Grid-with-Obstacles-Elimination/1293. Shortest Path in a Grid with Obstacles Elimination.go @@ -0,0 +1,71 @@ +package leetcode + +var dir = [][]int{ + {-1, 0}, + {0, 1}, + {1, 0}, + {0, -1}, +} + +type pos struct { + x, y int + obstacle int + step int +} + +func shortestPath(grid [][]int, k int) int { + queue, m, n := []pos{}, len(grid), len(grid[0]) + visitor := make([][][]int, m) + if len(grid) == 1 && len(grid[0]) == 1 { + return 0 + } + for i := 0; i < m; i++ { + visitor[i] = make([][]int, n) + for j := 0; j < n; j++ { + visitor[i][j] = make([]int, k+1) + } + } + visitor[0][0][0] = 1 + queue = append(queue, pos{x: 0, y: 0, obstacle: 0, step: 0}) + for len(queue) > 0 { + size := len(queue) + for size > 0 { + size-- + node := queue[0] + queue = queue[1:] + for i := 0; i < len(dir); i++ { + newX := node.x + dir[i][0] + newY := node.y + dir[i][1] + if newX == m-1 && newY == n-1 { + if node.obstacle != 0 { + if node.obstacle <= k { + return node.step + 1 + } else { + continue + } + } + return node.step + 1 + } + if isInBoard(grid, newX, newY) { + if grid[newX][newY] == 1 { + if node.obstacle+1 <= k && visitor[newX][newY][node.obstacle+1] != 1 { + queue = append(queue, pos{x: newX, y: newY, obstacle: node.obstacle + 1, step: node.step + 1}) + visitor[newX][newY][node.obstacle+1] = 1 + } + } else { + if node.obstacle <= k && visitor[newX][newY][node.obstacle] != 1 { + queue = append(queue, pos{x: newX, y: newY, obstacle: node.obstacle, step: node.step + 1}) + visitor[newX][newY][node.obstacle] = 1 + } + } + + } + } + } + } + return -1 +} + +func isInBoard(board [][]int, x, y int) bool { + return x >= 0 && x < len(board) && y >= 0 && y < len(board[0]) +} diff --git a/leetcode/1293.Shortest-Path-in-a-Grid-with-Obstacles-Elimination/1293. Shortest Path in a Grid with Obstacles Elimination_test.go b/leetcode/1293.Shortest-Path-in-a-Grid-with-Obstacles-Elimination/1293. Shortest Path in a Grid with Obstacles Elimination_test.go new file mode 100644 index 000000000..c7e4c68dd --- /dev/null +++ b/leetcode/1293.Shortest-Path-in-a-Grid-with-Obstacles-Elimination/1293. Shortest Path in a Grid with Obstacles Elimination_test.go @@ -0,0 +1,73 @@ +package leetcode + +import ( + "fmt" + "testing" +) + +type question1293 struct { + para1293 + ans1293 +} + +// para 是参数 +// one 代表第一个参数 +type para1293 struct { + grid [][]int + k int +} + +// ans 是答案 +// one 代表第一个答案 +type ans1293 struct { + one int +} + +func Test_Problem1293(t *testing.T) { + + qs := []question1293{ + + { + para1293{[][]int{ + {0, 0, 0}, + }, 1}, + ans1293{2}, + }, + + { + para1293{[][]int{ + {0, 1, 1}, {0, 1, 1}, {0, 0, 0}, {0, 1, 0}, {0, 1, 0}, + }, 2}, + ans1293{6}, + }, + + { + para1293{[][]int{ + {0, 0, 0}, {1, 1, 0}, {0, 0, 0}, {0, 1, 1}, {0, 0, 0}, + }, 1}, + ans1293{6}, + }, + + { + para1293{[][]int{ + {0, 1, 1}, {1, 1, 1}, {1, 0, 0}, + }, 1}, + ans1293{-1}, + }, + + { + para1293{[][]int{ + {0}, + }, 1}, + ans1293{0}, + }, + } + + fmt.Printf("------------------------Leetcode Problem 1293------------------------\n") + + for _, q := range qs { + _, p := q.ans1293, q.para1293 + fmt.Printf("【input】:%v 【output】:%v\n", p, shortestPath(p.grid, p.k)) + } + fmt.Printf("\n\n\n") +} diff --git a/leetcode/1293.Shortest-Path-in-a-Grid-with-Obstacles-Elimination/README.md b/leetcode/1293.Shortest-Path-in-a-Grid-with-Obstacles-Elimination/README.md new file mode 100644 index 000000000..0ef3fc05e --- /dev/null +++ b/leetcode/1293.Shortest-Path-in-a-Grid-with-Obstacles-Elimination/README.md @@ -0,0 +1,131 @@ +# [1293. Shortest Path in a Grid with Obstacles Elimination](https://leetcode.com/problems/shortest-path-in-a-grid-with-obstacles-elimination/) + + + +## 题目 + +You are given an m x n integer matrix grid where each cell is either 0 (empty) or 1 (obstacle). You can move up, down, left, or right from and to an empty cell in one step. + +Return the minimum number of steps to walk from the upper left corner (0, 0) to the lower right corner (m - 1, n - 1) given that you can eliminate at most k obstacles. If it is not possible to find such walk return -1. + + + +Example 1: + + +![](https://assets.leetcode.com/uploads/2021/09/30/short1-grid.jpg) + + +``` +Input: grid = [[0,0,0],[1,1,0],[0,0,0],[0,1,1],[0,0,0]], k = 1 +Output: 6 +Explanation: +The shortest path without eliminating any obstacle is 10. +The shortest path with one obstacle elimination at position (3,2) is 6. Such path is (0,0) -> (0,1) -> (0,2) -> (1,2) -> (2,2) -> (3,2) -> (4,2). +``` + +Example 2: + +![](https://assets.leetcode.com/uploads/2021/09/30/short2-grid.jpg) + +``` +Input: grid = [[0,1,1],[1,1,1],[1,0,0]], k = 1 +Output: -1 +Explanation: We need to eliminate at least two obstacles to find such a walk. +``` + +Constraints: + +- m == grid.length +- n == grid[i].length +- 1 <= m, n <= 40 +- 1 <= k <= m * n +- grid[i][j] is either 0 or 1. +- grid[0][0] == grid[m - 1][n - 1] == 0 + + + +## 题目大意 + +给你一个 m * n 的网格,其中每个单元格不是 0(空)就是 1(障碍物)。每一步,您都可以在空白单元格中上、下、左、右移动。 + +如果您 最多 可以消除 k 个障碍物,请找出从左上角 (0, 0) 到右下角 (m-1, n-1) 的最短路径,并返回通过该路径所需的步数。如果找不到这样的路径,则返回 -1 。 + + +## 解题思路 + +使用 BFS 遍历棋盘。这题比普通可达性问题多了一个障碍物的限制。这个也不难。每个点往周边四个方向扩展的时候,如果遇到障碍物,先算上这个障碍物,障碍物累积总个数小于 K 的时候,从障碍物的这个格子继续开始遍历。如果没有遇到障碍物,判断当前累积障碍物个数是否已经小于 K 个,如果小于 K 便继续遍历。如果大于 K,便终止此轮遍历。 + +## 代码 + +```go +var dir = [][]int{ + {-1, 0}, + {0, 1}, + {1, 0}, + {0, -1}, +} + +type pos struct { + x, y int + obstacle int + step int +} + +func shortestPath(grid [][]int, k int) int { + queue, m, n := []pos{}, len(grid), len(grid[0]) + visitor := make([][][]int, m) + if len(grid) == 1 && len(grid[0]) == 1 { + return 0 + } + for i := 0; i < m; i++ { + visitor[i] = make([][]int, n) + for j := 0; j < n; j++ { + visitor[i][j] = make([]int, k+1) + } + } + visitor[0][0][0] = 1 + queue = append(queue, pos{x: 0, y: 0, obstacle: 0, step: 0}) + for len(queue) > 0 { + size := len(queue) + for size > 0 { + size-- + node := queue[0] + queue = queue[1:] + for i := 0; i < len(dir); i++ { + newX := node.x + dir[i][0] + newY := node.y + dir[i][1] + if newX == m-1 && newY == n-1 { + if node.obstacle != 0 { + if node.obstacle <= k { + return node.step + 1 + } else { + continue + } + } + return node.step + 1 + } + if isInBoard(grid, newX, newY) { + if grid[newX][newY] == 1 { + if node.obstacle+1 <= k && visitor[newX][newY][node.obstacle+1] != 1 { + queue = append(queue, pos{x: newX, y: newY, obstacle: node.obstacle + 1, step: node.step + 1}) + visitor[newX][newY][node.obstacle+1] = 1 + } + } else { + if node.obstacle <= k && visitor[newX][newY][node.obstacle] != 1 { + queue = append(queue, pos{x: newX, y: newY, obstacle: node.obstacle, step: node.step + 1}) + visitor[newX][newY][node.obstacle] = 1 + } + } + + } + } + } + } + return -1 +} + +func isInBoard(board [][]int, x, y int) bool { + return x >= 0 && x < len(board) && y >= 0 && y < len(board[0]) +} +``` \ No newline at end of file diff --git a/leetcode/1305.All-Elements-in-Two-Binary-Search-Trees/1305. All Elements in Two Binary Search Trees.go b/leetcode/1305.All-Elements-in-Two-Binary-Search-Trees/1305. All Elements in Two Binary Search Trees.go index 3206a1cdb..b3c1bcb7e 100644 --- a/leetcode/1305.All-Elements-in-Two-Binary-Search-Trees/1305. All Elements in Two Binary Search Trees.go +++ b/leetcode/1305.All-Elements-in-Two-Binary-Search-Trees/1305. All Elements in Two Binary Search Trees.go @@ -2,9 +2,7 @@ package leetcode import ( "sort" -) -import ( "github.com/halfrost/LeetCode-Go/structures" ) diff --git a/leetcode/1437.Check-If-All-1s-Are-at-Least-Length-K-Places-Away/1437. Check If All 1's Are at Least Length K Places Away.go b/leetcode/1437.Check-If-All-1s-Are-at-Least-Length-K-Places-Away/1437. Check If All 1s Are at Least Length K Places Away.go similarity index 100% rename from leetcode/1437.Check-If-All-1s-Are-at-Least-Length-K-Places-Away/1437. Check If All 1's Are at Least Length K Places Away.go rename to leetcode/1437.Check-If-All-1s-Are-at-Least-Length-K-Places-Away/1437. Check If All 1s Are at Least Length K Places Away.go diff --git a/leetcode/1437.Check-If-All-1s-Are-at-Least-Length-K-Places-Away/1437. Check If All 1's Are at Least Length K Places Away_test.go b/leetcode/1437.Check-If-All-1s-Are-at-Least-Length-K-Places-Away/1437. Check If All 1s Are at Least Length K Places Away_test.go similarity index 100% rename from leetcode/1437.Check-If-All-1s-Are-at-Least-Length-K-Places-Away/1437. Check If All 1's Are at Least Length K Places Away_test.go rename to leetcode/1437.Check-If-All-1s-Are-at-Least-Length-K-Places-Away/1437. Check If All 1s Are at Least Length K Places Away_test.go diff --git a/leetcode/1576.Replace-All-s-to-Avoid-Consecutive-Repeating-Characters/1576. Replace All ?'s to Avoid Consecutive Repeating Characters.go b/leetcode/1576.Replace-All-s-to-Avoid-Consecutive-Repeating-Characters/1576. Replace-All-s-to-Avoid-Consecutive-Repeating-Characters.go similarity index 100% rename from leetcode/1576.Replace-All-s-to-Avoid-Consecutive-Repeating-Characters/1576. Replace All ?'s to Avoid Consecutive Repeating Characters.go rename to leetcode/1576.Replace-All-s-to-Avoid-Consecutive-Repeating-Characters/1576. Replace-All-s-to-Avoid-Consecutive-Repeating-Characters.go diff --git a/leetcode/1576.Replace-All-s-to-Avoid-Consecutive-Repeating-Characters/1576. Replace All ?'s to Avoid Consecutive Repeating Characters_test.go b/leetcode/1576.Replace-All-s-to-Avoid-Consecutive-Repeating-Characters/1576. Replace-All-s-to-Avoid-Consecutive-Repeating-Characters_test.go similarity index 100% rename from leetcode/1576.Replace-All-s-to-Avoid-Consecutive-Repeating-Characters/1576. Replace All ?'s to Avoid Consecutive Repeating Characters_test.go rename to leetcode/1576.Replace-All-s-to-Avoid-Consecutive-Repeating-Characters/1576. Replace-All-s-to-Avoid-Consecutive-Repeating-Characters_test.go diff --git a/leetcode/1685.Sum-of-Absolute-Differences-in-a-Sorted-Array/1685. Sum of Absolute Differences in a Sorted Array.go b/leetcode/1685.Sum-of-Absolute-Differences-in-a-Sorted-Array/1685. Sum of Absolute Differences in a Sorted Array.go index b2682093a..15656d39b 100644 --- a/leetcode/1685.Sum-of-Absolute-Differences-in-a-Sorted-Array/1685. Sum of Absolute Differences in a Sorted Array.go +++ b/leetcode/1685.Sum-of-Absolute-Differences-in-a-Sorted-Array/1685. Sum of Absolute Differences in a Sorted Array.go @@ -1,6 +1,6 @@ package leetcode -//解法一 优化版 prefixSum + sufixSum +// 解法一 优化版 prefixSum + sufixSum func getSumAbsoluteDifferences(nums []int) []int { size := len(nums) sufixSum := make([]int, size) diff --git a/leetcode/1725.Number-Of-Rectangles-That-Can-Form-The-Largest-Square/1725. Number Of Rectangles That Can Form The Largest Square.go b/leetcode/1725.Number-Of-Rectangles-That-Can-Form-The-Largest-Square/1725. Number Of Rectangles That Can Form The Largest Square.go index eec17bfb8..4c7bf664b 100644 --- a/leetcode/1725.Number-Of-Rectangles-That-Can-Form-The-Largest-Square/1725. Number Of Rectangles That Can Form The Largest Square.go +++ b/leetcode/1725.Number-Of-Rectangles-That-Can-Form-The-Largest-Square/1725. Number Of Rectangles That Can Form The Largest Square.go @@ -2,7 +2,7 @@ package leetcode func countGoodRectangles(rectangles [][]int) int { minLength, count := 0, 0 - for i, _ := range rectangles { + for i := range rectangles { minSide := 0 if rectangles[i][0] <= rectangles[i][1] { minSide = rectangles[i][0] diff --git a/leetcode/2021.Brightest-Position-on-Street/2021. Brightest Position on Street.go b/leetcode/2021.Brightest-Position-on-Street/2021. Brightest Position on Street.go new file mode 100644 index 000000000..c667e2465 --- /dev/null +++ b/leetcode/2021.Brightest-Position-on-Street/2021. Brightest Position on Street.go @@ -0,0 +1,33 @@ +package leetcode + +import ( + "sort" +) + +type lightItem struct { + index int + sign int +} + +func brightestPosition(lights [][]int) int { + lightMap, lightItems := map[int]int{}, []lightItem{} + for _, light := range lights { + lightMap[light[0]-light[1]] += 1 + lightMap[light[0]+light[1]+1] -= 1 + } + for k, v := range lightMap { + lightItems = append(lightItems, lightItem{index: k, sign: v}) + } + sort.SliceStable(lightItems, func(i, j int) bool { + return lightItems[i].index < lightItems[j].index + }) + res, border, tmp := 0, 0, 0 + for _, v := range lightItems { + tmp += v.sign + if border < tmp { + res = v.index + border = tmp + } + } + return res +} diff --git a/leetcode/2021.Brightest-Position-on-Street/2021. Brightest Position on Street_test.go b/leetcode/2021.Brightest-Position-on-Street/2021. Brightest Position on Street_test.go new file mode 100644 index 000000000..5247fbf6e --- /dev/null +++ b/leetcode/2021.Brightest-Position-on-Street/2021. Brightest Position on Street_test.go @@ -0,0 +1,56 @@ +package leetcode + +import ( + "fmt" + "testing" +) + +type question2021 struct { + para2021 + ans2021 +} + +// para 是参数 +type para2021 struct { + lights [][]int +} + +// ans 是答案 +type ans2021 struct { + ans int +} + +func Test_Problem2021(t *testing.T) { + + qs := []question2021{ + + { + para2021{[][]int{{-3, 2}, {1, 2}, {3, 3}}}, + ans2021{-1}, + }, + + { + para2021{[][]int{{1, 0}, {0, 1}}}, + ans2021{1}, + }, + + { + para2021{[][]int{{1, 2}}}, + ans2021{-1}, + }, + + { + para2021{[][]int{{1, 1}, {2, 4}, {-1, 0}, {-3, 5}, {1, 2}}}, + ans2021{-1}, + }, + } + + fmt.Printf("------------------------Leetcode Problem 2021------------------------\n") + + for _, q := range qs { + _, p := q.ans2021, q.para2021 + fmt.Printf("【input】:%v ", p) + fmt.Printf("【output】:%v \n", brightestPosition(p.lights)) + } + fmt.Printf("\n\n\n") +} diff --git a/leetcode/2021.Brightest-Position-on-Street/README.md b/leetcode/2021.Brightest-Position-on-Street/README.md new file mode 100644 index 000000000..3456fc7a0 --- /dev/null +++ b/leetcode/2021.Brightest-Position-on-Street/README.md @@ -0,0 +1,109 @@ +# [2021. Brightest Position on Street](https://leetcode.com/problems/brightest-position-on-street/) + + +## 题目 + +A perfectly straight street is represented by a number line. The street has street lamp(s) on it and is represented by a 2D integer array `lights`. Each `lights[i] = [positioni, rangei]` indicates that there is a street lamp at position `positioni` that lights up the area from `[positioni - rangei, positioni + rangei]` (**inclusive**). + +The **brightness** of a position `p` is defined as the number of street lamp that light up the position `p`. + +Given `lights`, return *the **brightest** position on the street. If there are multiple brightest positions, return the **smallest** one.* + +**Example 1:** + +![https://assets.leetcode.com/uploads/2021/09/28/image-20210928155140-1.png](https://assets.leetcode.com/uploads/2021/09/28/image-20210928155140-1.png) + +``` +Input: lights = [[-3,2],[1,2],[3,3]] +Output: -1 +Explanation: +The first street lamp lights up the area from [(-3) - 2, (-3) + 2] = [-5, -1]. +The second street lamp lights up the area from [1 - 2, 1 + 2] = [-1, 3]. +The third street lamp lights up the area from [3 - 3, 3 + 3] = [0, 6]. + +Position -1 has a brightness of 2, illuminated by the first and second street light. +Positions 0, 1, 2, and 3 have a brightness of 2, illuminated by the second and third street light. +Out of all these positions, -1 is the smallest, so return it. + +``` + +**Example 2:** + +``` +Input: lights = [[1,0],[0,1]] +Output: 1 +Explanation: +The first street lamp lights up the area from [1 - 0, 1 + 0] = [1, 1]. +The second street lamp lights up the area from [0 - 1, 0 + 1] = [-1, 1]. + +Position 1 has a brightness of 2, illuminated by the first and second street light. +Return 1 because it is the brightest position on the street. + +``` + +**Example 3:** + +``` +Input: lights = [[1,2]] +Output: -1 +Explanation: +The first street lamp lights up the area from [1 - 2, 1 + 2] = [-1, 3]. + +Positions -1, 0, 1, 2, and 3 have a brightness of 1, illuminated by the first street light. +Out of all these positions, -1 is the smallest, so return it. + +``` + +**Constraints:** + +- `1 <= lights.length <= 105` +- `lights[i].length == 2` +- `108 <= positioni <= 108` +- `0 <= rangei <= 108` + +## 题目大意 + +一条完全笔直的街道由一条数字线表示。街道上有路灯,由二维数据表示。每个 `lights[i] = [positioni, rangei]` 表示位置 `i` 处有一盏路灯,灯可以照亮从 `[positioni - rangei, positioni + rangei]` (含)的区域。 位置 `p` 的亮度定义为点亮位置 `p` 的路灯数量。 给定路灯,返回街道上最亮的位置。如果有多个最亮的位置,则返回最小的一个。 + +## 解题思路 + +- 先将每个路灯的起始和终点位置计算出来。这样我们得到了一堆坐标点。假设灯照亮的范围是 [A, B],那么在坐标轴上 A 坐标点处 + 1, B + 1 坐标点处 -1 。这样处理的含义是:坐标点 A 可以被一盏灯照亮,所以它照亮次数加一,坐标点 B + 1 出了灯照亮的范围了,所以照亮次数减一。那么从坐标轴坐标开始扫一遍,每次遇到 + 1 的时候就 + 1,遇到 - 1 的地方就 - 1。如此可以算出某个坐标点处,可以被灯照亮的总次数。 +- 需要注意的点是,题目给的测试数据可能会有单点照亮的情况,即某一盏灯只照亮一个坐标点,灯照范围为 0。同一个坐标点也可能是多个灯的起点。用一个 map 去重坐标点即可。 + +## 代码 + +```go +package leetcode + +import ( + "sort" +) + +type lightItem struct { + index int + sign int +} + +func brightestPosition(lights [][]int) int { + lightMap, lightItems := map[int]int{}, []lightItem{} + for _, light := range lights { + lightMap[light[0]-light[1]] += 1 + lightMap[light[0]+light[1]+1] -= 1 + } + for k, v := range lightMap { + lightItems = append(lightItems, lightItem{index: k, sign: v}) + } + sort.SliceStable(lightItems, func(i, j int) bool { + return lightItems[i].index < lightItems[j].index + }) + res, border, tmp := 0, 0, 0 + for _, v := range lightItems { + tmp += v.sign + if border < tmp { + res = v.index + border = tmp + } + } + return res +} +``` \ No newline at end of file diff --git a/leetcode/2037.Minimum-Number-of-Moves-to-Seat-Everyone/2037.Minimum Number of Moves to Seat Everyone.go b/leetcode/2037.Minimum-Number-of-Moves-to-Seat-Everyone/2037.Minimum Number of Moves to Seat Everyone.go new file mode 100644 index 000000000..89cae6ff4 --- /dev/null +++ b/leetcode/2037.Minimum-Number-of-Moves-to-Seat-Everyone/2037.Minimum Number of Moves to Seat Everyone.go @@ -0,0 +1,21 @@ +package leetcode + +import "sort" + +func minMovesToSeat(seats []int, students []int) int { + sort.Ints(seats) + sort.Ints(students) + n := len(students) + moves := 0 + for i := 0; i < n; i++ { + moves += abs(seats[i], students[i]) + } + return moves +} + +func abs(a, b int) int { + if a > b { + return a - b + } + return b - a +} diff --git a/leetcode/2037.Minimum-Number-of-Moves-to-Seat-Everyone/2037.Minimum Number of Moves to Seat Everyone_test.go b/leetcode/2037.Minimum-Number-of-Moves-to-Seat-Everyone/2037.Minimum Number of Moves to Seat Everyone_test.go new file mode 100644 index 000000000..17239790e --- /dev/null +++ b/leetcode/2037.Minimum-Number-of-Moves-to-Seat-Everyone/2037.Minimum Number of Moves to Seat Everyone_test.go @@ -0,0 +1,52 @@ +package leetcode + +import ( + "fmt" + "testing" +) + +type question2037 struct { + para2037 + ans2037 +} + +// para 是参数 +type para2037 struct { + seats []int + students []int +} + +// ans 是答案 +type ans2037 struct { + ans int +} + +func Test_Problem2037(t *testing.T) { + + qs := []question2037{ + + { + para2037{[]int{3, 1, 5}, []int{2, 7, 4}}, + ans2037{4}, + }, + + { + para2037{[]int{4, 1, 5, 9}, []int{1, 3, 2, 6}}, + ans2037{7}, + }, + + { + para2037{[]int{2, 2, 6, 6}, []int{1, 3, 2, 6}}, + ans2037{4}, + }, + } + + fmt.Printf("------------------------Leetcode Problem 2037------------------------\n") + + for _, q := range qs { + _, p := q.ans2037, q.para2037 + fmt.Printf("【input】:%v ", p) + fmt.Printf("【output】:%v \n", minMovesToSeat(p.seats, p.students)) + } + fmt.Printf("\n\n\n") +} diff --git a/leetcode/2037.Minimum-Number-of-Moves-to-Seat-Everyone/README.md b/leetcode/2037.Minimum-Number-of-Moves-to-Seat-Everyone/README.md new file mode 100644 index 000000000..beec7e76c --- /dev/null +++ b/leetcode/2037.Minimum-Number-of-Moves-to-Seat-Everyone/README.md @@ -0,0 +1,94 @@ +# [2037. Minimum Number of Moves to Seat Everyone](https://leetcode.com/problems/minimum-number-of-moves-to-seat-everyone/) + +## 题目 + +There are n seats and n students in a room. You are given an array seats of length n, where seats[i] is the position of the ith seat. You are also given the array students of length n, where students[j] is the position of the jth student. + +You may perform the following move any number of times: + +- Increase or decrease the position of the ith student by 1 (i.e., moving the ith student from position x to x + 1 or x - 1) + +Return the minimum number of moves required to move each student to a seat such that no two students are in the same seat. + +Note that there may be multiple seats or students in the same position at the beginning. + +**Example 1:** + + Input: seats = [3,1,5], students = [2,7,4] + Output: 4 + Explanation: The students are moved as follows: + - The first student is moved from from position 2 to position 1 using 1 move. + - The second student is moved from from position 7 to position 5 using 2 moves. + - The third student is moved from from position 4 to position 3 using 1 move. + In total, 1 + 2 + 1 = 4 moves were used. + +**Example 2:** + + Input: seats = [4,1,5,9], students = [1,3,2,6] + Output: 7 + Explanation: The students are moved as follows: + - The first student is not moved. + - The second student is moved from from position 3 to position 4 using 1 move. + - The third student is moved from from position 2 to position 5 using 3 moves. + - The fourth student is moved from from position 6 to position 9 using 3 moves. + In total, 0 + 1 + 3 + 3 = 7 moves were used. + +**Example 3:** + + Input: seats = [2,2,6,6], students = [1,3,2,6] + Output: 4 + Explanation: Note that there are two seats at position 2 and two seats at position 6. + The students are moved as follows: + - The first student is moved from from position 1 to position 2 using 1 move. + - The second student is moved from from position 3 to position 6 using 3 moves. + - The third student is not moved. + - The fourth student is not moved. + In total, 1 + 3 + 0 + 0 = 4 moves were used. + +**Constraints:** + +- n == seats.length == students.length +- 1 <= n <= 100 +- 1 <= seats[i], students[j] <= 100 + +## 题目大意 + +一个房间里有 n 个座位和 n 名学生,房间用一个数轴表示。给你一个长度为 n 的数组 seats,其中 seats[i] 是第 i 个座位的位置。同时给你一个长度为 n 的数组 students ,其中 students[j] 是第 j 位学生的位置。 + +你可以执行以下操作任意次: + +增加或者减少第 i 位学生的位置,每次变化量为 1(也就是将第 i 位学生从位置 x 移动到 x + 1或者 x - 1) + +请你返回使所有学生都有座位坐的最少移动次数,并确保没有两位学生的座位相同。 + +请注意,初始时有可能有多个座位或者多位学生在 同一位置。 + +## 解题思路 + +- 排序+模拟计算 + +# 代码 + +```go +package leetcode + +import "sort" + +func minMovesToSeat(seats []int, students []int) int { + sort.Ints(seats) + sort.Ints(students) + n := len(students) + moves := 0 + for i := 0; i < n; i++ { + moves += abs(seats[i], students[i]) + } + return moves +} + +func abs(a, b int) int { + if a > b { + return a - b + } + return b - a +} +``` \ No newline at end of file diff --git a/leetcode/2038.Remove-Colored-Pieces-if-Both-Neighbors-are-the-Same-Color/2038.Remove Colored Pieces if Both Neighbors are the Same Color.go b/leetcode/2038.Remove-Colored-Pieces-if-Both-Neighbors-are-the-Same-Color/2038.Remove Colored Pieces if Both Neighbors are the Same Color.go new file mode 100644 index 000000000..8962f957a --- /dev/null +++ b/leetcode/2038.Remove-Colored-Pieces-if-Both-Neighbors-are-the-Same-Color/2038.Remove Colored Pieces if Both Neighbors are the Same Color.go @@ -0,0 +1,25 @@ +package leetcode + +func winnerOfGame(colors string) bool { + As, Bs := 0, 0 + Acont, Bcont := 0, 0 + for _, color := range colors { + if color == 'A' { + Acont += 1 + Bcont = 0 + } else { + Bcont += 1 + Acont = 0 + } + if Acont >= 3 { + As += Acont - 2 + } + if Bcont >= 3 { + Bs += Bcont - 2 + } + } + if As > Bs { + return true + } + return false +} diff --git a/leetcode/2038.Remove-Colored-Pieces-if-Both-Neighbors-are-the-Same-Color/2038.Remove Colored Pieces if Both Neighbors are the Same Color_test.go b/leetcode/2038.Remove-Colored-Pieces-if-Both-Neighbors-are-the-Same-Color/2038.Remove Colored Pieces if Both Neighbors are the Same Color_test.go new file mode 100644 index 000000000..567eea1fe --- /dev/null +++ b/leetcode/2038.Remove-Colored-Pieces-if-Both-Neighbors-are-the-Same-Color/2038.Remove Colored Pieces if Both Neighbors are the Same Color_test.go @@ -0,0 +1,51 @@ +package leetcode + +import ( + "fmt" + "testing" +) + +type question2038 struct { + para2038 + ans2038 +} + +// para 是参数 +type para2038 struct { + colors string +} + +// ans 是答案 +type ans2038 struct { + ans bool +} + +func Test_Problem2038(t *testing.T) { + + qs := []question2038{ + + { + para2038{"AAABABB"}, + ans2038{true}, + }, + + { + para2038{"AA"}, + ans2038{false}, + }, + + { + para2038{"ABBBBBBBAAA"}, + ans2038{false}, + }, + } + + fmt.Printf("------------------------Leetcode Problem 2038------------------------\n") + + for _, q := range qs { + _, p := q.ans2038, q.para2038 + fmt.Printf("【input】:%v ", p.colors) + fmt.Printf("【output】:%v \n", winnerOfGame(p.colors)) + } + fmt.Printf("\n\n\n") +} diff --git a/leetcode/2038.Remove-Colored-Pieces-if-Both-Neighbors-are-the-Same-Color/README.md b/leetcode/2038.Remove-Colored-Pieces-if-Both-Neighbors-are-the-Same-Color/README.md new file mode 100644 index 000000000..fdf3e5525 --- /dev/null +++ b/leetcode/2038.Remove-Colored-Pieces-if-Both-Neighbors-are-the-Same-Color/README.md @@ -0,0 +1,105 @@ +# [2038. Remove Colored Pieces if Both Neighbors are the Same Color](https://leetcode.com/problems/remove-colored-pieces-if-both-neighbors-are-the-same-color/) + +## 题目 + +There are n pieces arranged in a line, and each piece is colored either by 'A' or by 'B'. You are given a string colors of length n where colors[i] is the color of the ith piece. + +Alice and Bob are playing a game where they take alternating turns removing pieces from the line. In this game, Alice moves first. + +- Alice is only allowed to remove a piece colored 'A' if both its neighbors are also colored 'A'. She is not allowed to remove pieces that are colored 'B'. +- Bob is only allowed to remove a piece colored 'B' if both its neighbors are also colored 'B'. He is not allowed to remove pieces that are colored 'A'. +- Alice and Bob cannot remove pieces from the edge of the line. +- If a player cannot make a move on their turn, that player loses and the other player wins. + +Assuming Alice and Bob play optimally, return true if Alice wins, or return false if Bob wins. + +**Example 1:** + + Input: colors = "AAABABB" + Output: true + Explanation: + AAABABB -> AABABB + Alice moves first. + She removes the second 'A' from the left since that is the only 'A' whose neighbors are both 'A'. + + Now it's Bob's turn. + Bob cannot make a move on his turn since there are no 'B's whose neighbors are both 'B'. + Thus, Alice wins, so return true. + +**Example 2:** + + Input: colors = "AA" + Output: false + Explanation: + Alice has her turn first. + There are only two 'A's and both are on the edge of the line, so she cannot move on her turn. + Thus, Bob wins, so return false. + +**Example 3:** + + Input: colors = "ABBBBBBBAAA" + Output: false + Explanation: + ABBBBBBBAAA -> ABBBBBBBAA + Alice moves first. + Her only option is to remove the second to last 'A' from the right. + + ABBBBBBBAA -> ABBBBBBAA + Next is Bob's turn. + He has many options for which 'B' piece to remove. He can pick any. + + On Alice's second turn, she has no more pieces that she can remove. + Thus, Bob wins, so return false. + +**Constraints:** + +- 1 <= colors.length <= 100000 +- colors consists of only the letters 'A' and 'B' + +## 题目大意 + +总共有 n 个颜色片段排成一列,每个颜色片段要么是 'A' 要么是 'B' 。给你一个长度为 n 的字符串 colors ,其中 colors[i] 表示第 i 个颜色片段的颜色。 + +Alice 和 Bob 在玩一个游戏,他们轮流从这个字符串中删除颜色。Alice 先手。 + +- 如果一个颜色片段为 'A' 且相邻两个颜色都是颜色 'A',那么 Alice 可以删除该颜色片段。Alice不可以删除任何颜色 'B' 片段。 +- 如果一个颜色片段为 'B'且相邻两个颜色都是颜色 'B' ,那么 Bob 可以删除该颜色片段。Bob 不可以删除任何颜色 'A' 片段。 +- Alice 和 Bob 不能从字符串两端删除颜色片段。 +- 如果其中一人无法继续操作,则该玩家 输掉游戏且另一玩家 获胜。 + +假设 Alice 和 Bob 都采用最优策略,如果 Alice 获胜,请返回true,否则 Bob 获胜,返回false。 + +## 解题思路 + +- 统计 Alice 和 Bob 分别可以操作的次数记为 As,Bs +- 因为 Alice 先手,所以只要 As 大于 Bs,Alice 获胜返回 true,否则 Bob 获胜返回 false + +# 代码 + +```go +package leetcode + +func winnerOfGame(colors string) bool { + As, Bs := 0, 0 + Acont, Bcont := 0, 0 + for _, color := range colors { + if color == 'A' { + Acont += 1 + Bcont = 0 + } else { + Bcont += 1 + Acont = 0 + } + if Acont >= 3 { + As += Acont - 2 + } + if Bcont >= 3 { + Bs += Bcont - 2 + } + } + if As > Bs { + return true + } + return false +} +``` \ No newline at end of file diff --git a/leetcode/2043.Simple-Bank-System/2043.Simple Bank System.go b/leetcode/2043.Simple-Bank-System/2043.Simple Bank System.go new file mode 100644 index 000000000..025ce2480 --- /dev/null +++ b/leetcode/2043.Simple-Bank-System/2043.Simple Bank System.go @@ -0,0 +1,44 @@ +package leetcode + +type Bank struct { + accounts []int64 + n int +} + +func Constructor(balance []int64) Bank { + return Bank{ + accounts: balance, + n: len(balance), + } +} + +func (this *Bank) Transfer(account1 int, account2 int, money int64) bool { + if account1 > this.n || account2 > this.n { + return false + } + if this.accounts[account1-1] < money { + return false + } + this.accounts[account1-1] -= money + this.accounts[account2-1] += money + return true +} + +func (this *Bank) Deposit(account int, money int64) bool { + if account > this.n { + return false + } + this.accounts[account-1] += money + return true +} + +func (this *Bank) Withdraw(account int, money int64) bool { + if account > this.n { + return false + } + if this.accounts[account-1] < money { + return false + } + this.accounts[account-1] -= money + return true +} diff --git a/leetcode/2043.Simple-Bank-System/2043.Simple Bank System_test.go b/leetcode/2043.Simple-Bank-System/2043.Simple Bank System_test.go new file mode 100644 index 000000000..96908986c --- /dev/null +++ b/leetcode/2043.Simple-Bank-System/2043.Simple Bank System_test.go @@ -0,0 +1,62 @@ +package leetcode + +import ( + "fmt" + "testing" +) + +type question2043 struct { + para2043 + ans2043 +} + +// para 是参数 +type para2043 struct { + ops []string + para [][]int64 +} + +// ans 是答案 +type ans2043 struct { + ans []bool +} + +func Test_Problem2043(t *testing.T) { + + qs := []question2043{ + + { + para2043{ + []string{"Bank", "withdraw", "transfer", "deposit", "transfer", "withdraw"}, + [][]int64{{10, 100, 20, 50, 30}, {3, 10}, {5, 1, 20}, {5, 20}, {3, 4, 15}, {10, 50}}}, + ans2043{[]bool{true, true, true, false, false}}, + }, + } + + fmt.Printf("------------------------Leetcode Problem 2043------------------------\n") + + for _, q := range qs { + var b Bank + var res []bool + _, p := q.ans2043, q.para2043 + for i, op := range p.ops { + if op == "Bank" { + b = Constructor(q.para[i]) + } else if op == "withdraw" { + isSuccess := b.Withdraw(int(p.para[i][0]), p.para[i][1]) + res = append(res, isSuccess) + } else if op == "transfer" { + isSuccess := b.Transfer(int(p.para[i][0]), int(p.para[i][0]), p.para[i][2]) + res = append(res, isSuccess) + } else if op == "deposit" { + isSuccess := b.Deposit(int(p.para[i][0]), p.para[i][1]) + res = append(res, isSuccess) + } else { + fmt.Println("unknown operation") + } + } + fmt.Printf("【input】:%v \n", p) + fmt.Printf("【output】:%v \n", res) + } + fmt.Printf("\n\n\n") +} diff --git a/leetcode/2043.Simple-Bank-System/README.md b/leetcode/2043.Simple-Bank-System/README.md new file mode 100644 index 000000000..abae43d3b --- /dev/null +++ b/leetcode/2043.Simple-Bank-System/README.md @@ -0,0 +1,113 @@ +# [2043. Simple Bank System](https://leetcode.com/problems/simple-bank-system/) + +## 题目 + +You have been tasked with writing a program for a popular bank that will automate all its incoming transactions (transfer, deposit, and withdraw). The bank has n accounts numbered from 1 to n. The initial balance of each account is stored in a 0-indexed integer array balance, with the (i + 1)th account having an initial balance of balance[i]. + +Execute all the valid transactions. A transaction is valid if: + +- The given account number(s) are between 1 and n, and +- The amount of money withdrawn or transferred from is less than or equal to the balance of the account. + +Implement the Bank class: + +- Bank(long[] balance) Initializes the object with the 0-indexed integer array balance. +- boolean transfer(int account1, int account2, long money) Transfers money dollars from the account numbered account1 to the account numbered account2. Return true if the transaction was successful, false otherwise. +- boolean deposit(int account, long money) Deposit money dollars into the account numbered account. Return true if the transaction was successful, false otherwise. +- boolean withdraw(int account, long money) Withdraw money dollars from the account numbered account. Return true if the transaction was successful, false otherwise. + +**Example 1:** + + Input + ["Bank", "withdraw", "transfer", "deposit", "transfer", "withdraw"] + [[[10, 100, 20, 50, 30]], [3, 10], [5, 1, 20], [5, 20], [3, 4, 15], [10, 50]] + Output + [null, true, true, true, false, false] + + Explanation + Bank bank = new Bank([10, 100, 20, 50, 30]); + bank.withdraw(3, 10); // return true, account 3 has a balance of $20, so it is valid to withdraw $10. + // Account 3 has $20 - $10 = $10. + bank.transfer(5, 1, 20); // return true, account 5 has a balance of $30, so it is valid to transfer $20. + // Account 5 has $30 - $20 = $10, and account 1 has $10 + $20 = $30. + bank.deposit(5, 20); // return true, it is valid to deposit $20 to account 5. + // Account 5 has $10 + $20 = $30. + bank.transfer(3, 4, 15); // return false, the current balance of account 3 is $10, + // so it is invalid to transfer $15 from it. + bank.withdraw(10, 50); // return false, it is invalid because account 10 does not exist. + +**Constraints:** + +- n == balance.length +- 1 <= n, account, account1, account2 <= 100000 +- 0 <= balance[i], money <= 1000000000000 +- At most 104 calls will be made to each function transfer, deposit, withdraw. + +## 题目大意 + +你的任务是为一个很受欢迎的银行设计一款程序,以自动化执行所有传入的交易(转账,存款和取款)。银行共有 n 个账户,编号从 1 到 n 。每个账号的初始余额存储在一个下标从 0 开始的整数数组 balance 中,其中第 (i + 1) 个账户的初始余额是 balance[i] 。 + +请你执行所有 有效的 交易。如果满足下面全部条件,则交易 有效 : + +- 指定的账户数量在 1 和 n 之间,且 +- 取款或者转账需要的钱的总数 小于或者等于 账户余额。 + +实现 Bank 类: + +- Bank(long[] balance) 使用下标从 0 开始的整数数组 balance 初始化该对象。 +- boolean transfer(int account1, int account2, long money) 从编号为 account1 的账户向编号为 account2 的账户转帐 money 美元。如果交易成功,返回 true ,否则,返回 false 。 +- boolean deposit(int account, long money) 向编号为 account 的账户存款 money 美元。如果交易成功,返回 true ;否则,返回 false 。 +- boolean withdraw(int account, long money) 从编号为 account 的账户取款 money 美元。如果交易成功,返回 true ;否则,返回 false 。 + +## 解题思路 + + 根据题意进行简单模拟 + +# 代码 + +```go +package leetcode + +type Bank struct { + accounts []int64 + n int +} + +func Constructor(balance []int64) Bank { + return Bank{ + accounts: balance, + n: len(balance), + } +} + +func (this *Bank) Transfer(account1 int, account2 int, money int64) bool { + if account1 > this.n || account2 > this.n { + return false + } + if this.accounts[account1-1] < money { + return false + } + this.accounts[account1-1] -= money + this.accounts[account2-1] += money + return true +} + +func (this *Bank) Deposit(account int, money int64) bool { + if account > this.n { + return false + } + this.accounts[account-1] += money + return true +} + +func (this *Bank) Withdraw(account int, money int64) bool { + if account > this.n { + return false + } + if this.accounts[account-1] < money { + return false + } + this.accounts[account-1] -= money + return true +} +``` \ No newline at end of file diff --git a/leetcode/2096.Step-By-Step-Directions-From-a-Binary-Tree-Node-to-Another/2096. Step-By-Step Directions From a Binary Tree Node to Another.go b/leetcode/2096.Step-By-Step-Directions-From-a-Binary-Tree-Node-to-Another/2096. Step-By-Step Directions From a Binary Tree Node to Another.go new file mode 100644 index 000000000..cd4f10897 --- /dev/null +++ b/leetcode/2096.Step-By-Step-Directions-From-a-Binary-Tree-Node-to-Another/2096. Step-By-Step Directions From a Binary Tree Node to Another.go @@ -0,0 +1,77 @@ +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 + * } + */ + +func getDirections(root *TreeNode, startValue int, destValue int) string { + sPath, dPath := make([]byte, 0), make([]byte, 0) + findPath(root, startValue, &sPath) + findPath(root, destValue, &dPath) + size, i := min(len(sPath), len(dPath)), 0 + for i < size { + if sPath[len(sPath)-1-i] == dPath[len(dPath)-1-i] { + i++ + } else { + break + } + } + sPath = sPath[:len(sPath)-i] + replace(sPath) + dPath = dPath[:len(dPath)-i] + reverse(dPath) + sPath = append(sPath, dPath...) + return string(sPath) +} + +func findPath(root *TreeNode, value int, path *[]byte) bool { + if root.Val == value { + return true + } + + if root.Left != nil && findPath(root.Left, value, path) { + *path = append(*path, 'L') + return true + } + + if root.Right != nil && findPath(root.Right, value, path) { + *path = append(*path, 'R') + return true + } + + return false +} + +func reverse(path []byte) { + left, right := 0, len(path)-1 + for left < right { + path[left], path[right] = path[right], path[left] + left++ + right-- + } +} + +func replace(path []byte) { + for i := 0; i < len(path); i++ { + path[i] = 'U' + } +} + +func min(i, j int) int { + if i < j { + return i + } + return j +} diff --git a/leetcode/2096.Step-By-Step-Directions-From-a-Binary-Tree-Node-to-Another/2096. Step-By-Step Directions From a Binary Tree Node to Another_test.go b/leetcode/2096.Step-By-Step-Directions-From-a-Binary-Tree-Node-to-Another/2096. Step-By-Step Directions From a Binary Tree Node to Another_test.go new file mode 100644 index 000000000..e30610185 --- /dev/null +++ b/leetcode/2096.Step-By-Step-Directions-From-a-Binary-Tree-Node-to-Another/2096. Step-By-Step Directions From a Binary Tree Node to Another_test.go @@ -0,0 +1,68 @@ +package leetcode + +import ( + "fmt" + "testing" + + "github.com/halfrost/LeetCode-Go/structures" +) + +type question2096 struct { + para2096 + ans2096 +} + +// para 是参数 +// one 代表第一个参数 +type para2096 struct { + one []int + startValue int + destValue int +} + +// ans 是答案 +// one 代表第一个答案 +type ans2096 struct { + one string +} + +func Test_Problem2096(t *testing.T) { + + qs := []question2096{ + + { + para2096{[]int{5, 1, 2, 3, structures.NULL, 6, 4}, 3, 6}, + ans2096{"UURL"}, + }, + + { + para2096{[]int{2, 1}, 2, 1}, + ans2096{"L"}, + }, + + { + para2096{[]int{1, 2}, 2, 1}, + ans2096{"U"}, + }, + + { + para2096{[]int{3, 1, 2}, 2, 1}, + ans2096{"UL"}, + }, + + { + para2096{[]int{7, 8, 3, 1, structures.NULL, 4, 5, 6, structures.NULL, structures.NULL, structures.NULL, structures.NULL, structures.NULL, structures.NULL, 2}, 7, 5}, + ans2096{"RR"}, + }, + } + + fmt.Printf("------------------------Leetcode Problem 2096------------------------\n") + + for _, q := range qs { + _, p := q.ans2096, q.para2096 + fmt.Printf("【input】:%v ", p) + root := structures.Ints2TreeNode(p.one) + fmt.Printf("【output】:%v \n", getDirections(root, p.startValue, p.destValue)) + } + fmt.Printf("\n\n\n") +} diff --git a/leetcode/2096.Step-By-Step-Directions-From-a-Binary-Tree-Node-to-Another/README.md b/leetcode/2096.Step-By-Step-Directions-From-a-Binary-Tree-Node-to-Another/README.md new file mode 100644 index 000000000..409608c8c --- /dev/null +++ b/leetcode/2096.Step-By-Step-Directions-From-a-Binary-Tree-Node-to-Another/README.md @@ -0,0 +1,145 @@ +# [2096. Step-By-Step Directions From a Binary Tree Node to Another](https://leetcode.com/problems/step-by-step-directions-from-a-binary-tree-node-to-another/) + + +## 题目 + +You are given the `root` of a **binary tree** with `n` nodes. Each node is uniquely assigned a value from `1` to `n`. You are also given an integer `startValue` representing the value of the start node `s`, and a different integer `destValue` representing the value of the destination node `t`. + +Find the **shortest path** starting from node `s` and ending at node `t`. Generate step-by-step directions of such path as a string consisting of only the **uppercase** letters `'L'`, `'R'`, and `'U'`. Each letter indicates a specific direction: + +- `'L'` means to go from a node to its **left child** node. +- `'R'` means to go from a node to its **right child** node. +- `'U'` means to go from a node to its **parent** node. + +Return *the step-by-step directions of the **shortest path** from node* `s` *to node* `t`. + +**Example 1:** + +![https://assets.leetcode.com/uploads/2021/11/15/eg1.png](https://assets.leetcode.com/uploads/2021/11/15/eg1.png) + +``` +Input: root = [5,1,2,3,null,6,4], startValue = 3, destValue = 6 +Output: "UURL" +Explanation: The shortest path is: 3 → 1 → 5 → 2 → 6. + +``` + +**Example 2:** + +![https://assets.leetcode.com/uploads/2021/11/15/eg2.png](https://assets.leetcode.com/uploads/2021/11/15/eg2.png) + +``` +Input: root = [2,1], startValue = 2, destValue = 1 +Output: "L" +Explanation: The shortest path is: 2 → 1. + +``` + +**Constraints:** + +- The number of nodes in the tree is `n`. +- `2 <= n <= 105` +- `1 <= Node.val <= n` +- All the values in the tree are **unique**. +- `1 <= startValue, destValue <= n` +- `startValue != destValue` + +## 题目大意 + +给你一棵 二叉树 的根节点 root ,这棵二叉树总共有 n 个节点。每个节点的值为 1 到 n 中的一个整数,且互不相同。给你一个整数 startValue ,表示起点节点 s 的值,和另一个不同的整数 destValue ,表示终点节点 t 的值。 + +请找到从节点 s 到节点 t 的 最短路径 ,并以字符串的形式返回每一步的方向。每一步用 大写 字母 'L' ,'R' 和 'U' 分别表示一种方向: + +- 'L' 表示从一个节点前往它的 左孩子 节点。 +- 'R' 表示从一个节点前往它的 右孩子 节点。 +- 'U' 表示从一个节点前往它的 父 节点。 + +请你返回从 s 到 t 最短路径 每一步的方向。 + +## 解题思路 + +- 二叉树中一个节点到另一个节点的最短路径一定可以分为两个部分(可能为空):从起点节点向上到两个节点的**最近公共祖先**,再从最近公共祖先向下到达终点节点。 +- 首先需要找到起点 s 与公共祖先的节点之间的 path1,公共祖先节点与终点 t 的 path2。再删掉 2 个 path 的公共前缀。如果起点 s 和终点 t 在不同的分支上,不存在公共前缀。如果他们在相同的分支上,那么最终答案要去掉这个公共前缀。 +- 删除掉公共前缀以后,需要再整理一下最终答案的输出格式。由于题目要求,起点到公共祖先节点需要输出 U,所以把这段 path1 全部改成 U,然后再拼接上 path2 字符串,即可得到的字符串即为待求 ss 到 tt 每一步的最短路径。 + +## 代码 + +```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 + * } + */ + +func getDirections(root *TreeNode, startValue int, destValue int) string { + sPath, dPath := make([]byte, 0), make([]byte, 0) + findPath(root, startValue, &sPath) + findPath(root, destValue, &dPath) + size, i := min(len(sPath), len(dPath)), 0 + for i < size { + if sPath[len(sPath)-1-i] == dPath[len(dPath)-1-i] { + i++ + } else { + break + } + } + sPath = sPath[:len(sPath)-i] + replace(sPath) + dPath = dPath[:len(dPath)-i] + reverse(dPath) + sPath = append(sPath, dPath...) + return string(sPath) +} + +func findPath(root *TreeNode, value int, path *[]byte) bool { + if root.Val == value { + return true + } + + if root.Left != nil && findPath(root.Left, value, path) { + *path = append(*path, 'L') + return true + } + + if root.Right != nil && findPath(root.Right, value, path) { + *path = append(*path, 'R') + return true + } + + return false +} + +func reverse(path []byte) { + left, right := 0, len(path)-1 + for left < right { + path[left], path[right] = path[right], path[left] + left++ + right-- + } +} + +func replace(path []byte) { + for i := 0; i < len(path); i++ { + path[i] = 'U' + } +} + +func min(i, j int) int { + if i < j { + return i + } + return j +} +``` \ No newline at end of file diff --git a/note/time_complexity.md b/note/time_complexity.md index 237e34f1e..174aad59f 100644 --- a/note/time_complexity.md +++ b/note/time_complexity.md @@ -99,7 +99,7 @@ int binarySearch(int arr[], int l, int r, int target){ return mid; else if (arr[mid]>target) return binarySearch(arr,l,mid-1,target); - eles + else return binarySearch(arr,mid+1,r,target); } @@ -124,4 +124,4 @@ int f(int n){ 上述这次递归调用的次数为 2^0^ + 2^1^ + 2^2^ + …… + 2^n^ = 2^n+1^ - 1 = O(2^n) -> 关于更加复杂的递归的复杂度分析,请参考,主定理。主定理中针对各种复杂情况都给出了正确的结论。 \ No newline at end of file +> 关于更加复杂的递归的复杂度分析,请参考,主定理。主定理中针对各种复杂情况都给出了正确的结论。 diff --git a/structures/Heap_test.go b/structures/Heap_test.go index 8e6a30c40..af8291f52 100644 --- a/structures/Heap_test.go +++ b/structures/Heap_test.go @@ -20,7 +20,7 @@ func Test_intHeap(t *testing.T) { begin, end := 0, 10 for i := begin; i < end; i++ { heap.Push(ih, i) - ast.Equal(0, (*ih)[0], "插入 %d 后的最小值却是 %d,ih=%v", i, (*ih)[0], (*ih)) + ast.Equal(0, (*ih)[0], "插入 %d 后的最小值却是 %d, ih=%v", i, (*ih)[0], (*ih)) } for i := begin; i < end; i++ { diff --git a/structures/TreeNode.go b/structures/TreeNode.go index f6edb9c4b..99060be17 100644 --- a/structures/TreeNode.go +++ b/structures/TreeNode.go @@ -2,6 +2,7 @@ package structures import ( "fmt" + "strconv" ) // TreeNode is tree's node @@ -218,7 +219,7 @@ func Tree2ints(tn *TreeNode) []int { return res[:i] } -// T2s convert *TreeNode to []int +// T2s converts *TreeNode to []int func T2s(head *TreeNode, array *[]int) { fmt.Printf("运行到这里了 head = %v array = %v\n", head, array) // fmt.Printf("****array = %v\n", array) @@ -231,3 +232,83 @@ func T2s(head *TreeNode, array *[]int) { T2s(head.Right, array) } } + +// Strings2TreeNode converts []string to *TreeNode +func Strings2TreeNode(strs []string) *TreeNode { + n := len(strs) + if n == 0 { + return nil + } + x, _ := strconv.Atoi(strs[0]) + root := &TreeNode{Val: x} + queue := make([]*TreeNode, 1, n<<1) + queue[0] = root + i := 1 + for i < n { + node := queue[0] + queue = queue[1:] + if i < n && strs[i] != "null" { + x, _ = strconv.Atoi(strs[i]) + node.Left = &TreeNode{Val: x} + queue = append(queue, node.Left) + } + i++ + if i < n && strs[i] != "null" { + x, _ = strconv.Atoi(strs[i]) + node.Right = &TreeNode{Val: x} + queue = append(queue, node.Right) + } + i++ + } + return root +} + +// Tree2LevelOrderStrings converts *TreeNode into []string by level order traversal. +func Tree2LevelOrderStrings(root *TreeNode) []string { + var ans []string + if root == nil { + return ans + } + queue := []*TreeNode{root} + var level int + for level = 0; len(queue) > 0; level++ { + size := len(queue) + for i := 0; i < size; i++ { + node := queue[i] + if node == nil { + ans = append(ans, "null") + } else { + ans = append(ans, strconv.Itoa(node.Val)) + if node.Left != nil || node.Right != nil { + queue = append(queue, node.Left, node.Right) + } + } + } + queue = queue[size:] + } + level-- + return ans +} + +// Tree2PreOrderStrings converts *TreeNode into []string by preorder traversal. +func Tree2PreOrderStrings(root *TreeNode) []string { + var ans []string + if root == nil { + return ans + } + stack := []*TreeNode{root} + node := root + for len(stack) > 0 { + if node == nil { + ans = append(ans, "null") + } + for node != nil { + ans = append(ans, strconv.Itoa(node.Val)) + stack = append(stack, node) + node = node.Left + } + node = stack[len(stack)-1].Right + stack = stack[:len(stack)-1] + } + return ans +} diff --git a/structures/go.mod b/structures/go.mod new file mode 100644 index 000000000..53c9843a0 --- /dev/null +++ b/structures/go.mod @@ -0,0 +1,11 @@ +module github.com/halfrost/LeetCode-Go/structures + +go 1.19 + +require github.com/stretchr/testify v1.8.0 + +require ( + github.com/davecgh/go-spew v1.1.1 // indirect + github.com/pmezard/go-difflib v1.0.0 // indirect + gopkg.in/yaml.v3 v3.0.1 // indirect +) diff --git a/structures/go.sum b/structures/go.sum new file mode 100644 index 000000000..51648299d --- /dev/null +++ b/structures/go.sum @@ -0,0 +1,15 @@ +github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= +github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.8.0 h1:pSgiaMZlXftHpm5L7V1+rVB+AZJydKsMxsQBIJw4PKk= +github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= +gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/template/CLRUCache.go b/template/CLRUCache.go index 03b5115c6..9738fb86e 100644 --- a/template/CLRUCache.go +++ b/template/CLRUCache.go @@ -132,7 +132,7 @@ func (c *CLRUCache) worker() { for { select { case el, ok := <-c.movePairs: - if ok == false { + if !ok { goto clean } if c.doMove(el) && c.list.Len() > c.cap { diff --git a/template/go.mod b/template/go.mod new file mode 100644 index 000000000..6ef287eab --- /dev/null +++ b/template/go.mod @@ -0,0 +1,11 @@ +module github.com/halfrost/LeetCode-Go/template + +go 1.19 + +require github.com/stretchr/testify v1.8.0 + +require ( + github.com/davecgh/go-spew v1.1.1 // indirect + github.com/pmezard/go-difflib v1.0.0 // indirect + gopkg.in/yaml.v3 v3.0.1 // indirect +) diff --git a/template/go.sum b/template/go.sum new file mode 100644 index 000000000..51648299d --- /dev/null +++ b/template/go.sum @@ -0,0 +1,15 @@ +github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= +github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.8.0 h1:pSgiaMZlXftHpm5L7V1+rVB+AZJydKsMxsQBIJw4PKk= +github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= +gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/website/content/ChapterFour/0001~0099/0019.Remove-Nth-Node-From-End-of-List.md b/website/content/ChapterFour/0001~0099/0019.Remove-Nth-Node-From-End-of-List.md index e1f772b9b..0a511762f 100644 --- a/website/content/ChapterFour/0001~0099/0019.Remove-Nth-Node-From-End-of-List.md +++ b/website/content/ChapterFour/0001~0099/0019.Remove-Nth-Node-From-End-of-List.md @@ -55,7 +55,7 @@ Output: [1] package leetcode import ( - "github.com/halfrost/LeetCode-Go/structures" + "github.com/halfrost/leetcode-go/structures" ) // ListNode define diff --git a/website/content/ChapterFour/0001~0099/0024.Swap-Nodes-in-Pairs.md b/website/content/ChapterFour/0001~0099/0024.Swap-Nodes-in-Pairs.md index 40d6ca232..460110543 100644 --- a/website/content/ChapterFour/0001~0099/0024.Swap-Nodes-in-Pairs.md +++ b/website/content/ChapterFour/0001~0099/0024.Swap-Nodes-in-Pairs.md @@ -31,7 +31,7 @@ Given 1->2->3->4, you should return the list as 2->1->4->3. package leetcode import ( - "github.com/halfrost/LeetCode-Go/structures" + "github.com/halfrost/leetcode-go/structures" ) // ListNode define diff --git a/website/content/ChapterFour/0001~0099/0027.Remove-Element.md b/website/content/ChapterFour/0001~0099/0027.Remove-Element.md index 7f77f8207..ef1a75df3 100644 --- a/website/content/ChapterFour/0001~0099/0027.Remove-Element.md +++ b/website/content/ChapterFour/0001~0099/0027.Remove-Element.md @@ -94,5 +94,5 @@ func removeElement(nums []int, val int) int { ----------------------------------------------

⬅️上一页

-

下一页➡️

+

下一页➡️

diff --git a/website/content/ChapterFour/0001~0099/0028.Implement-strStr.md b/website/content/ChapterFour/0001~0099/0028.Find-the-Index-of-the-First-Occurrence-in-a-String.md similarity index 92% rename from website/content/ChapterFour/0001~0099/0028.Implement-strStr.md rename to website/content/ChapterFour/0001~0099/0028.Find-the-Index-of-the-First-Occurrence-in-a-String.md index b7c44e241..ee3577638 100644 --- a/website/content/ChapterFour/0001~0099/0028.Implement-strStr.md +++ b/website/content/ChapterFour/0001~0099/0028.Find-the-Index-of-the-First-Occurrence-in-a-String.md @@ -1,4 +1,4 @@ -# [28. Implement strStr()](https://leetcode.com/problems/implement-strstr/) +# [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/) ## 题目 diff --git a/website/content/ChapterFour/0001~0099/0029.Divide-Two-Integers.md b/website/content/ChapterFour/0001~0099/0029.Divide-Two-Integers.md index aa5672d1c..72f2e1062 100755 --- a/website/content/ChapterFour/0001~0099/0029.Divide-Two-Integers.md +++ b/website/content/ChapterFour/0001~0099/0029.Divide-Two-Integers.md @@ -150,6 +150,6 @@ func divide1(divided int, divisor int) int { ----------------------------------------------
-

⬅️上一页

+

⬅️上一页

下一页➡️

diff --git a/website/content/ChapterFour/0001~0099/0040.Combination-Sum-II.md b/website/content/ChapterFour/0001~0099/0040.Combination-Sum-II.md index 4a0185edb..aa46f3f10 100755 --- a/website/content/ChapterFour/0001~0099/0040.Combination-Sum-II.md +++ b/website/content/ChapterFour/0001~0099/0040.Combination-Sum-II.md @@ -45,7 +45,7 @@ candidates 中的每个数字在每个组合中只能使用一次。 ## 解题思路 - 题目要求出总和为 sum 的所有组合,组合需要去重。这一题是第 39 题的加强版,第 39 题中元素可以重复利用(重复元素可无限次使用),这一题中元素只能有限次数的利用,因为存在重复元素,并且每个元素只能用一次(重复元素只能使用有限次) -- 这一题和第 47 题类似,只不过元素可以反复使用。 +- 这一题和第 47 题类似。 ## 代码 diff --git a/website/content/ChapterFour/0100~0199/0101.Symmetric-Tree.md b/website/content/ChapterFour/0100~0199/0101.Symmetric-Tree.md index 073767bc8..2b9de1e98 100644 --- a/website/content/ChapterFour/0100~0199/0101.Symmetric-Tree.md +++ b/website/content/ChapterFour/0100~0199/0101.Symmetric-Tree.md @@ -54,7 +54,7 @@ Bonus points if you could solve it both recursively and iteratively. package leetcode import ( - "github.com/halfrost/LeetCode-Go/structures" + "github.com/halfrost/leetcode-go/structures" ) // TreeNode define diff --git a/website/content/ChapterFour/0100~0199/0102.Binary-Tree-Level-Order-Traversal.md b/website/content/ChapterFour/0100~0199/0102.Binary-Tree-Level-Order-Traversal.md index 226aafe4d..68f93c42a 100644 --- a/website/content/ChapterFour/0100~0199/0102.Binary-Tree-Level-Order-Traversal.md +++ b/website/content/ChapterFour/0100~0199/0102.Binary-Tree-Level-Order-Traversal.md @@ -51,7 +51,7 @@ return its level order traversal as: package leetcode import ( - "github.com/halfrost/LeetCode-Go/structures" + "github.com/halfrost/leetcode-go/structures" ) // TreeNode define diff --git a/website/content/ChapterFour/0100~0199/0103.Binary-Tree-Zigzag-Level-Order-Traversal.md b/website/content/ChapterFour/0100~0199/0103.Binary-Tree-Zigzag-Level-Order-Traversal.md index 9553543e8..0afad6242 100644 --- a/website/content/ChapterFour/0100~0199/0103.Binary-Tree-Zigzag-Level-Order-Traversal.md +++ b/website/content/ChapterFour/0100~0199/0103.Binary-Tree-Zigzag-Level-Order-Traversal.md @@ -49,7 +49,7 @@ return its zigzag level order traversal as: package leetcode import ( - "github.com/halfrost/LeetCode-Go/structures" + "github.com/halfrost/leetcode-go/structures" ) // TreeNode define diff --git a/website/content/ChapterFour/0100~0199/0105.Construct-Binary-Tree-from-Preorder-and-Inorder-Traversal.md b/website/content/ChapterFour/0100~0199/0105.Construct-Binary-Tree-from-Preorder-and-Inorder-Traversal.md index 2db8b8bbb..556a6da65 100755 --- a/website/content/ChapterFour/0100~0199/0105.Construct-Binary-Tree-from-Preorder-and-Inorder-Traversal.md +++ b/website/content/ChapterFour/0100~0199/0105.Construct-Binary-Tree-from-Preorder-and-Inorder-Traversal.md @@ -43,7 +43,7 @@ Return the following binary tree: package leetcode import ( - "github.com/halfrost/LeetCode-Go/structures" + "github.com/halfrost/leetcode-go/structures" ) // TreeNode define diff --git a/website/content/ChapterFour/0100~0199/0106.Construct-Binary-Tree-from-Inorder-and-Postorder-Traversal.md b/website/content/ChapterFour/0100~0199/0106.Construct-Binary-Tree-from-Inorder-and-Postorder-Traversal.md index 85761740d..fe051ed8c 100755 --- a/website/content/ChapterFour/0100~0199/0106.Construct-Binary-Tree-from-Inorder-and-Postorder-Traversal.md +++ b/website/content/ChapterFour/0100~0199/0106.Construct-Binary-Tree-from-Inorder-and-Postorder-Traversal.md @@ -41,7 +41,7 @@ Return the following binary tree: package leetcode import ( - "github.com/halfrost/LeetCode-Go/structures" + "github.com/halfrost/leetcode-go/structures" ) // TreeNode define diff --git a/website/content/ChapterFour/0100~0199/0128.Longest-Consecutive-Sequence.md b/website/content/ChapterFour/0100~0199/0128.Longest-Consecutive-Sequence.md index ef76f90d5..fddce0f06 100755 --- a/website/content/ChapterFour/0100~0199/0128.Longest-Consecutive-Sequence.md +++ b/website/content/ChapterFour/0100~0199/0128.Longest-Consecutive-Sequence.md @@ -37,7 +37,7 @@ Your algorithm should run in O(*n*) complexity. package leetcode import ( - "github.com/halfrost/LeetCode-Go/template" + "github.com/halfrost/leetcode-go/template" ) // 解法一 map,时间复杂度 O(n) diff --git a/website/content/ChapterFour/0100~0199/0129.Sum-Root-to-Leaf-Numbers.md b/website/content/ChapterFour/0100~0199/0129.Sum-Root-to-Leaf-Numbers.md index 0902f5543..312f4a066 100755 --- a/website/content/ChapterFour/0100~0199/0129.Sum-Root-to-Leaf-Numbers.md +++ b/website/content/ChapterFour/0100~0199/0129.Sum-Root-to-Leaf-Numbers.md @@ -55,7 +55,7 @@ Find the total sum of all root-to-leaf numbers. package leetcode import ( - "github.com/halfrost/LeetCode-Go/structures" + "github.com/halfrost/leetcode-go/structures" ) // TreeNode define diff --git a/website/content/ChapterFour/0100~0199/0130.Surrounded-Regions.md b/website/content/ChapterFour/0100~0199/0130.Surrounded-Regions.md index 3211fb082..279e9551b 100755 --- a/website/content/ChapterFour/0100~0199/0130.Surrounded-Regions.md +++ b/website/content/ChapterFour/0100~0199/0130.Surrounded-Regions.md @@ -46,7 +46,7 @@ Surrounded regions shouldn’t be on the border, which means that any `'O'` on package leetcode import ( - "github.com/halfrost/LeetCode-Go/template" + "github.com/halfrost/leetcode-go/template" ) // 解法一 并查集 diff --git a/website/content/ChapterFour/0100~0199/0141.Linked-List-Cycle.md b/website/content/ChapterFour/0100~0199/0141.Linked-List-Cycle.md index 538ac06cd..96c3310bd 100644 --- a/website/content/ChapterFour/0100~0199/0141.Linked-List-Cycle.md +++ b/website/content/ChapterFour/0100~0199/0141.Linked-List-Cycle.md @@ -24,7 +24,7 @@ Can you solve it without using extra space? package leetcode import ( - "github.com/halfrost/LeetCode-Go/structures" + "github.com/halfrost/leetcode-go/structures" ) // ListNode define diff --git a/website/content/ChapterFour/0100~0199/0143.Reorder-List.md b/website/content/ChapterFour/0100~0199/0143.Reorder-List.md index bd9b24690..4e835246c 100644 --- a/website/content/ChapterFour/0100~0199/0143.Reorder-List.md +++ b/website/content/ChapterFour/0100~0199/0143.Reorder-List.md @@ -35,7 +35,7 @@ Given 1->2->3->4->5, reorder it to 1->5->2->4->3. 更好的做法是结合之前几道题的操作:链表逆序,找中间结点。 -先找到链表的中间结点,然后利用逆序区间的操作,如 [第 92 题](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0092.Reverse-Linked-List-II) 里的 reverseBetween() 操作,只不过这里的反转区间是从中点一直到末尾。最后利用 2 个指针,一个指向头结点,一个指向中间结点,开始拼接最终的结果。这种做法的时间复杂度是 O(n),空间复杂度是 O(1)。 +先找到链表的中间结点,然后利用逆序区间的操作,如 [第 92 题](https://github.com/halfrost/leetcode-go/tree/master/leetcode/0092.Reverse-Linked-List-II) 里的 reverseBetween() 操作,只不过这里的反转区间是从中点一直到末尾。最后利用 2 个指针,一个指向头结点,一个指向中间结点,开始拼接最终的结果。这种做法的时间复杂度是 O(n),空间复杂度是 O(1)。 ## 代码 diff --git a/website/content/ChapterFour/0100~0199/0173.Binary-Search-Tree-Iterator.md b/website/content/ChapterFour/0100~0199/0173.Binary-Search-Tree-Iterator.md index eb4b039c7..559f61217 100755 --- a/website/content/ChapterFour/0100~0199/0173.Binary-Search-Tree-Iterator.md +++ b/website/content/ChapterFour/0100~0199/0173.Binary-Search-Tree-Iterator.md @@ -47,7 +47,7 @@ package leetcode import ( "container/heap" - "github.com/halfrost/LeetCode-Go/structures" + "github.com/halfrost/leetcode-go/structures" ) // TreeNode define diff --git a/website/content/ChapterFour/0200~0299/0215.Kth-Largest-Element-in-an-Array.md b/website/content/ChapterFour/0200~0299/0215.Kth-Largest-Element-in-an-Array.md index 836cda403..0213a51c2 100644 --- a/website/content/ChapterFour/0200~0299/0215.Kth-Largest-Element-in-an-Array.md +++ b/website/content/ChapterFour/0200~0299/0215.Kth-Largest-Element-in-an-Array.md @@ -33,8 +33,8 @@ You may assume k is always valid, 1 ≤ k ≤ array's length. ## 解题思路 -- 在快排的 partition 操作中,每次 partition 操作结束都会返回一个点,这个标定点的下标和最终排序之后有序数组中这个元素所在的下标是一致的。利用这个特性,我们可以不断的划分数组区间,最终找到第 K 大的元素。执行一次 partition 操作以后,如果这个元素的下标比 K 小,那么接着就在后边的区间继续执行 partition 操作;如果这个元素的下标比 K 大,那么就在左边的区间继续执行 partition 操作;如果相等就直接输出这个下标对应的数组元素即可。 -- 快排的思路实现的算法时间复杂度为 O(n),空间复杂度为 O(logn)。由于证明过程很繁琐,所以不再这里展开讲。具体证明可以参考《算法导论》第 9 章第 2 小节。 +- 在快速选择 quickselect 的 partition 操作中,每次 partition 操作结束都会返回一个点,这个标定点的下标和最终排序之后有序数组中这个元素所在的下标是一致的。利用这个特性,我们可以不断的划分数组区间,最终找到第 K 大的元素。执行一次 partition 操作以后,如果这个元素的下标比 K 小,那么接着就在后边的区间继续执行 partition 操作;如果这个元素的下标比 K 大,那么就在左边的区间继续执行 partition 操作;如果相等就直接输出这个下标对应的数组元素即可。 +- 快速选择 quickselect 的思路实现的算法时间复杂度为 O(n),空间复杂度为 O(logn)。由于证明过程很繁琐,所以不再这里展开讲。具体证明可以参考《算法导论》第 9 章第 2 小节。 ## 代码 diff --git a/website/content/ChapterFour/0200~0299/0218.The-Skyline-Problem.md b/website/content/ChapterFour/0200~0299/0218.The-Skyline-Problem.md index cef3bd5d1..e563455f6 100755 --- a/website/content/ChapterFour/0200~0299/0218.The-Skyline-Problem.md +++ b/website/content/ChapterFour/0200~0299/0218.The-Skyline-Problem.md @@ -84,7 +84,7 @@ package leetcode import ( "sort" - "github.com/halfrost/LeetCode-Go/template" + "github.com/halfrost/leetcode-go/template" ) // 解法一 树状数组,时间复杂度 O(n log n) diff --git a/website/content/ChapterFour/0200~0299/0234.Palindrome-Linked-List.md b/website/content/ChapterFour/0200~0299/0234.Palindrome-Linked-List.md index f5353419c..2870f9571 100644 --- a/website/content/ChapterFour/0200~0299/0234.Palindrome-Linked-List.md +++ b/website/content/ChapterFour/0200~0299/0234.Palindrome-Linked-List.md @@ -41,7 +41,7 @@ Could you do it in O(n) time and O(1) space? package leetcode import ( - "github.com/halfrost/LeetCode-Go/structures" + "github.com/halfrost/leetcode-go/structures" ) // ListNode define diff --git a/website/content/ChapterFour/0200~0299/0237.Delete-Node-in-a-Linked-List.md b/website/content/ChapterFour/0200~0299/0237.Delete-Node-in-a-Linked-List.md index abff25624..e8690ff52 100644 --- a/website/content/ChapterFour/0200~0299/0237.Delete-Node-in-a-Linked-List.md +++ b/website/content/ChapterFour/0200~0299/0237.Delete-Node-in-a-Linked-List.md @@ -74,7 +74,7 @@ Output: [5,-99] package leetcode import ( - "github.com/halfrost/LeetCode-Go/structures" + "github.com/halfrost/leetcode-go/structures" ) // ListNode define diff --git a/website/content/ChapterFour/0200~0299/0297.Serialize-and-Deserialize-Binary-Tree.md b/website/content/ChapterFour/0200~0299/0297.Serialize-and-Deserialize-Binary-Tree.md index e90565ebd..dc86b67fa 100644 --- a/website/content/ChapterFour/0200~0299/0297.Serialize-and-Deserialize-Binary-Tree.md +++ b/website/content/ChapterFour/0200~0299/0297.Serialize-and-Deserialize-Binary-Tree.md @@ -62,7 +62,7 @@ import ( "strconv" "strings" - "github.com/halfrost/LeetCode-Go/structures" + "github.com/halfrost/leetcode-go/structures" ) type TreeNode = structures.TreeNode diff --git a/website/content/ChapterFour/0300~0399/0303.Range-Sum-Query-Immutable.md b/website/content/ChapterFour/0300~0399/0303.Range-Sum-Query-Immutable.md index 3c460a456..8b49288ba 100755 --- a/website/content/ChapterFour/0300~0399/0303.Range-Sum-Query-Immutable.md +++ b/website/content/ChapterFour/0300~0399/0303.Range-Sum-Query-Immutable.md @@ -54,7 +54,7 @@ sumRange(0, 5) -> -3 package leetcode import ( - "github.com/halfrost/LeetCode-Go/template" + "github.com/halfrost/leetcode-go/template" ) //解法一 线段树,sumRange 时间复杂度 O(1) diff --git a/website/content/ChapterFour/0300~0399/0307.Range-Sum-Query-Mutable.md b/website/content/ChapterFour/0300~0399/0307.Range-Sum-Query-Mutable.md index 99db86f66..50b02e262 100755 --- a/website/content/ChapterFour/0300~0399/0307.Range-Sum-Query-Mutable.md +++ b/website/content/ChapterFour/0300~0399/0307.Range-Sum-Query-Mutable.md @@ -57,7 +57,7 @@ sumRange(0, 2) -> 8 package leetcode -import "github.com/halfrost/LeetCode-Go/template" +import "github.com/halfrost/leetcode-go/template" // NumArray define type NumArray struct { diff --git a/website/content/ChapterFour/0300~0399/0315.Count-of-Smaller-Numbers-After-Self.md b/website/content/ChapterFour/0300~0399/0315.Count-of-Smaller-Numbers-After-Self.md index 5988c80d2..ac37bace0 100755 --- a/website/content/ChapterFour/0300~0399/0315.Count-of-Smaller-Numbers-After-Self.md +++ b/website/content/ChapterFour/0300~0399/0315.Count-of-Smaller-Numbers-After-Self.md @@ -52,7 +52,7 @@ package leetcode import ( "sort" - "github.com/halfrost/LeetCode-Go/template" + "github.com/halfrost/leetcode-go/template" ) // 解法一 线段树 diff --git a/website/content/ChapterFour/0300~0399/0327.Count-of-Range-Sum.md b/website/content/ChapterFour/0300~0399/0327.Count-of-Range-Sum.md index 4fc79c875..6b57a221f 100755 --- a/website/content/ChapterFour/0300~0399/0327.Count-of-Range-Sum.md +++ b/website/content/ChapterFour/0300~0399/0327.Count-of-Range-Sum.md @@ -88,7 +88,7 @@ package leetcode import ( "sort" - "github.com/halfrost/LeetCode-Go/template" + "github.com/halfrost/leetcode-go/template" ) // 解法一 线段树,时间复杂度 O(n log n) diff --git a/website/content/ChapterFour/0300~0399/0382.Linked-List-Random-Node.md b/website/content/ChapterFour/0300~0399/0382.Linked-List-Random-Node.md index f6ccc92aa..449c5aaa8 100644 --- a/website/content/ChapterFour/0300~0399/0382.Linked-List-Random-Node.md +++ b/website/content/ChapterFour/0300~0399/0382.Linked-List-Random-Node.md @@ -61,7 +61,7 @@ package leetcode import ( "math/rand" - "github.com/halfrost/LeetCode-Go/structures" + "github.com/halfrost/leetcode-go/structures" ) // ListNode define diff --git a/website/content/ChapterFour/0300~0399/0395.Longest-Substring-with-At-Least-K-Repeating-Characters.md b/website/content/ChapterFour/0300~0399/0395.Longest-Substring-with-At-Least-K-Repeating-Characters.md index 190d81d1d..5c3966441 100644 --- a/website/content/ChapterFour/0300~0399/0395.Longest-Substring-with-At-Least-K-Repeating-Characters.md +++ b/website/content/ChapterFour/0300~0399/0395.Longest-Substring-with-At-Least-K-Repeating-Characters.md @@ -115,5 +115,5 @@ func longestSubstring1(s string, k int) int { ----------------------------------------------

⬅️上一页

-

下一页➡️

+

下一页➡️

diff --git a/website/content/ChapterFour/0300~0399/0396.Rotate-Function.md b/website/content/ChapterFour/0300~0399/0396.Rotate-Function.md new file mode 100644 index 000000000..95a661c99 --- /dev/null +++ b/website/content/ChapterFour/0300~0399/0396.Rotate-Function.md @@ -0,0 +1,117 @@ +# [396. Rotate Function](https://leetcode.com/problems/rotate-function/) + +## 题目 + +You are given an integer array `nums` of length `n`. + +Assume `arrk` to be an array obtained by rotating `nums` by `k` positions clock-wise. We define the **rotation function** `F` on `nums` as follow: + +- `F(k) = 0 * arrk[0] + 1 * arrk[1] + ... + (n - 1) * arrk[n - 1]`. + +Return the maximum value of `F(0), F(1), ..., F(n-1)`. + +The test cases are generated so that the answer fits in a **32-bit** integer. + +**Example 1:** + +```c +Input: nums = [4,3,2,6] +Output: 26 +Explanation: +F(0) = (0 * 4) + (1 * 3) + (2 * 2) + (3 * 6) = 0 + 3 + 4 + 18 = 25 +F(1) = (0 * 6) + (1 * 4) + (2 * 3) + (3 * 2) = 0 + 4 + 6 + 6 = 16 +F(2) = (0 * 2) + (1 * 6) + (2 * 4) + (3 * 3) = 0 + 6 + 8 + 9 = 23 +F(3) = (0 * 3) + (1 * 2) + (2 * 6) + (3 * 4) = 0 + 2 + 12 + 12 = 26 +So the maximum value of F(0), F(1), F(2), F(3) is F(3) = 26. +``` + +**Example 2:** + +```c +Input: nums = [100] +Output: 0 +``` + +**Constraints:** + +- `n == nums.length` +- `1 <= n <= 105` +- `-100 <= nums[i] <= 100` + +## 题目大意 + +给定一个长度为`n`的整数数组`nums`,设`arrk`是数组`nums`顺时针旋转`k`个位置后的数组。 + +定义`nums`的旋转函数`F`为: + +- `F(k) = 0 * arrk[0] + 1 * arrk[1] + ... + (n - 1) * arrk[n - 1]` + +返回`F(0), F(1), ..., F(n-1)`中的最大值。 + +## 解题思路 + +**抽象化观察:** + +```c +nums = [A0, A1, A2, A3] + +sum = A0 + A1 + A2+ A3 +F(0) = 0*A0 +0*A0 + 1*A1 + 2*A2 + 3*A3 + +F(1) = 0*A3 + 1*A0 + 2*A1 + 3*A2 + = F(0) + (A0 + A1 + A2) - 3*A3 + = F(0) + (sum-A3) - 3*A3 + = F(0) + sum - 4*A3 + +F(2) = 0*A2 + 1*A3 + 2*A0 + 3*A1 + = F(1) + A3 + A0 + A1 - 3*A2 + = F(1) + sum - 4*A2 + +F(3) = 0*A1 + 1*A2 + 2*A3 + 3*A0 + = F(2) + A2 + A3 + A0 - 3*A1 + = F(2) + sum - 4*A1 + +// 记sum为nums数组中所有元素和 +// 可以猜测当0 ≤ i < n时存在公式: +F(i) = F(i-1) + sum - n * A(n-i) +``` + +**数学归纳法证明迭代公式:** + +根据题目中给定的旋转函数公式可得已知条件: + +- `F(0) = 0×nums[0] + 1×nums[1] + ... + (n−1)×nums[n−1]`; + +- `F(1) = 1×nums[0] + 2×nums[1] + ... + 0×nums[n-1]`。 + +令数组`nums`中所有元素和为`sum`,用数学归纳法验证:当`1 ≤ k < n`时,`F(k) = F(k-1) + sum - n×nums[n-k]`成立。 + +**归纳奠基**:证明`k=1`时命题成立。 + +```c +F(1) = 1×nums[0] + 2×nums[1] + ... + 0×nums[n-1] + = F(0) + sum - n×nums[n-1] +``` + +**归纳假设**:假设`F(k) = F(k-1) + sum - n×nums[n-k]`成立。 + +**归纳递推**:由归纳假设推出`F(k+1) = F(k) + sum - n×nums[n-(k+1)]`成立,则假设的递推公式成立。 + +```c +F(k+1) = (k+1)×nums[0] + k×nums[1] + ... + 0×nums[n-1] + = F(k) + sum - n×nums[n-(k+1)] +``` + +因此可以得到递推公式: + +- 当`n = 0`时,`F(0) = 0×nums[0] + 1×nums[1] + ... + (n−1)×nums[n−1]` +- 当`1 ≤ k < n`时,`F(k) = F(k-1) + sum - n×nums[n-k]`成立。 + +循环遍历`0 ≤ k < n`,计算出不同的`F(k)`并不断更新最大值,就能求出`F(0), F(1), ..., F(n-1)`中的最大值。 + + +---------------------------------------------- +
+

⬅️上一页

+

下一页➡️

+
diff --git a/website/content/ChapterFour/0300~0399/0397.Integer-Replacement.md b/website/content/ChapterFour/0300~0399/0397.Integer-Replacement.md index 57a91ef22..92179b94a 100755 --- a/website/content/ChapterFour/0300~0399/0397.Integer-Replacement.md +++ b/website/content/ChapterFour/0300~0399/0397.Integer-Replacement.md @@ -88,6 +88,6 @@ func integerReplacement(n int) int { ----------------------------------------------
-

⬅️上一页

+

⬅️上一页

下一页➡️

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 index a4072e31d..c19fb8751 100644 --- a/website/content/ChapterFour/0400~0499/0417.Pacific-Atlantic-Water-Flow.md +++ b/website/content/ChapterFour/0400~0499/0417.Pacific-Atlantic-Water-Flow.md @@ -95,5 +95,5 @@ func dfs(matrix [][]int, row, col int, visited *[][]bool, height int) { ----------------------------------------------

⬅️上一页

-

下一页➡️

+

下一页➡️

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:** + +![img](https://assets.leetcode.com/uploads/2021/04/10/battelship-grid.jpg) + +```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/0400~0499/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 index 05db370e2..7abc8d853 100755 --- a/website/content/ChapterFour/0400~0499/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 @@ -101,6 +101,6 @@ func findMaximumXOR1(nums []int) int { ----------------------------------------------
-

⬅️上一页

+

⬅️上一页

下一页➡️

diff --git a/website/content/ChapterFour/0400~0499/0437.Path-Sum-III.md b/website/content/ChapterFour/0400~0499/0437.Path-Sum-III.md index 91b412cde..cf8405325 100755 --- a/website/content/ChapterFour/0400~0499/0437.Path-Sum-III.md +++ b/website/content/ChapterFour/0400~0499/0437.Path-Sum-III.md @@ -53,7 +53,7 @@ Output: 3 package leetcode import ( - "github.com/halfrost/LeetCode-Go/structures" + "github.com/halfrost/leetcode-go/structures" ) // TreeNode define 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 index 23ec6c9ef..a4156c6fb 100644 --- a/website/content/ChapterFour/0400~0499/0445.Add-Two-Numbers-II.md +++ b/website/content/ChapterFour/0400~0499/0445.Add-Two-Numbers-II.md @@ -42,7 +42,7 @@ package leetcode package leetcode import ( - "github.com/halfrost/LeetCode-Go/structures" + "github.com/halfrost/leetcode-go/structures" ) // ListNode define diff --git a/website/content/ChapterFour/0400~0499/0491.Increasing-Subsequences.md b/website/content/ChapterFour/0400~0499/0491.Non-decreasing-Subsequences.md similarity index 96% rename from website/content/ChapterFour/0400~0499/0491.Increasing-Subsequences.md rename to website/content/ChapterFour/0400~0499/0491.Non-decreasing-Subsequences.md index c21bad2f2..e18e428c3 100755 --- a/website/content/ChapterFour/0400~0499/0491.Increasing-Subsequences.md +++ b/website/content/ChapterFour/0400~0499/0491.Non-decreasing-Subsequences.md @@ -1,4 +1,4 @@ -# [491. Increasing Subsequences](https://leetcode.com/problems/increasing-subsequences/) +# [491. Non-decreasing Subsequences](https://leetcode.com/problems/non-decreasing-subsequences/) ## 题目 diff --git a/website/content/ChapterFour/0400~0499/0493.Reverse-Pairs.md b/website/content/ChapterFour/0400~0499/0493.Reverse-Pairs.md index 3fffb378c..0e53ce7d5 100755 --- a/website/content/ChapterFour/0400~0499/0493.Reverse-Pairs.md +++ b/website/content/ChapterFour/0400~0499/0493.Reverse-Pairs.md @@ -52,7 +52,7 @@ package leetcode import ( "sort" - "github.com/halfrost/LeetCode-Go/template" + "github.com/halfrost/leetcode-go/template" ) // 解法一 归并排序 mergesort,时间复杂度 O(n log n) diff --git a/website/content/ChapterFour/0500~0599/0503.Next-Greater-Element-II.md b/website/content/ChapterFour/0500~0599/0503.Next-Greater-Element-II.md index a58618294..69675aa8d 100644 --- a/website/content/ChapterFour/0500~0599/0503.Next-Greater-Element-II.md +++ b/website/content/ChapterFour/0500~0599/0503.Next-Greater-Element-II.md @@ -81,5 +81,5 @@ func nextGreaterElements1(nums []int) []int { ----------------------------------------------

⬅️上一页

-

下一页➡️

+

下一页➡️

diff --git a/website/content/ChapterFour/0500~0599/0504.Base-7.md b/website/content/ChapterFour/0500~0599/0504.Base-7.md new file mode 100644 index 000000000..30b82e50e --- /dev/null +++ b/website/content/ChapterFour/0500~0599/0504.Base-7.md @@ -0,0 +1,67 @@ +# [504. Base 7](https://leetcode.com/problems/base-7/) + +## 题目 + +Given an integer num, return a string of its base 7 representation. + +**Example 1:** + + Input: num = 100 + Output: "202" + +**Example 2:** + + Input: num = -7 + Output: "-10" + +**Constraints:** + +- -10000000 <= num <= 10000000 + +## 题目大意 + +给定一个整数 num,将其转化为 7 进制,并以字符串形式输出。 + +## 解题思路 + + num反复除以7,然后倒排余数 + +# 代码 + +```go +package leetcode + +import "strconv" + +func convertToBase7(num int) string { + if num == 0 { + return "0" + } + negative := false + if num < 0 { + negative = true + num = -num + } + var ans string + var nums []int + for num != 0 { + remainder := num % 7 + nums = append(nums, remainder) + num = num / 7 + } + if negative { + ans += "-" + } + for i := len(nums) - 1; i >= 0; i-- { + ans += strconv.Itoa(nums[i]) + } + return ans +} +``` + + +---------------------------------------------- +
+

⬅️上一页

+

下一页➡️

+
diff --git a/website/content/ChapterFour/0500~0599/0506.Relative-Ranks.md b/website/content/ChapterFour/0500~0599/0506.Relative-Ranks.md index 95c297bdb..0e1522f5f 100644 --- a/website/content/ChapterFour/0500~0599/0506.Relative-Ranks.md +++ b/website/content/ChapterFour/0500~0599/0506.Relative-Ranks.md @@ -86,6 +86,6 @@ func findRelativeRanks(score []int) []string { ----------------------------------------------
-

⬅️上一页

+

⬅️上一页

下一页➡️

diff --git a/website/content/ChapterFour/0500~0599/0515.Find-Largest-Value-in-Each-Tree-Row.md b/website/content/ChapterFour/0500~0599/0515.Find-Largest-Value-in-Each-Tree-Row.md index 128feced4..063e06f5e 100755 --- a/website/content/ChapterFour/0500~0599/0515.Find-Largest-Value-in-Each-Tree-Row.md +++ b/website/content/ChapterFour/0500~0599/0515.Find-Largest-Value-in-Each-Tree-Row.md @@ -118,5 +118,5 @@ func largestValues3(root *TreeNode) []int { ----------------------------------------------

⬅️上一页

-

下一页➡️

+

下一页➡️

diff --git a/website/content/ChapterFour/0500~0599/0518.Coin-Change-2.md b/website/content/ChapterFour/0500~0599/0518.Coin-Change-II.md similarity index 97% rename from website/content/ChapterFour/0500~0599/0518.Coin-Change-2.md rename to website/content/ChapterFour/0500~0599/0518.Coin-Change-II.md index 9dd8af264..5fc89a1cd 100644 --- a/website/content/ChapterFour/0500~0599/0518.Coin-Change-2.md +++ b/website/content/ChapterFour/0500~0599/0518.Coin-Change-II.md @@ -1,4 +1,4 @@ -# [518. Coin Change 2](https://leetcode.com/problems/coin-change-2/) +# [518. Coin Change II](https://leetcode.com/problems/coin-change-ii/) ## 题目 diff --git a/website/content/ChapterFour/0500~0599/0519.Random-Flip-Matrix.md b/website/content/ChapterFour/0500~0599/0519.Random-Flip-Matrix.md index 545b55648..d72da22bb 100644 --- a/website/content/ChapterFour/0500~0599/0519.Random-Flip-Matrix.md +++ b/website/content/ChapterFour/0500~0599/0519.Random-Flip-Matrix.md @@ -100,6 +100,6 @@ func (this *Solution) Reset() { ----------------------------------------------
-

⬅️上一页

+

⬅️上一页

下一页➡️

diff --git a/website/content/ChapterFour/0500~0599/0529.Minesweeper.md b/website/content/ChapterFour/0500~0599/0529.Minesweeper.md index 1593ad8b4..88540208a 100644 --- a/website/content/ChapterFour/0500~0599/0529.Minesweeper.md +++ b/website/content/ChapterFour/0500~0599/0529.Minesweeper.md @@ -103,45 +103,35 @@ func updateBoard(board [][]byte, click []int) [][]byte { board[click[0]][click[1]] = 'X' return board } - mineMap := make([][]int, len(board)) - for i := range board { - mineMap[i] = make([]int, len(board[i])) - } - for i := range board { - for j := range board[i] { - if board[i][j] == 'M' { - mineMap[i][j] = -1 - for _, d := range dir8 { - nx, ny := i+d[0], j+d[1] - if isInBoard(board, nx, ny) && mineMap[nx][ny] >= 0 { - mineMap[nx][ny]++ - } - } - } - } - } - mineSweeper(click[0], click[1], board, mineMap, dir8) + dfs(board, click[0], click[1]) return board } -func mineSweeper(x, y int, board [][]byte, mineMap [][]int, dir8 [][]int) { - if board[x][y] != 'M' && board[x][y] != 'E' { +func dfs(board [][]byte, x, y int) { + cnt := 0 + for i := 0; i < 8; i++ { + nx, ny := x+dir8[i][0], y+dir8[i][1] + if isInBoard(board, nx, ny) && board[nx][ny] == 'M' { + cnt++ + + } + } + if cnt > 0 { + board[x][y] = byte(cnt + '0') return } - if mineMap[x][y] == -1 { - board[x][y] = 'X' - } else if mineMap[x][y] > 0 { - board[x][y] = '0' + byte(mineMap[x][y]) - } else { - board[x][y] = 'B' - for _, d := range dir8 { - nx, ny := x+d[0], y+d[1] - if isInBoard(board, nx, ny) && mineMap[nx][ny] >= 0 { - mineSweeper(nx, ny, board, mineMap, dir8) - } + board[x][y] = 'B' + for i := 0; i < 8; i++ { + nx, ny := x+dir8[i][0], y+dir8[i][1] + if isInBoard(board, nx, ny) && board[nx][ny] != 'B' { + dfs(board, nx, ny) } } } + +func isInBoard(board [][]byte, x, y int) bool { + return x >= 0 && x < len(board) && y >= 0 && y < len(board[0]) +} ``` diff --git a/website/content/ChapterFour/0500~0599/0530.Minimum-Absolute-Difference-in-BST.md b/website/content/ChapterFour/0500~0599/0530.Minimum-Absolute-Difference-in-BST.md index 45eecdd00..5dcd943f9 100644 --- a/website/content/ChapterFour/0500~0599/0530.Minimum-Absolute-Difference-in-BST.md +++ b/website/content/ChapterFour/0500~0599/0530.Minimum-Absolute-Difference-in-BST.md @@ -45,7 +45,7 @@ package leetcode import ( "math" - "github.com/halfrost/LeetCode-Go/structures" + "github.com/halfrost/leetcode-go/structures" ) // TreeNode define diff --git a/website/content/ChapterFour/0500~0599/0538.Convert-BST-to-Greater-Tree.md b/website/content/ChapterFour/0500~0599/0538.Convert-BST-to-Greater-Tree.md index 55f7ea5e8..c69654019 100644 --- a/website/content/ChapterFour/0500~0599/0538.Convert-BST-to-Greater-Tree.md +++ b/website/content/ChapterFour/0500~0599/0538.Convert-BST-to-Greater-Tree.md @@ -70,7 +70,7 @@ Output: [7,9,4,10] package leetcode import ( - "github.com/halfrost/LeetCode-Go/structures" + "github.com/halfrost/leetcode-go/structures" ) // TreeNode define diff --git a/website/content/ChapterFour/0500~0599/0543.Diameter-of-Binary-Tree.md b/website/content/ChapterFour/0500~0599/0543.Diameter-of-Binary-Tree.md index e8435f0d5..ced821989 100644 --- a/website/content/ChapterFour/0500~0599/0543.Diameter-of-Binary-Tree.md +++ b/website/content/ChapterFour/0500~0599/0543.Diameter-of-Binary-Tree.md @@ -47,7 +47,7 @@ Output: 1 package leetcode import ( - "github.com/halfrost/LeetCode-Go/structures" + "github.com/halfrost/leetcode-go/structures" ) // TreeNode define diff --git a/website/content/ChapterFour/0500~0599/0547.Number-of-Provinces.md b/website/content/ChapterFour/0500~0599/0547.Number-of-Provinces.md index abe67111d..60011312f 100755 --- a/website/content/ChapterFour/0500~0599/0547.Number-of-Provinces.md +++ b/website/content/ChapterFour/0500~0599/0547.Number-of-Provinces.md @@ -61,7 +61,7 @@ Given a **N*N** matrix **M** representing the friend relationship between st package leetcode import ( - "github.com/halfrost/LeetCode-Go/template" + "github.com/halfrost/leetcode-go/template" ) // 解法一 并查集 diff --git a/website/content/ChapterFour/0500~0599/0560.Subarray-Sum-Equals-K.md b/website/content/ChapterFour/0500~0599/0560.Subarray-Sum-Equals-K.md index 785b6ef81..024667f09 100644 --- a/website/content/ChapterFour/0500~0599/0560.Subarray-Sum-Equals-K.md +++ b/website/content/ChapterFour/0500~0599/0560.Subarray-Sum-Equals-K.md @@ -61,5 +61,5 @@ func subarraySum(nums []int, k int) int { ----------------------------------------------

⬅️上一页

-

下一页➡️

+

下一页➡️

diff --git a/website/content/ChapterFour/0500~0599/0561.Array-Partition-I.md b/website/content/ChapterFour/0500~0599/0561.Array-Partition.md similarity index 97% rename from website/content/ChapterFour/0500~0599/0561.Array-Partition-I.md rename to website/content/ChapterFour/0500~0599/0561.Array-Partition.md index 8b1a7a1f2..04b71df09 100644 --- a/website/content/ChapterFour/0500~0599/0561.Array-Partition-I.md +++ b/website/content/ChapterFour/0500~0599/0561.Array-Partition.md @@ -1,4 +1,4 @@ -# [561. Array Partition I](https://leetcode.com/problems/array-partition-i/) +# [561. Array Partition](https://leetcode.com/problems/array-partition/) ## 题目 diff --git a/website/content/ChapterFour/0500~0599/0563.Binary-Tree-Tilt.md b/website/content/ChapterFour/0500~0599/0563.Binary-Tree-Tilt.md index 83b5be1b5..dfe47b0de 100755 --- a/website/content/ChapterFour/0500~0599/0563.Binary-Tree-Tilt.md +++ b/website/content/ChapterFour/0500~0599/0563.Binary-Tree-Tilt.md @@ -85,6 +85,6 @@ func findTiltDFS(root *TreeNode, sum *int) int { ----------------------------------------------
-

⬅️上一页

+

⬅️上一页

下一页➡️

diff --git a/website/content/ChapterFour/0600~0699/0617.Merge-Two-Binary-Trees.md b/website/content/ChapterFour/0600~0699/0617.Merge-Two-Binary-Trees.md index 2f4c17115..8e535838c 100644 --- a/website/content/ChapterFour/0600~0699/0617.Merge-Two-Binary-Trees.md +++ b/website/content/ChapterFour/0600~0699/0617.Merge-Two-Binary-Trees.md @@ -50,7 +50,7 @@ Output: [2,2] package leetcode import ( - "github.com/halfrost/LeetCode-Go/structures" + "github.com/halfrost/leetcode-go/structures" ) // TreeNode define diff --git a/website/content/ChapterFour/0600~0699/0623.Add-One-Row-to-Tree.md b/website/content/ChapterFour/0600~0699/0623.Add-One-Row-to-Tree.md index f99f04af1..356232ccb 100644 --- a/website/content/ChapterFour/0600~0699/0623.Add-One-Row-to-Tree.md +++ b/website/content/ChapterFour/0600~0699/0623.Add-One-Row-to-Tree.md @@ -68,7 +68,7 @@ v = 1d = 3Output: package leetcode import ( - "github.com/halfrost/LeetCode-Go/structures" + "github.com/halfrost/leetcode-go/structures" ) // TreeNode define diff --git a/website/content/ChapterFour/0600~0699/0669.Trim-a-Binary-Search-Tree.md b/website/content/ChapterFour/0600~0699/0669.Trim-a-Binary-Search-Tree.md index d140542bc..12b162fbc 100644 --- a/website/content/ChapterFour/0600~0699/0669.Trim-a-Binary-Search-Tree.md +++ b/website/content/ChapterFour/0600~0699/0669.Trim-a-Binary-Search-Tree.md @@ -68,7 +68,7 @@ Output: [2] package leetcode import ( - "github.com/halfrost/LeetCode-Go/structures" + "github.com/halfrost/leetcode-go/structures" ) // TreeNode define diff --git a/website/content/ChapterFour/0600~0699/0684.Redundant-Connection.md b/website/content/ChapterFour/0600~0699/0684.Redundant-Connection.md index 6f48fee39..4fff04a31 100755 --- a/website/content/ChapterFour/0600~0699/0684.Redundant-Connection.md +++ b/website/content/ChapterFour/0600~0699/0684.Redundant-Connection.md @@ -62,7 +62,7 @@ Return an edge that can be removed so that the resulting graph is a tree of N no package leetcode import ( - "github.com/halfrost/LeetCode-Go/template" + "github.com/halfrost/leetcode-go/template" ) func findRedundantConnection(edges [][]int) []int { diff --git a/website/content/ChapterFour/0600~0699/0699.Falling-Squares.md b/website/content/ChapterFour/0600~0699/0699.Falling-Squares.md index 0f75d34b5..83772c54a 100755 --- a/website/content/ChapterFour/0600~0699/0699.Falling-Squares.md +++ b/website/content/ChapterFour/0600~0699/0699.Falling-Squares.md @@ -108,7 +108,7 @@ package leetcode import ( "sort" - "github.com/halfrost/LeetCode-Go/template" + "github.com/halfrost/leetcode-go/template" ) func fallingSquares(positions [][]int) []int { diff --git a/website/content/ChapterFour/0700~0799/0700.Search-in-a-Binary-Search-Tree.md b/website/content/ChapterFour/0700~0799/0700.Search-in-a-Binary-Search-Tree.md index 6473f7c70..dd0072acb 100644 --- a/website/content/ChapterFour/0700~0799/0700.Search-in-a-Binary-Search-Tree.md +++ b/website/content/ChapterFour/0700~0799/0700.Search-in-a-Binary-Search-Tree.md @@ -42,7 +42,7 @@ Find the node in the BST that the node's value equals val and return the subtree package leetcode import ( - "github.com/halfrost/LeetCode-Go/structures" + "github.com/halfrost/leetcode-go/structures" ) // TreeNode define diff --git a/website/content/ChapterFour/0700~0799/0701.Insert-into-a-Binary-Search-Tree.md b/website/content/ChapterFour/0700~0799/0701.Insert-into-a-Binary-Search-Tree.md index de9e6869a..bbfc43a22 100644 --- a/website/content/ChapterFour/0700~0799/0701.Insert-into-a-Binary-Search-Tree.md +++ b/website/content/ChapterFour/0700~0799/0701.Insert-into-a-Binary-Search-Tree.md @@ -57,7 +57,7 @@ Output: [4,2,7,1,3,5] ```go package leetcode -import "github.com/halfrost/LeetCode-Go/structures" +import "github.com/halfrost/leetcode-go/structures" // TreeNode define type TreeNode = structures.TreeNode diff --git a/website/content/ChapterFour/0700~0799/0721.Accounts-Merge.md b/website/content/ChapterFour/0700~0799/0721.Accounts-Merge.md index dfe1190cb..a7cb56781 100755 --- a/website/content/ChapterFour/0700~0799/0721.Accounts-Merge.md +++ b/website/content/ChapterFour/0700~0799/0721.Accounts-Merge.md @@ -58,7 +58,7 @@ package leetcode import ( "sort" - "github.com/halfrost/LeetCode-Go/template" + "github.com/halfrost/leetcode-go/template" ) // 解法一 并查集优化搜索解法 diff --git a/website/content/ChapterFour/0700~0799/0726.Number-of-Atoms.md b/website/content/ChapterFour/0700~0799/0726.Number-of-Atoms.md index 3cbf7a4f7..da6ec1a93 100755 --- a/website/content/ChapterFour/0700~0799/0726.Number-of-Atoms.md +++ b/website/content/ChapterFour/0700~0799/0726.Number-of-Atoms.md @@ -189,5 +189,5 @@ func isLowerLetter(v byte) bool { ----------------------------------------------

⬅️上一页

-

下一页➡️

+

下一页➡️

diff --git a/website/content/ChapterFour/0700~0799/0728.Self-Dividing-Numbers.md b/website/content/ChapterFour/0700~0799/0728.Self-Dividing-Numbers.md new file mode 100644 index 000000000..0a7871712 --- /dev/null +++ b/website/content/ChapterFour/0700~0799/0728.Self-Dividing-Numbers.md @@ -0,0 +1,75 @@ +# [728. Self Dividing Numbers](https://leetcode.com/problems/self-dividing-numbers/) + +## 题目 + +A self-dividing number is a number that is divisible by every digit it contains. + +- For example, 128 is a self-dividing number because 128 % 1 == 0, 128 % 2 == 0, and 128 % 8 == 0. + +A self-dividing number is not allowed to contain the digit zero. + +Given two integers left and right, return a list of all the self-dividing numbers in the range [left, right]. + +**Example 1:** + + Input: left = 1, right = 22 + Output: [1,2,3,4,5,6,7,8,9,11,12,15,22] + +**Example 2:** + + Input: left = 47, right = 85 + Output: [48,55,66,77] + +**Constraints:** + +- 1 <= left <= right <= 10000 + +## 题目大意 + +自除数是指可以被它包含的每一位数整除的数。 + +- 例如,128 是一个 自除数 ,因为 128 % 1 == 0,128 % 2 == 0,128 % 8 == 0。 + +自除数 不允许包含 0 。 + +给定两个整数 left 和 right ,返回一个列表,列表的元素是范围 [left, right] 内所有的 自除数 。 + +## 解题思路 + +- 模拟计算 + +# 代码 + +```go +package leetcode + +func selfDividingNumbers(left int, right int) []int { + var ans []int + for num := left; num <= right; num++ { + if selfDividingNum(num) { + ans = append(ans, num) + } + } + return ans +} + +func selfDividingNum(num int) bool { + for d := num; d > 0; d = d / 10 { + reminder := d % 10 + if reminder == 0 { + return false + } + if num%reminder != 0 { + return false + } + } + return true +} +``` + + +---------------------------------------------- +
+

⬅️上一页

+

下一页➡️

+
diff --git a/website/content/ChapterFour/0700~0799/0729.My-Calendar-I.md b/website/content/ChapterFour/0700~0799/0729.My-Calendar-I.md index 6c7cf30b3..0579c76da 100755 --- a/website/content/ChapterFour/0700~0799/0729.My-Calendar-I.md +++ b/website/content/ChapterFour/0700~0799/0729.My-Calendar-I.md @@ -182,6 +182,6 @@ func (this *MyCalendar) Book(start int, end int) bool { ----------------------------------------------
-

⬅️上一页

+

⬅️上一页

下一页➡️

diff --git a/website/content/ChapterFour/0700~0799/0763.Partition-Labels.md b/website/content/ChapterFour/0700~0799/0763.Partition-Labels.md index caac72ef1..68b1b7b24 100644 --- a/website/content/ChapterFour/0700~0799/0763.Partition-Labels.md +++ b/website/content/ChapterFour/0700~0799/0763.Partition-Labels.md @@ -34,7 +34,7 @@ A partition like "ababcbacadefegde", "hijhklij" is incorrect, because it splits ## 解题思路 -这一题有 2 种思路,第一种思路是先记录下每个字母的出现次数,然后对滑动窗口中的每个字母判断次数是否用尽为 0,如果这个窗口内的所有字母次数都为 0,这个窗口就是符合条件的窗口。时间复杂度为 O(n^2) +这一题有 2 种思路,第一种思路是先记录下每个字母的出现次数,然后对滑动窗口中的每个字母判断次数是否用尽为 0,如果这个窗口内的所有字母次数都为 0,这个窗口就是符合条件的窗口。时间复杂度为 O(n) 另外一种思路是记录下每个字符最后一次出现的下标,这样就不用记录次数。在每个滑动窗口中,依次判断每个字母最后一次出现的位置,如果在一个下标内,所有字母的最后一次出现的位置都包含进来了,那么这个下标就是这个满足条件的窗口大小。时间复杂度为 O(n^2) diff --git a/website/content/ChapterFour/0700~0799/0765.Couples-Holding-Hands.md b/website/content/ChapterFour/0700~0799/0765.Couples-Holding-Hands.md index 87fe36c4e..988f3eaea 100755 --- a/website/content/ChapterFour/0700~0799/0765.Couples-Holding-Hands.md +++ b/website/content/ChapterFour/0700~0799/0765.Couples-Holding-Hands.md @@ -70,7 +70,7 @@ N 对情侣坐在连续排列的 2N 个座位上,想要牵到对方的手。 package leetcode import ( - "github.com/halfrost/LeetCode-Go/template" + "github.com/halfrost/leetcode-go/template" ) func minSwapsCouples(row []int) int { diff --git a/website/content/ChapterFour/0700~0799/0778.Swim-in-Rising-Water.md b/website/content/ChapterFour/0700~0799/0778.Swim-in-Rising-Water.md index 6a2780a29..6ac095ff3 100755 --- a/website/content/ChapterFour/0700~0799/0778.Swim-in-Rising-Water.md +++ b/website/content/ChapterFour/0700~0799/0778.Swim-in-Rising-Water.md @@ -65,7 +65,7 @@ You start at the top left square `(0, 0)`. What is the least time until you can package leetcode import ( - "github.com/halfrost/LeetCode-Go/template" + "github.com/halfrost/leetcode-go/template" ) // 解法一 DFS + 二分 diff --git a/website/content/ChapterFour/0700~0799/0783.Minimum-Distance-Between-BST-Nodes.md b/website/content/ChapterFour/0700~0799/0783.Minimum-Distance-Between-BST-Nodes.md index 4093810d2..ae6f93087 100644 --- a/website/content/ChapterFour/0700~0799/0783.Minimum-Distance-Between-BST-Nodes.md +++ b/website/content/ChapterFour/0700~0799/0783.Minimum-Distance-Between-BST-Nodes.md @@ -46,7 +46,7 @@ package leetcode import ( "math" - "github.com/halfrost/LeetCode-Go/structures" + "github.com/halfrost/leetcode-go/structures" ) // TreeNode define diff --git a/website/content/ChapterFour/0800~0899/0803.Bricks-Falling-When-Hit.md b/website/content/ChapterFour/0800~0899/0803.Bricks-Falling-When-Hit.md index 516c4fa54..f05f3978f 100755 --- a/website/content/ChapterFour/0800~0899/0803.Bricks-Falling-When-Hit.md +++ b/website/content/ChapterFour/0800~0899/0803.Bricks-Falling-When-Hit.md @@ -65,7 +65,7 @@ Return an array representing the number of bricks that will drop after each eras package leetcode import ( - "github.com/halfrost/LeetCode-Go/template" + "github.com/halfrost/leetcode-go/template" ) func hitBricks(grid [][]int, hits [][]int) []int { diff --git a/website/content/ChapterFour/0800~0899/0839.Similar-String-Groups.md b/website/content/ChapterFour/0800~0899/0839.Similar-String-Groups.md index ed2f22420..c369de1d9 100755 --- a/website/content/ChapterFour/0800~0899/0839.Similar-String-Groups.md +++ b/website/content/ChapterFour/0800~0899/0839.Similar-String-Groups.md @@ -66,7 +66,7 @@ We are given a list `A` of strings. Every string in `A` is an anagram of eve package leetcode import ( - "github.com/halfrost/LeetCode-Go/template" + "github.com/halfrost/leetcode-go/template" ) func numSimilarGroups(A []string) int { diff --git a/website/content/ChapterFour/0900~0999/0924.Minimize-Malware-Spread.md b/website/content/ChapterFour/0900~0999/0924.Minimize-Malware-Spread.md index 8b4cf9351..b5835a932 100755 --- a/website/content/ChapterFour/0900~0999/0924.Minimize-Malware-Spread.md +++ b/website/content/ChapterFour/0900~0999/0924.Minimize-Malware-Spread.md @@ -67,7 +67,7 @@ package leetcode import ( "math" - "github.com/halfrost/LeetCode-Go/template" + "github.com/halfrost/leetcode-go/template" ) func minMalwareSpread(graph [][]int, initial []int) int { diff --git a/website/content/ChapterFour/0900~0999/0928.Minimize-Malware-Spread-II.md b/website/content/ChapterFour/0900~0999/0928.Minimize-Malware-Spread-II.md index 16819d5e9..ad047b303 100755 --- a/website/content/ChapterFour/0900~0999/0928.Minimize-Malware-Spread-II.md +++ b/website/content/ChapterFour/0900~0999/0928.Minimize-Malware-Spread-II.md @@ -70,7 +70,7 @@ package leetcode import ( "math" - "github.com/halfrost/LeetCode-Go/template" + "github.com/halfrost/leetcode-go/template" ) func minMalwareSpread2(graph [][]int, initial []int) int { diff --git a/website/content/ChapterFour/0900~0999/0938.Range-Sum-of-BST.md b/website/content/ChapterFour/0900~0999/0938.Range-Sum-of-BST.md index 861607673..a0c1644ec 100644 --- a/website/content/ChapterFour/0900~0999/0938.Range-Sum-of-BST.md +++ b/website/content/ChapterFour/0900~0999/0938.Range-Sum-of-BST.md @@ -46,7 +46,7 @@ Output: 23 package leetcode import ( - "github.com/halfrost/LeetCode-Go/structures" + "github.com/halfrost/leetcode-go/structures" ) // TreeNode define diff --git a/website/content/ChapterFour/0900~0999/0947.Most-Stones-Removed-with-Same-Row-or-Column.md b/website/content/ChapterFour/0900~0999/0947.Most-Stones-Removed-with-Same-Row-or-Column.md index 215f957ed..e19800760 100755 --- a/website/content/ChapterFour/0900~0999/0947.Most-Stones-Removed-with-Same-Row-or-Column.md +++ b/website/content/ChapterFour/0900~0999/0947.Most-Stones-Removed-with-Same-Row-or-Column.md @@ -55,7 +55,7 @@ What is the largest possible number of moves we can make? package leetcode import ( - "github.com/halfrost/LeetCode-Go/template" + "github.com/halfrost/leetcode-go/template" ) func removeStones(stones [][]int) int { diff --git a/website/content/ChapterFour/0900~0999/0952.Largest-Component-Size-by-Common-Factor.md b/website/content/ChapterFour/0900~0999/0952.Largest-Component-Size-by-Common-Factor.md index 48a6fda39..f40b90a1c 100755 --- a/website/content/ChapterFour/0900~0999/0952.Largest-Component-Size-by-Common-Factor.md +++ b/website/content/ChapterFour/0900~0999/0952.Largest-Component-Size-by-Common-Factor.md @@ -63,7 +63,7 @@ Return the size of the largest connected component in the graph. package leetcode import ( - "github.com/halfrost/LeetCode-Go/template" + "github.com/halfrost/leetcode-go/template" ) // 解法一 并查集 UnionFind diff --git a/website/content/ChapterFour/0900~0999/0958.Check-Completeness-of-a-Binary-Tree.md b/website/content/ChapterFour/0900~0999/0958.Check-Completeness-of-a-Binary-Tree.md index 6ac61bf64..d9a30b23b 100644 --- a/website/content/ChapterFour/0900~0999/0958.Check-Completeness-of-a-Binary-Tree.md +++ b/website/content/ChapterFour/0900~0999/0958.Check-Completeness-of-a-Binary-Tree.md @@ -54,7 +54,7 @@ Explanation: The node with value 7 isn't as far left as possible. package leetcode import ( - "github.com/halfrost/LeetCode-Go/structures" + "github.com/halfrost/leetcode-go/structures" ) // TreeNode define diff --git a/website/content/ChapterFour/0900~0999/0959.Regions-Cut-By-Slashes.md b/website/content/ChapterFour/0900~0999/0959.Regions-Cut-By-Slashes.md index 564385acd..1aba869f9 100755 --- a/website/content/ChapterFour/0900~0999/0959.Regions-Cut-By-Slashes.md +++ b/website/content/ChapterFour/0900~0999/0959.Regions-Cut-By-Slashes.md @@ -105,7 +105,7 @@ Return the number of regions. package leetcode import ( - "github.com/halfrost/LeetCode-Go/template" + "github.com/halfrost/leetcode-go/template" ) func regionsBySlashes(grid []string) int { diff --git a/website/content/ChapterFour/0900~0999/0971.Flip-Binary-Tree-To-Match-Preorder-Traversal.md b/website/content/ChapterFour/0900~0999/0971.Flip-Binary-Tree-To-Match-Preorder-Traversal.md index 41795741e..5433a7ae8 100644 --- a/website/content/ChapterFour/0900~0999/0971.Flip-Binary-Tree-To-Match-Preorder-Traversal.md +++ b/website/content/ChapterFour/0900~0999/0971.Flip-Binary-Tree-To-Match-Preorder-Traversal.md @@ -66,7 +66,7 @@ Explanation: The tree's pre-order traversal already matches voyage, so no nodes package leetcode import ( - "github.com/halfrost/LeetCode-Go/structures" + "github.com/halfrost/leetcode-go/structures" ) // TreeNode define diff --git a/website/content/ChapterFour/0900~0999/0987.Vertical-Order-Traversal-of-a-Binary-Tree.md b/website/content/ChapterFour/0900~0999/0987.Vertical-Order-Traversal-of-a-Binary-Tree.md index c09381727..aba6488b5 100644 --- a/website/content/ChapterFour/0900~0999/0987.Vertical-Order-Traversal-of-a-Binary-Tree.md +++ b/website/content/ChapterFour/0900~0999/0987.Vertical-Order-Traversal-of-a-Binary-Tree.md @@ -82,7 +82,7 @@ import ( "math" "sort" - "github.com/halfrost/LeetCode-Go/structures" + "github.com/halfrost/leetcode-go/structures" ) // TreeNode define diff --git a/website/content/ChapterFour/0900~0999/0990.Satisfiability-of-Equality-Equations.md b/website/content/ChapterFour/0900~0999/0990.Satisfiability-of-Equality-Equations.md index a2a795e97..bca338729 100755 --- a/website/content/ChapterFour/0900~0999/0990.Satisfiability-of-Equality-Equations.md +++ b/website/content/ChapterFour/0900~0999/0990.Satisfiability-of-Equality-Equations.md @@ -72,7 +72,7 @@ Return `true` if and only if it is possible to assign integers to variable nam package leetcode import ( - "github.com/halfrost/LeetCode-Go/template" + "github.com/halfrost/leetcode-go/template" ) func equationsPossible(equations []string) bool { diff --git a/website/content/ChapterFour/1000~1099/1004.Max-Consecutive-Ones-III.md b/website/content/ChapterFour/1000~1099/1004.Max-Consecutive-Ones-III.md index c7c40384d..8731490ef 100644 --- a/website/content/ChapterFour/1000~1099/1004.Max-Consecutive-Ones-III.md +++ b/website/content/ChapterFour/1000~1099/1004.Max-Consecutive-Ones-III.md @@ -77,6 +77,13 @@ func longestOnes(A []int, K int) int { return res } +func max(a int, b int) int { + if a > b { + return a + } + return b +} + ``` diff --git a/website/content/ChapterFour/1000~1099/1021.Remove-Outermost-Parentheses.md b/website/content/ChapterFour/1000~1099/1021.Remove-Outermost-Parentheses.md index d6ffcbd0a..7742aec2c 100644 --- a/website/content/ChapterFour/1000~1099/1021.Remove-Outermost-Parentheses.md +++ b/website/content/ChapterFour/1000~1099/1021.Remove-Outermost-Parentheses.md @@ -126,5 +126,5 @@ func removeOuterParentheses1(S string) string { ----------------------------------------------

⬅️上一页

-

下一页➡️

+

下一页➡️

diff --git a/website/content/ChapterFour/1000~1099/1022.Sum-of-Root-To-Leaf-Binary-Numbers.md b/website/content/ChapterFour/1000~1099/1022.Sum-of-Root-To-Leaf-Binary-Numbers.md new file mode 100644 index 000000000..299a22219 --- /dev/null +++ b/website/content/ChapterFour/1000~1099/1022.Sum-of-Root-To-Leaf-Binary-Numbers.md @@ -0,0 +1,61 @@ +# [1022. Sum of Root To Leaf Binary Numbers](https://leetcode.com/problems/sum-of-root-to-leaf-binary-numbers/) + +## 题目 + +You are given the root of a binary tree where each node has a value 0 or 1. Each root-to-leaf path represents a binary number starting with the most significant bit. + +For example, if the path is 0 -> 1 -> 1 -> 0 -> 1, then this could represent 01101 in binary, which is 13. +For all leaves in the tree, consider the numbers represented by the path from the root to that leaf. Return the sum of these numbers. + +The test cases are generated so that the answer fits in a 32-bits integer. + +**Example 1:** + +```c +Input: root = [1,0,1,0,1,0,1] +Output: 22 +Explanation: (100) + (101) + (110) + (111) = 4 + 5 + 6 + 7 = 22 +``` + +**Example 2:** + +```c +Input: root = [0] +Output: 0 +``` + +**Constraints:** + +- The number of nodes in the tree is in the range `[1, 1000]`. + +- `Node.val` is `0` or `1`. + + +## 题目大意 + +给定一棵结点值都是`0`或`1`的二叉树,每条从根结点到叶结点的路径都代表一个从最高有效位开始的二进制数。 + +返回从根节点到所有叶结点的路径所表示的数字之和。 + + +## 解题思路 + +采用递归的方式对根结点`root`进行后序遍历(左子树-右子树-根结点)。 + +**递归函数的返回值**: + +递归遍历每个结点时,计算从根结点到当前访问结点的所表示数值`sum`都用到了上次的计算结果,所以递归函数的返回值是当前访问结点的计算结果值。 + +**递归函数的逻辑**: + +- 当前遍历结点为`nil`,表示本层递归结束了,直接`return 0`。 + +- 如果当前访问结点是叶结点,则返回从根结点到该结点所表示的数值`sum`。 +- 如果当前访问结点不是叶结点,则返回左子树和右子树所对应的结果之和。 + + +---------------------------------------------- +
+

⬅️上一页

+

下一页➡️

+
diff --git a/website/content/ChapterFour/1000~1099/1025.Divisor-Game.md b/website/content/ChapterFour/1000~1099/1025.Divisor-Game.md index 2183178d7..868900959 100755 --- a/website/content/ChapterFour/1000~1099/1025.Divisor-Game.md +++ b/website/content/ChapterFour/1000~1099/1025.Divisor-Game.md @@ -64,6 +64,6 @@ func divisorGame(N int) bool { ----------------------------------------------
-

⬅️上一页

+

⬅️上一页

下一页➡️

diff --git a/website/content/ChapterFour/1000~1099/1038.Binary-Search-Tree-to-Greater-Sum-Tree.md b/website/content/ChapterFour/1000~1099/1038.Binary-Search-Tree-to-Greater-Sum-Tree.md index 68d9737ef..31c0a5142 100644 --- a/website/content/ChapterFour/1000~1099/1038.Binary-Search-Tree-to-Greater-Sum-Tree.md +++ b/website/content/ChapterFour/1000~1099/1038.Binary-Search-Tree-to-Greater-Sum-Tree.md @@ -71,7 +71,7 @@ Output: [7,9,4,10] package leetcode import ( - "github.com/halfrost/LeetCode-Go/structures" + "github.com/halfrost/leetcode-go/structures" ) // TreeNode define diff --git a/website/content/ChapterFour/1200~1299/1202.Smallest-String-With-Swaps.md b/website/content/ChapterFour/1200~1299/1202.Smallest-String-With-Swaps.md index 32b06cb98..da9f6cc3b 100755 --- a/website/content/ChapterFour/1200~1299/1202.Smallest-String-With-Swaps.md +++ b/website/content/ChapterFour/1200~1299/1202.Smallest-String-With-Swaps.md @@ -72,7 +72,7 @@ package leetcode import ( "sort" - "github.com/halfrost/LeetCode-Go/template" + "github.com/halfrost/leetcode-go/template" ) func smallestStringWithSwaps(s string, pairs [][]int) string { diff --git a/website/content/ChapterFour/1200~1299/1290.Convert-Binary-Number-in-a-Linked-List-to-Integer.md b/website/content/ChapterFour/1200~1299/1290.Convert-Binary-Number-in-a-Linked-List-to-Integer.md index 41633eae2..af3a2ca0a 100644 --- a/website/content/ChapterFour/1200~1299/1290.Convert-Binary-Number-in-a-Linked-List-to-Integer.md +++ b/website/content/ChapterFour/1200~1299/1290.Convert-Binary-Number-in-a-Linked-List-to-Integer.md @@ -84,5 +84,5 @@ func getDecimalValue(head *ListNode) int { ----------------------------------------------

⬅️上一页

-

下一页➡️

+

下一页➡️

diff --git a/website/content/ChapterFour/1200~1299/1293.Shortest-Path-in-a-Grid-with-Obstacles-Elimination.md b/website/content/ChapterFour/1200~1299/1293.Shortest-Path-in-a-Grid-with-Obstacles-Elimination.md new file mode 100644 index 000000000..f4cebe1fa --- /dev/null +++ b/website/content/ChapterFour/1200~1299/1293.Shortest-Path-in-a-Grid-with-Obstacles-Elimination.md @@ -0,0 +1,138 @@ +# [1293. Shortest Path in a Grid with Obstacles Elimination](https://leetcode.com/problems/shortest-path-in-a-grid-with-obstacles-elimination/) + + + +## 题目 + +You are given an m x n integer matrix grid where each cell is either 0 (empty) or 1 (obstacle). You can move up, down, left, or right from and to an empty cell in one step. + +Return the minimum number of steps to walk from the upper left corner (0, 0) to the lower right corner (m - 1, n - 1) given that you can eliminate at most k obstacles. If it is not possible to find such walk return -1. + + + +Example 1: + + +![](https://assets.leetcode.com/uploads/2021/09/30/short1-grid.jpg) + + +``` +Input: grid = [[0,0,0],[1,1,0],[0,0,0],[0,1,1],[0,0,0]], k = 1 +Output: 6 +Explanation: +The shortest path without eliminating any obstacle is 10. +The shortest path with one obstacle elimination at position (3,2) is 6. Such path is (0,0) -> (0,1) -> (0,2) -> (1,2) -> (2,2) -> (3,2) -> (4,2). +``` + +Example 2: + +![](https://assets.leetcode.com/uploads/2021/09/30/short2-grid.jpg) + +``` +Input: grid = [[0,1,1],[1,1,1],[1,0,0]], k = 1 +Output: -1 +Explanation: We need to eliminate at least two obstacles to find such a walk. +``` + +Constraints: + +- m == grid.length +- n == grid[i].length +- 1 <= m, n <= 40 +- 1 <= k <= m * n +- grid[i][j] is either 0 or 1. +- grid[0][0] == grid[m - 1][n - 1] == 0 + + + +## 题目大意 + +给你一个 m * n 的网格,其中每个单元格不是 0(空)就是 1(障碍物)。每一步,您都可以在空白单元格中上、下、左、右移动。 + +如果您 最多 可以消除 k 个障碍物,请找出从左上角 (0, 0) 到右下角 (m-1, n-1) 的最短路径,并返回通过该路径所需的步数。如果找不到这样的路径,则返回 -1 。 + + +## 解题思路 + +使用 BFS 遍历棋盘。这题比普通可达性问题多了一个障碍物的限制。这个也不难。每个点往周边四个方向扩展的时候,如果遇到障碍物,先算上这个障碍物,障碍物累积总个数小于 K 的时候,从障碍物的这个格子继续开始遍历。如果没有遇到障碍物,判断当前累积障碍物个数是否已经小于 K 个,如果小于 K 便继续遍历。如果大于 K,便终止此轮遍历。 + +## 代码 + +```go +var dir = [][]int{ + {-1, 0}, + {0, 1}, + {1, 0}, + {0, -1}, +} + +type pos struct { + x, y int + obstacle int + step int +} + +func shortestPath(grid [][]int, k int) int { + queue, m, n := []pos{}, len(grid), len(grid[0]) + visitor := make([][][]int, m) + if len(grid) == 1 && len(grid[0]) == 1 { + return 0 + } + for i := 0; i < m; i++ { + visitor[i] = make([][]int, n) + for j := 0; j < n; j++ { + visitor[i][j] = make([]int, k+1) + } + } + visitor[0][0][0] = 1 + queue = append(queue, pos{x: 0, y: 0, obstacle: 0, step: 0}) + for len(queue) > 0 { + size := len(queue) + for size > 0 { + size-- + node := queue[0] + queue = queue[1:] + for i := 0; i < len(dir); i++ { + newX := node.x + dir[i][0] + newY := node.y + dir[i][1] + if newX == m-1 && newY == n-1 { + if node.obstacle != 0 { + if node.obstacle <= k { + return node.step + 1 + } else { + continue + } + } + return node.step + 1 + } + if isInBoard(grid, newX, newY) { + if grid[newX][newY] == 1 { + if node.obstacle+1 <= k && visitor[newX][newY][node.obstacle+1] != 1 { + queue = append(queue, pos{x: newX, y: newY, obstacle: node.obstacle + 1, step: node.step + 1}) + visitor[newX][newY][node.obstacle+1] = 1 + } + } else { + if node.obstacle <= k && visitor[newX][newY][node.obstacle] != 1 { + queue = append(queue, pos{x: newX, y: newY, obstacle: node.obstacle, step: node.step + 1}) + visitor[newX][newY][node.obstacle] = 1 + } + } + + } + } + } + } + return -1 +} + +func isInBoard(board [][]int, x, y int) bool { + return x >= 0 && x < len(board) && y >= 0 && y < len(board[0]) +} +``` + + +---------------------------------------------- +
+

⬅️上一页

+

下一页➡️

+
diff --git a/website/content/ChapterFour/1200~1299/1295.Find-Numbers-with-Even-Number-of-Digits.md b/website/content/ChapterFour/1200~1299/1295.Find-Numbers-with-Even-Number-of-Digits.md index f9e0d8f35..afb613611 100644 --- a/website/content/ChapterFour/1200~1299/1295.Find-Numbers-with-Even-Number-of-Digits.md +++ b/website/content/ChapterFour/1200~1299/1295.Find-Numbers-with-Even-Number-of-Digits.md @@ -65,6 +65,6 @@ func findNumbers(nums []int) int { ----------------------------------------------
-

⬅️上一页

+

⬅️上一页

下一页➡️

diff --git a/website/content/ChapterFour/1300~1399/1319.Number-of-Operations-to-Make-Network-Connected.md b/website/content/ChapterFour/1300~1399/1319.Number-of-Operations-to-Make-Network-Connected.md index 2982a1237..2adf943ce 100644 --- a/website/content/ChapterFour/1300~1399/1319.Number-of-Operations-to-Make-Network-Connected.md +++ b/website/content/ChapterFour/1300~1399/1319.Number-of-Operations-to-Make-Network-Connected.md @@ -66,7 +66,7 @@ Output: 0 package leetcode import ( - "github.com/halfrost/LeetCode-Go/template" + "github.com/halfrost/leetcode-go/template" ) func makeConnected(n int, connections [][]int) int { diff --git a/website/content/ChapterFour/1500~1599/1579.Remove-Max-Number-of-Edges-to-Keep-Graph-Fully-Traversable.md b/website/content/ChapterFour/1500~1599/1579.Remove-Max-Number-of-Edges-to-Keep-Graph-Fully-Traversable.md index ddeac7fe3..8806ed95d 100644 --- a/website/content/ChapterFour/1500~1599/1579.Remove-Max-Number-of-Edges-to-Keep-Graph-Fully-Traversable.md +++ b/website/content/ChapterFour/1500~1599/1579.Remove-Max-Number-of-Edges-to-Keep-Graph-Fully-Traversable.md @@ -73,7 +73,7 @@ Alice 和 Bob 共有一个无向图,其中包含 n 个节点和 3  种类型 package leetcode import ( - "github.com/halfrost/LeetCode-Go/template" + "github.com/halfrost/leetcode-go/template" ) func maxNumEdgesToRemove(n int, edges [][]int) int { diff --git a/website/content/ChapterFour/1600~1699/1631.Path-With-Minimum-Effort.md b/website/content/ChapterFour/1600~1699/1631.Path-With-Minimum-Effort.md index 0fa9e2f09..e219d8c62 100644 --- a/website/content/ChapterFour/1600~1699/1631.Path-With-Minimum-Effort.md +++ b/website/content/ChapterFour/1600~1699/1631.Path-With-Minimum-Effort.md @@ -64,7 +64,7 @@ package leetcode import ( "sort" - "github.com/halfrost/LeetCode-Go/template" + "github.com/halfrost/leetcode-go/template" ) var dir = [4][2]int{ diff --git a/website/content/ChapterFour/1600~1699/1649.Create-Sorted-Array-through-Instructions.md b/website/content/ChapterFour/1600~1699/1649.Create-Sorted-Array-through-Instructions.md index fa098714b..cdd804681 100644 --- a/website/content/ChapterFour/1600~1699/1649.Create-Sorted-Array-through-Instructions.md +++ b/website/content/ChapterFour/1600~1699/1649.Create-Sorted-Array-through-Instructions.md @@ -85,7 +85,7 @@ package leetcode import ( "sort" - "github.com/halfrost/LeetCode-Go/template" + "github.com/halfrost/leetcode-go/template" ) // 解法一 树状数组 Binary Indexed Tree diff --git a/website/content/ChapterFour/1700~1799/1721.Swapping-Nodes-in-a-Linked-List.md b/website/content/ChapterFour/1700~1799/1721.Swapping-Nodes-in-a-Linked-List.md index 96f76e0d7..70e7b2412 100644 --- a/website/content/ChapterFour/1700~1799/1721.Swapping-Nodes-in-a-Linked-List.md +++ b/website/content/ChapterFour/1700~1799/1721.Swapping-Nodes-in-a-Linked-List.md @@ -64,7 +64,7 @@ Output: [1,2,3] package leetcode import ( - "github.com/halfrost/LeetCode-Go/structures" + "github.com/halfrost/leetcode-go/structures" ) // ListNode define diff --git a/website/content/ChapterFour/1800~1899/1877.Minimize-Maximum-Pair-Sum-in-Array.md b/website/content/ChapterFour/1800~1899/1877.Minimize-Maximum-Pair-Sum-in-Array.md index 6713bf9a1..26bc64c66 100644 --- a/website/content/ChapterFour/1800~1899/1877.Minimize-Maximum-Pair-Sum-in-Array.md +++ b/website/content/ChapterFour/1800~1899/1877.Minimize-Maximum-Pair-Sum-in-Array.md @@ -78,7 +78,7 @@ func max(a, b int) int { } return b } - +``` ----------------------------------------------
diff --git a/website/content/ChapterFour/1900~1999/1984.Minimum-Difference-Between-Highest-and-Lowest-of-K-Scores.md b/website/content/ChapterFour/1900~1999/1984.Minimum-Difference-Between-Highest-and-Lowest-of-K-Scores.md index 1ba3eca15..31ce16d63 100644 --- a/website/content/ChapterFour/1900~1999/1984.Minimum-Difference-Between-Highest-and-Lowest-of-K-Scores.md +++ b/website/content/ChapterFour/1900~1999/1984.Minimum-Difference-Between-Highest-and-Lowest-of-K-Scores.md @@ -74,5 +74,5 @@ func minimumDifference(nums []int, k int) int { ----------------------------------------------

⬅️上一页

-

下一页➡️

+

下一页➡️

diff --git a/website/content/ChapterFour/2000~2099/2021.Brightest-Position-on-Street.md b/website/content/ChapterFour/2000~2099/2021.Brightest-Position-on-Street.md new file mode 100644 index 000000000..d223af086 --- /dev/null +++ b/website/content/ChapterFour/2000~2099/2021.Brightest-Position-on-Street.md @@ -0,0 +1,116 @@ +# [2021. Brightest Position on Street](https://leetcode.com/problems/brightest-position-on-street/) + + +## 题目 + +A perfectly straight street is represented by a number line. The street has street lamp(s) on it and is represented by a 2D integer array `lights`. Each `lights[i] = [positioni, rangei]` indicates that there is a street lamp at position `positioni` that lights up the area from `[positioni - rangei, positioni + rangei]` (**inclusive**). + +The **brightness** of a position `p` is defined as the number of street lamp that light up the position `p`. + +Given `lights`, return *the **brightest** position on the street. If there are multiple brightest positions, return the **smallest** one.* + +**Example 1:** + +![https://assets.leetcode.com/uploads/2021/09/28/image-20210928155140-1.png](https://assets.leetcode.com/uploads/2021/09/28/image-20210928155140-1.png) + +``` +Input: lights = [[-3,2],[1,2],[3,3]] +Output: -1 +Explanation: +The first street lamp lights up the area from [(-3) - 2, (-3) + 2] = [-5, -1]. +The second street lamp lights up the area from [1 - 2, 1 + 2] = [-1, 3]. +The third street lamp lights up the area from [3 - 3, 3 + 3] = [0, 6]. + +Position -1 has a brightness of 2, illuminated by the first and second street light. +Positions 0, 1, 2, and 3 have a brightness of 2, illuminated by the second and third street light. +Out of all these positions, -1 is the smallest, so return it. + +``` + +**Example 2:** + +``` +Input: lights = [[1,0],[0,1]] +Output: 1 +Explanation: +The first street lamp lights up the area from [1 - 0, 1 + 0] = [1, 1]. +The second street lamp lights up the area from [0 - 1, 0 + 1] = [-1, 1]. + +Position 1 has a brightness of 2, illuminated by the first and second street light. +Return 1 because it is the brightest position on the street. + +``` + +**Example 3:** + +``` +Input: lights = [[1,2]] +Output: -1 +Explanation: +The first street lamp lights up the area from [1 - 2, 1 + 2] = [-1, 3]. + +Positions -1, 0, 1, 2, and 3 have a brightness of 1, illuminated by the first street light. +Out of all these positions, -1 is the smallest, so return it. + +``` + +**Constraints:** + +- `1 <= lights.length <= 105` +- `lights[i].length == 2` +- `108 <= positioni <= 108` +- `0 <= rangei <= 108` + +## 题目大意 + +一条完全笔直的街道由一条数字线表示。街道上有路灯,由二维数据表示。每个 `lights[i] = [positioni, rangei]` 表示位置 `i` 处有一盏路灯,灯可以照亮从 `[positioni - rangei, positioni + rangei]` (含)的区域。 位置 `p` 的亮度定义为点亮位置 `p` 的路灯数量。 给定路灯,返回街道上最亮的位置。如果有多个最亮的位置,则返回最小的一个。 + +## 解题思路 + +- 先将每个路灯的起始和终点位置计算出来。这样我们得到了一堆坐标点。假设灯照亮的范围是 [A, B],那么在坐标轴上 A 坐标点处 + 1, B + 1 坐标点处 -1 。这样处理的含义是:坐标点 A 可以被一盏灯照亮,所以它照亮次数加一,坐标点 B + 1 出了灯照亮的范围了,所以照亮次数减一。那么从坐标轴坐标开始扫一遍,每次遇到 + 1 的时候就 + 1,遇到 - 1 的地方就 - 1。如此可以算出某个坐标点处,可以被灯照亮的总次数。 +- 需要注意的点是,题目给的测试数据可能会有单点照亮的情况,即某一盏灯只照亮一个坐标点,灯照范围为 0。同一个坐标点也可能是多个灯的起点。用一个 map 去重坐标点即可。 + +## 代码 + +```go +package leetcode + +import ( + "sort" +) + +type lightItem struct { + index int + sign int +} + +func brightestPosition(lights [][]int) int { + lightMap, lightItems := map[int]int{}, []lightItem{} + for _, light := range lights { + lightMap[light[0]-light[1]] += 1 + lightMap[light[0]+light[1]+1] -= 1 + } + for k, v := range lightMap { + lightItems = append(lightItems, lightItem{index: k, sign: v}) + } + sort.SliceStable(lightItems, func(i, j int) bool { + return lightItems[i].index < lightItems[j].index + }) + res, border, tmp := 0, 0, 0 + for _, v := range lightItems { + tmp += v.sign + if border < tmp { + res = v.index + border = tmp + } + } + return res +} +``` + + +---------------------------------------------- +
+

⬅️上一页

+

下一页➡️

+
diff --git a/website/content/ChapterFour/2000~2099/2022.Convert-1D-Array-Into-2D-Array.md b/website/content/ChapterFour/2000~2099/2022.Convert-1D-Array-Into-2D-Array.md index da23b806e..29646b4a0 100644 --- a/website/content/ChapterFour/2000~2099/2022.Convert-1D-Array-Into-2D-Array.md +++ b/website/content/ChapterFour/2000~2099/2022.Convert-1D-Array-Into-2D-Array.md @@ -79,6 +79,6 @@ func construct2DArray(original []int, m int, n int) [][]int { ----------------------------------------------
-

⬅️上一页

-

下一页➡️

+

⬅️上一页

+

下一页➡️

diff --git a/website/content/ChapterFour/2000~2099/2037.Minimum-Number-of-Moves-to-Seat-Everyone.md b/website/content/ChapterFour/2000~2099/2037.Minimum-Number-of-Moves-to-Seat-Everyone.md new file mode 100644 index 000000000..8f7878c44 --- /dev/null +++ b/website/content/ChapterFour/2000~2099/2037.Minimum-Number-of-Moves-to-Seat-Everyone.md @@ -0,0 +1,101 @@ +# [2037. Minimum Number of Moves to Seat Everyone](https://leetcode.com/problems/minimum-number-of-moves-to-seat-everyone/) + +## 题目 + +There are n seats and n students in a room. You are given an array seats of length n, where seats[i] is the position of the ith seat. You are also given the array students of length n, where students[j] is the position of the jth student. + +You may perform the following move any number of times: + +- Increase or decrease the position of the ith student by 1 (i.e., moving the ith student from position x to x + 1 or x - 1) + +Return the minimum number of moves required to move each student to a seat such that no two students are in the same seat. + +Note that there may be multiple seats or students in the same position at the beginning. + +**Example 1:** + + Input: seats = [3,1,5], students = [2,7,4] + Output: 4 + Explanation: The students are moved as follows: + - The first student is moved from from position 2 to position 1 using 1 move. + - The second student is moved from from position 7 to position 5 using 2 moves. + - The third student is moved from from position 4 to position 3 using 1 move. + In total, 1 + 2 + 1 = 4 moves were used. + +**Example 2:** + + Input: seats = [4,1,5,9], students = [1,3,2,6] + Output: 7 + Explanation: The students are moved as follows: + - The first student is not moved. + - The second student is moved from from position 3 to position 4 using 1 move. + - The third student is moved from from position 2 to position 5 using 3 moves. + - The fourth student is moved from from position 6 to position 9 using 3 moves. + In total, 0 + 1 + 3 + 3 = 7 moves were used. + +**Example 3:** + + Input: seats = [2,2,6,6], students = [1,3,2,6] + Output: 4 + Explanation: Note that there are two seats at position 2 and two seats at position 6. + The students are moved as follows: + - The first student is moved from from position 1 to position 2 using 1 move. + - The second student is moved from from position 3 to position 6 using 3 moves. + - The third student is not moved. + - The fourth student is not moved. + In total, 1 + 3 + 0 + 0 = 4 moves were used. + +**Constraints:** + +- n == seats.length == students.length +- 1 <= n <= 100 +- 1 <= seats[i], students[j] <= 100 + +## 题目大意 + +一个房间里有 n 个座位和 n 名学生,房间用一个数轴表示。给你一个长度为 n 的数组 seats,其中 seats[i] 是第 i 个座位的位置。同时给你一个长度为 n 的数组 students ,其中 students[j] 是第 j 位学生的位置。 + +你可以执行以下操作任意次: + +增加或者减少第 i 位学生的位置,每次变化量为 1(也就是将第 i 位学生从位置 x 移动到 x + 1或者 x - 1) + +请你返回使所有学生都有座位坐的最少移动次数,并确保没有两位学生的座位相同。 + +请注意,初始时有可能有多个座位或者多位学生在 同一位置。 + +## 解题思路 + +- 排序+模拟计算 + +# 代码 + +```go +package leetcode + +import "sort" + +func minMovesToSeat(seats []int, students []int) int { + sort.Ints(seats) + sort.Ints(students) + n := len(students) + moves := 0 + for i := 0; i < n; i++ { + moves += abs(seats[i], students[i]) + } + return moves +} + +func abs(a, b int) int { + if a > b { + return a - b + } + return b - a +} +``` + + +---------------------------------------------- +
+

⬅️上一页

+

下一页➡️

+
diff --git a/website/content/ChapterFour/2000~2099/2038.Remove-Colored-Pieces-if-Both-Neighbors-are-the-Same-Color.md b/website/content/ChapterFour/2000~2099/2038.Remove-Colored-Pieces-if-Both-Neighbors-are-the-Same-Color.md new file mode 100644 index 000000000..09091fcc8 --- /dev/null +++ b/website/content/ChapterFour/2000~2099/2038.Remove-Colored-Pieces-if-Both-Neighbors-are-the-Same-Color.md @@ -0,0 +1,112 @@ +# [2038. Remove Colored Pieces if Both Neighbors are the Same Color](https://leetcode.com/problems/remove-colored-pieces-if-both-neighbors-are-the-same-color/) + +## 题目 + +There are n pieces arranged in a line, and each piece is colored either by 'A' or by 'B'. You are given a string colors of length n where colors[i] is the color of the ith piece. + +Alice and Bob are playing a game where they take alternating turns removing pieces from the line. In this game, Alice moves first. + +- Alice is only allowed to remove a piece colored 'A' if both its neighbors are also colored 'A'. She is not allowed to remove pieces that are colored 'B'. +- Bob is only allowed to remove a piece colored 'B' if both its neighbors are also colored 'B'. He is not allowed to remove pieces that are colored 'A'. +- Alice and Bob cannot remove pieces from the edge of the line. +- If a player cannot make a move on their turn, that player loses and the other player wins. + +Assuming Alice and Bob play optimally, return true if Alice wins, or return false if Bob wins. + +**Example 1:** + + Input: colors = "AAABABB" + Output: true + Explanation: + AAABABB -> AABABB + Alice moves first. + She removes the second 'A' from the left since that is the only 'A' whose neighbors are both 'A'. + + Now it's Bob's turn. + Bob cannot make a move on his turn since there are no 'B's whose neighbors are both 'B'. + Thus, Alice wins, so return true. + +**Example 2:** + + Input: colors = "AA" + Output: false + Explanation: + Alice has her turn first. + There are only two 'A's and both are on the edge of the line, so she cannot move on her turn. + Thus, Bob wins, so return false. + +**Example 3:** + + Input: colors = "ABBBBBBBAAA" + Output: false + Explanation: + ABBBBBBBAAA -> ABBBBBBBAA + Alice moves first. + Her only option is to remove the second to last 'A' from the right. + + ABBBBBBBAA -> ABBBBBBAA + Next is Bob's turn. + He has many options for which 'B' piece to remove. He can pick any. + + On Alice's second turn, she has no more pieces that she can remove. + Thus, Bob wins, so return false. + +**Constraints:** + +- 1 <= colors.length <= 100000 +- colors consists of only the letters 'A' and 'B' + +## 题目大意 + +总共有 n 个颜色片段排成一列,每个颜色片段要么是 'A' 要么是 'B' 。给你一个长度为 n 的字符串 colors ,其中 colors[i] 表示第 i 个颜色片段的颜色。 + +Alice 和 Bob 在玩一个游戏,他们轮流从这个字符串中删除颜色。Alice 先手。 + +- 如果一个颜色片段为 'A' 且相邻两个颜色都是颜色 'A',那么 Alice 可以删除该颜色片段。Alice不可以删除任何颜色 'B' 片段。 +- 如果一个颜色片段为 'B'且相邻两个颜色都是颜色 'B' ,那么 Bob 可以删除该颜色片段。Bob 不可以删除任何颜色 'A' 片段。 +- Alice 和 Bob 不能从字符串两端删除颜色片段。 +- 如果其中一人无法继续操作,则该玩家 输掉游戏且另一玩家 获胜。 + +假设 Alice 和 Bob 都采用最优策略,如果 Alice 获胜,请返回true,否则 Bob 获胜,返回false。 + +## 解题思路 + +- 统计 Alice 和 Bob 分别可以操作的次数记为 As,Bs +- 因为 Alice 先手,所以只要 As 大于 Bs,Alice 获胜返回 true,否则 Bob 获胜返回 false + +# 代码 + +```go +package leetcode + +func winnerOfGame(colors string) bool { + As, Bs := 0, 0 + Acont, Bcont := 0, 0 + for _, color := range colors { + if color == 'A' { + Acont += 1 + Bcont = 0 + } else { + Bcont += 1 + Acont = 0 + } + if Acont >= 3 { + As += Acont - 2 + } + if Bcont >= 3 { + Bs += Bcont - 2 + } + } + if As > Bs { + return true + } + return false +} +``` + + +---------------------------------------------- +
+

⬅️上一页

+

下一页➡️

+
diff --git a/website/content/ChapterFour/2000~2099/2043.Simple-Bank-System.md b/website/content/ChapterFour/2000~2099/2043.Simple-Bank-System.md new file mode 100644 index 000000000..b756eb8e0 --- /dev/null +++ b/website/content/ChapterFour/2000~2099/2043.Simple-Bank-System.md @@ -0,0 +1,120 @@ +# [2043. Simple Bank System](https://leetcode.com/problems/simple-bank-system/) + +## 题目 + +You have been tasked with writing a program for a popular bank that will automate all its incoming transactions (transfer, deposit, and withdraw). The bank has n accounts numbered from 1 to n. The initial balance of each account is stored in a 0-indexed integer array balance, with the (i + 1)th account having an initial balance of balance[i]. + +Execute all the valid transactions. A transaction is valid if: + +- The given account number(s) are between 1 and n, and +- The amount of money withdrawn or transferred from is less than or equal to the balance of the account. + +Implement the Bank class: + +- Bank(long[] balance) Initializes the object with the 0-indexed integer array balance. +- boolean transfer(int account1, int account2, long money) Transfers money dollars from the account numbered account1 to the account numbered account2. Return true if the transaction was successful, false otherwise. +- boolean deposit(int account, long money) Deposit money dollars into the account numbered account. Return true if the transaction was successful, false otherwise. +- boolean withdraw(int account, long money) Withdraw money dollars from the account numbered account. Return true if the transaction was successful, false otherwise. + +**Example 1:** + + Input + ["Bank", "withdraw", "transfer", "deposit", "transfer", "withdraw"] + [[[10, 100, 20, 50, 30]], [3, 10], [5, 1, 20], [5, 20], [3, 4, 15], [10, 50]] + Output + [null, true, true, true, false, false] + + Explanation + Bank bank = new Bank([10, 100, 20, 50, 30]); + bank.withdraw(3, 10); // return true, account 3 has a balance of $20, so it is valid to withdraw $10. + // Account 3 has $20 - $10 = $10. + bank.transfer(5, 1, 20); // return true, account 5 has a balance of $30, so it is valid to transfer $20. + // Account 5 has $30 - $20 = $10, and account 1 has $10 + $20 = $30. + bank.deposit(5, 20); // return true, it is valid to deposit $20 to account 5. + // Account 5 has $10 + $20 = $30. + bank.transfer(3, 4, 15); // return false, the current balance of account 3 is $10, + // so it is invalid to transfer $15 from it. + bank.withdraw(10, 50); // return false, it is invalid because account 10 does not exist. + +**Constraints:** + +- n == balance.length +- 1 <= n, account, account1, account2 <= 100000 +- 0 <= balance[i], money <= 1000000000000 +- At most 104 calls will be made to each function transfer, deposit, withdraw. + +## 题目大意 + +你的任务是为一个很受欢迎的银行设计一款程序,以自动化执行所有传入的交易(转账,存款和取款)。银行共有 n 个账户,编号从 1 到 n 。每个账号的初始余额存储在一个下标从 0 开始的整数数组 balance 中,其中第 (i + 1) 个账户的初始余额是 balance[i] 。 + +请你执行所有 有效的 交易。如果满足下面全部条件,则交易 有效 : + +- 指定的账户数量在 1 和 n 之间,且 +- 取款或者转账需要的钱的总数 小于或者等于 账户余额。 + +实现 Bank 类: + +- Bank(long[] balance) 使用下标从 0 开始的整数数组 balance 初始化该对象。 +- boolean transfer(int account1, int account2, long money) 从编号为 account1 的账户向编号为 account2 的账户转帐 money 美元。如果交易成功,返回 true ,否则,返回 false 。 +- boolean deposit(int account, long money) 向编号为 account 的账户存款 money 美元。如果交易成功,返回 true ;否则,返回 false 。 +- boolean withdraw(int account, long money) 从编号为 account 的账户取款 money 美元。如果交易成功,返回 true ;否则,返回 false 。 + +## 解题思路 + + 根据题意进行简单模拟 + +# 代码 + +```go +package leetcode + +type Bank struct { + accounts []int64 + n int +} + +func Constructor(balance []int64) Bank { + return Bank{ + accounts: balance, + n: len(balance), + } +} + +func (this *Bank) Transfer(account1 int, account2 int, money int64) bool { + if account1 > this.n || account2 > this.n { + return false + } + if this.accounts[account1-1] < money { + return false + } + this.accounts[account1-1] -= money + this.accounts[account2-1] += money + return true +} + +func (this *Bank) Deposit(account int, money int64) bool { + if account > this.n { + return false + } + this.accounts[account-1] += money + return true +} + +func (this *Bank) Withdraw(account int, money int64) bool { + if account > this.n { + return false + } + if this.accounts[account-1] < money { + return false + } + this.accounts[account-1] -= money + return true +} +``` + + +---------------------------------------------- +
+

⬅️上一页

+

下一页➡️

+
diff --git a/website/content/ChapterFour/2000~2099/2096.Step-By-Step-Directions-From-a-Binary-Tree-Node-to-Another.md b/website/content/ChapterFour/2000~2099/2096.Step-By-Step-Directions-From-a-Binary-Tree-Node-to-Another.md new file mode 100644 index 000000000..65dcf54fb --- /dev/null +++ b/website/content/ChapterFour/2000~2099/2096.Step-By-Step-Directions-From-a-Binary-Tree-Node-to-Another.md @@ -0,0 +1,152 @@ +# [2096. Step-By-Step Directions From a Binary Tree Node to Another](https://leetcode.com/problems/step-by-step-directions-from-a-binary-tree-node-to-another/) + + +## 题目 + +You are given the `root` of a **binary tree** with `n` nodes. Each node is uniquely assigned a value from `1` to `n`. You are also given an integer `startValue` representing the value of the start node `s`, and a different integer `destValue` representing the value of the destination node `t`. + +Find the **shortest path** starting from node `s` and ending at node `t`. Generate step-by-step directions of such path as a string consisting of only the **uppercase** letters `'L'`, `'R'`, and `'U'`. Each letter indicates a specific direction: + +- `'L'` means to go from a node to its **left child** node. +- `'R'` means to go from a node to its **right child** node. +- `'U'` means to go from a node to its **parent** node. + +Return *the step-by-step directions of the **shortest path** from node* `s` *to node* `t`. + +**Example 1:** + +![https://assets.leetcode.com/uploads/2021/11/15/eg1.png](https://assets.leetcode.com/uploads/2021/11/15/eg1.png) + +``` +Input: root = [5,1,2,3,null,6,4], startValue = 3, destValue = 6 +Output: "UURL" +Explanation: The shortest path is: 3 → 1 → 5 → 2 → 6. + +``` + +**Example 2:** + +![https://assets.leetcode.com/uploads/2021/11/15/eg2.png](https://assets.leetcode.com/uploads/2021/11/15/eg2.png) + +``` +Input: root = [2,1], startValue = 2, destValue = 1 +Output: "L" +Explanation: The shortest path is: 2 → 1. + +``` + +**Constraints:** + +- The number of nodes in the tree is `n`. +- `2 <= n <= 105` +- `1 <= Node.val <= n` +- All the values in the tree are **unique**. +- `1 <= startValue, destValue <= n` +- `startValue != destValue` + +## 题目大意 + +给你一棵 二叉树 的根节点 root ,这棵二叉树总共有 n 个节点。每个节点的值为 1 到 n 中的一个整数,且互不相同。给你一个整数 startValue ,表示起点节点 s 的值,和另一个不同的整数 destValue ,表示终点节点 t 的值。 + +请找到从节点 s 到节点 t 的 最短路径 ,并以字符串的形式返回每一步的方向。每一步用 大写 字母 'L' ,'R' 和 'U' 分别表示一种方向: + +- 'L' 表示从一个节点前往它的 左孩子 节点。 +- 'R' 表示从一个节点前往它的 右孩子 节点。 +- 'U' 表示从一个节点前往它的 父 节点。 + +请你返回从 s 到 t 最短路径 每一步的方向。 + +## 解题思路 + +- 二叉树中一个节点到另一个节点的最短路径一定可以分为两个部分(可能为空):从起点节点向上到两个节点的**最近公共祖先**,再从最近公共祖先向下到达终点节点。 +- 首先需要找到起点 s 与公共祖先的节点之间的 path1,公共祖先节点与终点 t 的 path2。再删掉 2 个 path 的公共前缀。如果起点 s 和终点 t 在不同的分支上,不存在公共前缀。如果他们在相同的分支上,那么最终答案要去掉这个公共前缀。 +- 删除掉公共前缀以后,需要再整理一下最终答案的输出格式。由于题目要求,起点到公共祖先节点需要输出 U,所以把这段 path1 全部改成 U,然后再拼接上 path2 字符串,即可得到的字符串即为待求 ss 到 tt 每一步的最短路径。 + +## 代码 + +```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 + * } + */ + +func getDirections(root *TreeNode, startValue int, destValue int) string { + sPath, dPath := make([]byte, 0), make([]byte, 0) + findPath(root, startValue, &sPath) + findPath(root, destValue, &dPath) + size, i := min(len(sPath), len(dPath)), 0 + for i < size { + if sPath[len(sPath)-1-i] == dPath[len(dPath)-1-i] { + i++ + } else { + break + } + } + sPath = sPath[:len(sPath)-i] + replace(sPath) + dPath = dPath[:len(dPath)-i] + reverse(dPath) + sPath = append(sPath, dPath...) + return string(sPath) +} + +func findPath(root *TreeNode, value int, path *[]byte) bool { + if root.Val == value { + return true + } + + if root.Left != nil && findPath(root.Left, value, path) { + *path = append(*path, 'L') + return true + } + + if root.Right != nil && findPath(root.Right, value, path) { + *path = append(*path, 'R') + return true + } + + return false +} + +func reverse(path []byte) { + left, right := 0, len(path)-1 + for left < right { + path[left], path[right] = path[right], path[left] + left++ + right-- + } +} + +func replace(path []byte) { + for i := 0; i < len(path); i++ { + path[i] = 'U' + } +} + +func min(i, j int) int { + if i < j { + return i + } + return j +} +``` + + +---------------------------------------------- +
+

⬅️上一页

+

下一页➡️

+
diff --git a/website/content/ChapterFour/2100~2199/2164.Sort-Even-and-Odd-Indices-Independently.md b/website/content/ChapterFour/2100~2199/2164.Sort-Even-and-Odd-Indices-Independently.md index 3b730bd3f..bb3a1e28c 100644 --- a/website/content/ChapterFour/2100~2199/2164.Sort-Even-and-Odd-Indices-Independently.md +++ b/website/content/ChapterFour/2100~2199/2164.Sort-Even-and-Odd-Indices-Independently.md @@ -95,6 +95,6 @@ func sortEvenOdd(nums []int) []int { ----------------------------------------------
-

⬅️上一页

+

⬅️上一页

下一页➡️

diff --git a/website/content/ChapterFour/2100~2199/2181.Merge-Nodes-in-Between-Zeros.md b/website/content/ChapterFour/2100~2199/2181.Merge-Nodes-in-Between-Zeros.md index 3fd16bd93..35ef63ea0 100644 --- a/website/content/ChapterFour/2100~2199/2181.Merge-Nodes-in-Between-Zeros.md +++ b/website/content/ChapterFour/2100~2199/2181.Merge-Nodes-in-Between-Zeros.md @@ -60,7 +60,7 @@ The above figure represents the given linked list. The modified list contains package leetcode import ( - "github.com/halfrost/LeetCode-Go/structures" + "github.com/halfrost/leetcode-go/structures" ) // ListNode define diff --git a/website/content/ChapterFour/2200~2299/_index.md b/website/content/ChapterFour/2200~2299/_index.md new file mode 100644 index 000000000..e954f0877 --- /dev/null +++ b/website/content/ChapterFour/2200~2299/_index.md @@ -0,0 +1,4 @@ +--- +bookCollapseSection: true +weight: 20 +--- diff --git a/website/content/ChapterOne/Time_Complexity.md b/website/content/ChapterOne/Time_Complexity.md index e8cafc01b..b68708bb2 100644 --- a/website/content/ChapterOne/Time_Complexity.md +++ b/website/content/ChapterOne/Time_Complexity.md @@ -44,6 +44,7 @@ void hello (int n){ ```c bool isPrime (int n){ + if (num <= 1) return false; for( int x = 2 ; x * x <= n ; x ++ ) if( n % x == 0 ) return false; diff --git a/website/content/ChapterOne/_index.md b/website/content/ChapterOne/_index.md index 48ff3ac10..6d535294a 100644 --- a/website/content/ChapterOne/_index.md +++ b/website/content/ChapterOne/_index.md @@ -35,7 +35,7 @@ weight: 1 ## 关于作者 -笔者是一个刚刚入行一年半的 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+: @@ -49,7 +49,7 @@ weight: 1 ## 关于书中的代码 -代码都放在 [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%。这题就如同没做一样。而且面试中如果给了这样的答案,面试官也不会满意,“还有没有更优解?”。如果通过自己的思考能给出更优解,面试官会更满意一些。 diff --git a/website/content/ChapterTwo/Array.md b/website/content/ChapterTwo/Array.md index ec43a4bd8..1ef86606b 100644 --- a/website/content/ChapterTwo/Array.md +++ b/website/content/ChapterTwo/Array.md @@ -8,406 +8,422 @@ weight: 1 | No. | Title | Solution | Difficulty | TimeComplexity | SpaceComplexity |Favorite| Acceptance | |:--------:|:------- | :--------: | :----------: | :----: | :-----: | :-----: |:-----: | -|0001|Two Sum|[Go]({{< relref "/ChapterFour/0001~0099/0001.Two-Sum.md" >}})|Easy| O(n)| O(n)||48.6%| -|0004|Median of Two Sorted Arrays|[Go]({{< relref "/ChapterFour/0001~0099/0004.Median-of-Two-Sorted-Arrays.md" >}})|Hard||||34.1%| -|0011|Container With Most Water|[Go]({{< relref "/ChapterFour/0001~0099/0011.Container-With-Most-Water.md" >}})|Medium| O(n)| O(1)||53.9%| -|0015|3Sum|[Go]({{< relref "/ChapterFour/0001~0099/0015.3Sum.md" >}})|Medium| O(n^2)| O(n)|❤️|31.1%| -|0016|3Sum Closest|[Go]({{< relref "/ChapterFour/0001~0099/0016.3Sum-Closest.md" >}})|Medium| O(n^2)| O(1)|❤️|47.1%| -|0018|4Sum|[Go]({{< relref "/ChapterFour/0001~0099/0018.4Sum.md" >}})|Medium| O(n^3)| O(n^2)|❤️|37.3%| -|0026|Remove Duplicates from Sorted Array|[Go]({{< relref "/ChapterFour/0001~0099/0026.Remove-Duplicates-from-Sorted-Array.md" >}})|Easy| O(n)| O(1)||48.9%| -|0027|Remove Element|[Go]({{< relref "/ChapterFour/0001~0099/0027.Remove-Element.md" >}})|Easy| O(n)| O(1)||51.2%| -|0031|Next Permutation|[Go]({{< relref "/ChapterFour/0001~0099/0031.Next-Permutation.md" >}})|Medium||||36.4%| -|0033|Search in Rotated Sorted Array|[Go]({{< relref "/ChapterFour/0001~0099/0033.Search-in-Rotated-Sorted-Array.md" >}})|Medium||||37.8%| -|0034|Find First and Last Position of Element in Sorted Array|[Go]({{< relref "/ChapterFour/0001~0099/0034.Find-First-and-Last-Position-of-Element-in-Sorted-Array.md" >}})|Medium||||40.0%| -|0035|Search Insert Position|[Go]({{< relref "/ChapterFour/0001~0099/0035.Search-Insert-Position.md" >}})|Easy||||42.3%| -|0036|Valid Sudoku|[Go]({{< relref "/ChapterFour/0001~0099/0036.Valid-Sudoku.md" >}})|Medium||||55.1%| -|0037|Sudoku Solver|[Go]({{< relref "/ChapterFour/0001~0099/0037.Sudoku-Solver.md" >}})|Hard||||54.0%| -|0039|Combination Sum|[Go]({{< relref "/ChapterFour/0001~0099/0039.Combination-Sum.md" >}})|Medium| O(n log n)| O(n)||65.5%| -|0040|Combination Sum II|[Go]({{< relref "/ChapterFour/0001~0099/0040.Combination-Sum-II.md" >}})|Medium| O(n log n)| O(n)||52.4%| -|0041|First Missing Positive|[Go]({{< relref "/ChapterFour/0001~0099/0041.First-Missing-Positive.md" >}})|Hard| O(n)| O(n)||36.0%| -|0042|Trapping Rain Water|[Go]({{< relref "/ChapterFour/0001~0099/0042.Trapping-Rain-Water.md" >}})|Hard| O(n)| O(1)|❤️|56.5%| -|0045|Jump Game II|[Go]({{< relref "/ChapterFour/0001~0099/0045.Jump-Game-II.md" >}})|Medium||||37.1%| -|0046|Permutations|[Go]({{< relref "/ChapterFour/0001~0099/0046.Permutations.md" >}})|Medium||||72.3%| -|0047|Permutations II|[Go]({{< relref "/ChapterFour/0001~0099/0047.Permutations-II.md" >}})|Medium||||54.1%| -|0048|Rotate Image|[Go]({{< relref "/ChapterFour/0001~0099/0048.Rotate-Image.md" >}})|Medium| O(n)| O(1)||66.6%| -|0051|N-Queens|[Go]({{< relref "/ChapterFour/0001~0099/0051.N-Queens.md" >}})|Hard||||57.5%| -|0053|Maximum Subarray|[Go]({{< relref "/ChapterFour/0001~0099/0053.Maximum-Subarray.md" >}})|Easy| O(n)| O(n)||49.5%| -|0054|Spiral Matrix|[Go]({{< relref "/ChapterFour/0001~0099/0054.Spiral-Matrix.md" >}})|Medium| O(n)| O(n^2)||41.4%| -|0055|Jump Game|[Go]({{< relref "/ChapterFour/0001~0099/0055.Jump-Game.md" >}})|Medium||||37.8%| -|0056|Merge Intervals|[Go]({{< relref "/ChapterFour/0001~0099/0056.Merge-Intervals.md" >}})|Medium| O(n log n)| O(1)||44.9%| -|0057|Insert Interval|[Go]({{< relref "/ChapterFour/0001~0099/0057.Insert-Interval.md" >}})|Medium| O(n)| O(1)||37.4%| -|0059|Spiral Matrix II|[Go]({{< relref "/ChapterFour/0001~0099/0059.Spiral-Matrix-II.md" >}})|Medium| O(n)| O(n^2)||64.9%| -|0063|Unique Paths II|[Go]({{< relref "/ChapterFour/0001~0099/0063.Unique-Paths-II.md" >}})|Medium| O(n^2)| O(n^2)||37.5%| -|0064|Minimum Path Sum|[Go]({{< relref "/ChapterFour/0001~0099/0064.Minimum-Path-Sum.md" >}})|Medium| O(n^2)| O(n^2)||59.4%| -|0066|Plus One|[Go]({{< relref "/ChapterFour/0001~0099/0066.Plus-One.md" >}})|Easy||||42.8%| -|0073|Set Matrix Zeroes|[Go]({{< relref "/ChapterFour/0001~0099/0073.Set-Matrix-Zeroes.md" >}})|Medium||||48.3%| -|0074|Search a 2D Matrix|[Go]({{< relref "/ChapterFour/0001~0099/0074.Search-a-2D-Matrix.md" >}})|Medium||||44.4%| -|0075|Sort Colors|[Go]({{< relref "/ChapterFour/0001~0099/0075.Sort-Colors.md" >}})|Medium| O(n)| O(1)|❤️|54.8%| -|0078|Subsets|[Go]({{< relref "/ChapterFour/0001~0099/0078.Subsets.md" >}})|Medium| O(n^2)| O(n)|❤️|71.5%| -|0079|Word Search|[Go]({{< relref "/ChapterFour/0001~0099/0079.Word-Search.md" >}})|Medium| O(n^2)| O(n^2)|❤️|39.7%| -|0080|Remove Duplicates from Sorted Array II|[Go]({{< relref "/ChapterFour/0001~0099/0080.Remove-Duplicates-from-Sorted-Array-II.md" >}})|Medium| O(n)| O(1||50.5%| -|0081|Search in Rotated Sorted Array II|[Go]({{< relref "/ChapterFour/0001~0099/0081.Search-in-Rotated-Sorted-Array-II.md" >}})|Medium||||35.6%| -|0084|Largest Rectangle in Histogram|[Go]({{< relref "/ChapterFour/0001~0099/0084.Largest-Rectangle-in-Histogram.md" >}})|Hard| O(n)| O(n)|❤️|40.8%| -|0088|Merge Sorted Array|[Go]({{< relref "/ChapterFour/0001~0099/0088.Merge-Sorted-Array.md" >}})|Easy| O(n)| O(1)|❤️|43.9%| -|0090|Subsets II|[Go]({{< relref "/ChapterFour/0001~0099/0090.Subsets-II.md" >}})|Medium| O(n^2)| O(n)|❤️|53.3%| -|0105|Construct Binary Tree from Preorder and Inorder Traversal|[Go]({{< relref "/ChapterFour/0100~0199/0105.Construct-Binary-Tree-from-Preorder-and-Inorder-Traversal.md" >}})|Medium||||57.7%| -|0106|Construct Binary Tree from Inorder and Postorder Traversal|[Go]({{< relref "/ChapterFour/0100~0199/0106.Construct-Binary-Tree-from-Inorder-and-Postorder-Traversal.md" >}})|Medium||||55.4%| -|0108|Convert Sorted Array to Binary Search Tree|[Go]({{< relref "/ChapterFour/0100~0199/0108.Convert-Sorted-Array-to-Binary-Search-Tree.md" >}})|Easy||||66.1%| -|0118|Pascal's Triangle|[Go]({{< relref "/ChapterFour/0100~0199/0118.Pascals-Triangle.md" >}})|Easy||||64.6%| -|0119|Pascal's Triangle II|[Go]({{< relref "/ChapterFour/0100~0199/0119.Pascals-Triangle-II.md" >}})|Easy||||57.5%| -|0120|Triangle|[Go]({{< relref "/ChapterFour/0100~0199/0120.Triangle.md" >}})|Medium| O(n^2)| O(n)||50.8%| -|0121|Best Time to Buy and Sell Stock|[Go]({{< relref "/ChapterFour/0100~0199/0121.Best-Time-to-Buy-and-Sell-Stock.md" >}})|Easy| O(n)| O(1)||54.1%| -|0122|Best Time to Buy and Sell Stock II|[Go]({{< relref "/ChapterFour/0100~0199/0122.Best-Time-to-Buy-and-Sell-Stock-II.md" >}})|Medium| O(n)| O(1)||62.0%| -|0128|Longest Consecutive Sequence|[Go]({{< relref "/ChapterFour/0100~0199/0128.Longest-Consecutive-Sequence.md" >}})|Medium||||48.7%| -|0130|Surrounded Regions|[Go]({{< relref "/ChapterFour/0100~0199/0130.Surrounded-Regions.md" >}})|Medium||||34.0%| -|0135|Candy|[Go]({{< relref "/ChapterFour/0100~0199/0135.Candy.md" >}})|Hard||||37.1%| -|0136|Single Number|[Go]({{< relref "/ChapterFour/0100~0199/0136.Single-Number.md" >}})|Easy||||69.4%| -|0137|Single Number II|[Go]({{< relref "/ChapterFour/0100~0199/0137.Single-Number-II.md" >}})|Medium||||56.6%| -|0150|Evaluate Reverse Polish Notation|[Go]({{< relref "/ChapterFour/0100~0199/0150.Evaluate-Reverse-Polish-Notation.md" >}})|Medium||||42.6%| -|0152|Maximum Product Subarray|[Go]({{< relref "/ChapterFour/0100~0199/0152.Maximum-Product-Subarray.md" >}})|Medium| O(n)| O(1)||34.6%| -|0153|Find Minimum in Rotated Sorted Array|[Go]({{< relref "/ChapterFour/0100~0199/0153.Find-Minimum-in-Rotated-Sorted-Array.md" >}})|Medium||||47.9%| -|0154|Find Minimum in Rotated Sorted Array II|[Go]({{< relref "/ChapterFour/0100~0199/0154.Find-Minimum-in-Rotated-Sorted-Array-II.md" >}})|Hard||||43.3%| +|0001|Two Sum|[Go]({{< relref "/ChapterFour/0001~0099/0001.Two-Sum.md" >}})|Easy| O(n)| O(n)||49.7%| +|0004|Median of Two Sorted Arrays|[Go]({{< relref "/ChapterFour/0001~0099/0004.Median-of-Two-Sorted-Arrays.md" >}})|Hard||||36.2%| +|0011|Container With Most Water|[Go]({{< relref "/ChapterFour/0001~0099/0011.Container-With-Most-Water.md" >}})|Medium| O(n)| O(1)||54.0%| +|0015|3Sum|[Go]({{< relref "/ChapterFour/0001~0099/0015.3Sum.md" >}})|Medium| O(n^2)| O(n)|❤️|32.6%| +|0016|3Sum Closest|[Go]({{< relref "/ChapterFour/0001~0099/0016.3Sum-Closest.md" >}})|Medium| O(n^2)| O(1)|❤️|45.7%| +|0018|4Sum|[Go]({{< relref "/ChapterFour/0001~0099/0018.4Sum.md" >}})|Medium| O(n^3)| O(n^2)|❤️|35.9%| +|0026|Remove Duplicates from Sorted Array|[Go]({{< relref "/ChapterFour/0001~0099/0026.Remove-Duplicates-from-Sorted-Array.md" >}})|Easy| O(n)| O(1)||51.6%| +|0027|Remove Element|[Go]({{< relref "/ChapterFour/0001~0099/0027.Remove-Element.md" >}})|Easy| O(n)| O(1)||53.0%| +|0031|Next Permutation|[Go]({{< relref "/ChapterFour/0001~0099/0031.Next-Permutation.md" >}})|Medium||||37.6%| +|0033|Search in Rotated Sorted Array|[Go]({{< relref "/ChapterFour/0001~0099/0033.Search-in-Rotated-Sorted-Array.md" >}})|Medium||||39.0%| +|0034|Find First and Last Position of Element in Sorted Array|[Go]({{< relref "/ChapterFour/0001~0099/0034.Find-First-and-Last-Position-of-Element-in-Sorted-Array.md" >}})|Medium||||41.9%| +|0035|Search Insert Position|[Go]({{< relref "/ChapterFour/0001~0099/0035.Search-Insert-Position.md" >}})|Easy||||43.4%| +|0036|Valid Sudoku|[Go]({{< relref "/ChapterFour/0001~0099/0036.Valid-Sudoku.md" >}})|Medium||||58.1%| +|0037|Sudoku Solver|[Go]({{< relref "/ChapterFour/0001~0099/0037.Sudoku-Solver.md" >}})|Hard||||57.7%| +|0039|Combination Sum|[Go]({{< relref "/ChapterFour/0001~0099/0039.Combination-Sum.md" >}})|Medium| O(n log n)| O(n)||68.6%| +|0040|Combination Sum II|[Go]({{< relref "/ChapterFour/0001~0099/0040.Combination-Sum-II.md" >}})|Medium| O(n log n)| O(n)||53.4%| +|0041|First Missing Positive|[Go]({{< relref "/ChapterFour/0001~0099/0041.First-Missing-Positive.md" >}})|Hard| O(n)| O(n)||36.7%| +|0042|Trapping Rain Water|[Go]({{< relref "/ChapterFour/0001~0099/0042.Trapping-Rain-Water.md" >}})|Hard| O(n)| O(1)|❤️|59.3%| +|0045|Jump Game II|[Go]({{< relref "/ChapterFour/0001~0099/0045.Jump-Game-II.md" >}})|Medium||||39.8%| +|0046|Permutations|[Go]({{< relref "/ChapterFour/0001~0099/0046.Permutations.md" >}})|Medium||||75.7%| +|0047|Permutations II|[Go]({{< relref "/ChapterFour/0001~0099/0047.Permutations-II.md" >}})|Medium||||57.4%| +|0048|Rotate Image|[Go]({{< relref "/ChapterFour/0001~0099/0048.Rotate-Image.md" >}})|Medium| O(n)| O(1)||71.0%| +|0049|Group Anagrams|[Go]({{< relref "/ChapterFour/0001~0099/0049.Group-Anagrams.md" >}})|Medium||||66.8%| +|0051|N-Queens|[Go]({{< relref "/ChapterFour/0001~0099/0051.N-Queens.md" >}})|Hard||||64.2%| +|0053|Maximum Subarray|[Go]({{< relref "/ChapterFour/0001~0099/0053.Maximum-Subarray.md" >}})|Medium| O(n)| O(n)||50.2%| +|0054|Spiral Matrix|[Go]({{< relref "/ChapterFour/0001~0099/0054.Spiral-Matrix.md" >}})|Medium| O(n)| O(n^2)||45.0%| +|0055|Jump Game|[Go]({{< relref "/ChapterFour/0001~0099/0055.Jump-Game.md" >}})|Medium||||38.9%| +|0056|Merge Intervals|[Go]({{< relref "/ChapterFour/0001~0099/0056.Merge-Intervals.md" >}})|Medium| O(n log n)| O(1)||46.2%| +|0057|Insert Interval|[Go]({{< relref "/ChapterFour/0001~0099/0057.Insert-Interval.md" >}})|Medium| O(n)| O(1)||39.0%| +|0059|Spiral Matrix II|[Go]({{< relref "/ChapterFour/0001~0099/0059.Spiral-Matrix-II.md" >}})|Medium| O(n)| O(n^2)||67.4%| +|0063|Unique Paths II|[Go]({{< relref "/ChapterFour/0001~0099/0063.Unique-Paths-II.md" >}})|Medium| O(n^2)| O(n^2)||39.4%| +|0064|Minimum Path Sum|[Go]({{< relref "/ChapterFour/0001~0099/0064.Minimum-Path-Sum.md" >}})|Medium| O(n^2)| O(n^2)||62.0%| +|0066|Plus One|[Go]({{< relref "/ChapterFour/0001~0099/0066.Plus-One.md" >}})|Easy||||43.7%| +|0073|Set Matrix Zeroes|[Go]({{< relref "/ChapterFour/0001~0099/0073.Set-Matrix-Zeroes.md" >}})|Medium||||51.3%| +|0074|Search a 2D Matrix|[Go]({{< relref "/ChapterFour/0001~0099/0074.Search-a-2D-Matrix.md" >}})|Medium||||47.7%| +|0075|Sort Colors|[Go]({{< relref "/ChapterFour/0001~0099/0075.Sort-Colors.md" >}})|Medium| O(n)| O(1)|❤️|58.6%| +|0078|Subsets|[Go]({{< relref "/ChapterFour/0001~0099/0078.Subsets.md" >}})|Medium| O(n^2)| O(n)|❤️|74.9%| +|0079|Word Search|[Go]({{< relref "/ChapterFour/0001~0099/0079.Word-Search.md" >}})|Medium| O(n^2)| O(n^2)|❤️|40.2%| +|0080|Remove Duplicates from Sorted Array II|[Go]({{< relref "/ChapterFour/0001~0099/0080.Remove-Duplicates-from-Sorted-Array-II.md" >}})|Medium| O(n)| O(1||52.3%| +|0081|Search in Rotated Sorted Array II|[Go]({{< relref "/ChapterFour/0001~0099/0081.Search-in-Rotated-Sorted-Array-II.md" >}})|Medium||||35.7%| +|0084|Largest Rectangle in Histogram|[Go]({{< relref "/ChapterFour/0001~0099/0084.Largest-Rectangle-in-Histogram.md" >}})|Hard| O(n)| O(n)|❤️|42.6%| +|0088|Merge Sorted Array|[Go]({{< relref "/ChapterFour/0001~0099/0088.Merge-Sorted-Array.md" >}})|Easy| O(n)| O(1)|❤️|46.6%| +|0090|Subsets II|[Go]({{< relref "/ChapterFour/0001~0099/0090.Subsets-II.md" >}})|Medium| O(n^2)| O(n)|❤️|55.9%| +|0105|Construct Binary Tree from Preorder and Inorder Traversal|[Go]({{< relref "/ChapterFour/0100~0199/0105.Construct-Binary-Tree-from-Preorder-and-Inorder-Traversal.md" >}})|Medium||||61.6%| +|0106|Construct Binary Tree from Inorder and Postorder Traversal|[Go]({{< relref "/ChapterFour/0100~0199/0106.Construct-Binary-Tree-from-Inorder-and-Postorder-Traversal.md" >}})|Medium||||60.0%| +|0108|Convert Sorted Array to Binary Search Tree|[Go]({{< relref "/ChapterFour/0100~0199/0108.Convert-Sorted-Array-to-Binary-Search-Tree.md" >}})|Easy||||69.9%| +|0118|Pascal's Triangle|[Go]({{< relref "/ChapterFour/0100~0199/0118.Pascals-Triangle.md" >}})|Easy||||70.8%| +|0119|Pascal's Triangle II|[Go]({{< relref "/ChapterFour/0100~0199/0119.Pascals-Triangle-II.md" >}})|Easy||||60.8%| +|0120|Triangle|[Go]({{< relref "/ChapterFour/0100~0199/0120.Triangle.md" >}})|Medium| O(n^2)| O(n)||54.5%| +|0121|Best Time to Buy and Sell Stock|[Go]({{< relref "/ChapterFour/0100~0199/0121.Best-Time-to-Buy-and-Sell-Stock.md" >}})|Easy| O(n)| O(1)||54.3%| +|0122|Best Time to Buy and Sell Stock II|[Go]({{< relref "/ChapterFour/0100~0199/0122.Best-Time-to-Buy-and-Sell-Stock-II.md" >}})|Medium| O(n)| O(1)||63.9%| +|0128|Longest Consecutive Sequence|[Go]({{< relref "/ChapterFour/0100~0199/0128.Longest-Consecutive-Sequence.md" >}})|Medium||||48.5%| +|0130|Surrounded Regions|[Go]({{< relref "/ChapterFour/0100~0199/0130.Surrounded-Regions.md" >}})|Medium||||36.8%| +|0135|Candy|[Go]({{< relref "/ChapterFour/0100~0199/0135.Candy.md" >}})|Hard||||41.0%| +|0136|Single Number|[Go]({{< relref "/ChapterFour/0100~0199/0136.Single-Number.md" >}})|Easy||||70.7%| +|0137|Single Number II|[Go]({{< relref "/ChapterFour/0100~0199/0137.Single-Number-II.md" >}})|Medium||||58.5%| +|0150|Evaluate Reverse Polish Notation|[Go]({{< relref "/ChapterFour/0100~0199/0150.Evaluate-Reverse-Polish-Notation.md" >}})|Medium||||45.8%| +|0152|Maximum Product Subarray|[Go]({{< relref "/ChapterFour/0100~0199/0152.Maximum-Product-Subarray.md" >}})|Medium| O(n)| O(1)||34.9%| +|0153|Find Minimum in Rotated Sorted Array|[Go]({{< relref "/ChapterFour/0100~0199/0153.Find-Minimum-in-Rotated-Sorted-Array.md" >}})|Medium||||48.9%| +|0154|Find Minimum in Rotated Sorted Array II|[Go]({{< relref "/ChapterFour/0100~0199/0154.Find-Minimum-in-Rotated-Sorted-Array-II.md" >}})|Hard||||43.5%| |0162|Find Peak Element|[Go]({{< relref "/ChapterFour/0100~0199/0162.Find-Peak-Element.md" >}})|Medium||||46.0%| -|0164|Maximum Gap|[Go]({{< relref "/ChapterFour/0100~0199/0164.Maximum-Gap.md" >}})|Hard||||41.4%| -|0167|Two Sum II - Input Array Is Sorted|[Go]({{< relref "/ChapterFour/0100~0199/0167.Two-Sum-II-Input-Array-Is-Sorted.md" >}})|Medium| O(n)| O(1)||58.7%| -|0169|Majority Element|[Go]({{< relref "/ChapterFour/0100~0199/0169.Majority-Element.md" >}})|Easy||||62.9%| -|0174|Dungeon Game|[Go]({{< relref "/ChapterFour/0100~0199/0174.Dungeon-Game.md" >}})|Hard||||36.5%| -|0189|Rotate Array|[Go]({{< relref "/ChapterFour/0100~0199/0189.Rotate-Array.md" >}})|Medium||||38.6%| -|0198|House Robber|[Go]({{< relref "/ChapterFour/0100~0199/0198.House-Robber.md" >}})|Medium||||47.2%| -|0200|Number of Islands|[Go]({{< relref "/ChapterFour/0200~0299/0200.Number-of-Islands.md" >}})|Medium||||53.9%| -|0204|Count Primes|[Go]({{< relref "/ChapterFour/0200~0299/0204.Count-Primes.md" >}})|Medium||||33.0%| -|0209|Minimum Size Subarray Sum|[Go]({{< relref "/ChapterFour/0200~0299/0209.Minimum-Size-Subarray-Sum.md" >}})|Medium| O(n)| O(1)||43.3%| -|0212|Word Search II|[Go]({{< relref "/ChapterFour/0200~0299/0212.Word-Search-II.md" >}})|Hard||||38.0%| -|0213|House Robber II|[Go]({{< relref "/ChapterFour/0200~0299/0213.House-Robber-II.md" >}})|Medium||||39.9%| -|0215|Kth Largest Element in an Array|[Go]({{< relref "/ChapterFour/0200~0299/0215.Kth-Largest-Element-in-an-Array.md" >}})|Medium||||63.5%| -|0216|Combination Sum III|[Go]({{< relref "/ChapterFour/0200~0299/0216.Combination-Sum-III.md" >}})|Medium| O(n)| O(1)|❤️|64.0%| -|0217|Contains Duplicate|[Go]({{< relref "/ChapterFour/0200~0299/0217.Contains-Duplicate.md" >}})|Easy| O(n)| O(n)||60.8%| -|0218|The Skyline Problem|[Go]({{< relref "/ChapterFour/0200~0299/0218.The-Skyline-Problem.md" >}})|Hard||||38.7%| -|0219|Contains Duplicate II|[Go]({{< relref "/ChapterFour/0200~0299/0219.Contains-Duplicate-II.md" >}})|Easy| O(n)| O(n)||40.7%| -|0220|Contains Duplicate III|[Go]({{< relref "/ChapterFour/0200~0299/0220.Contains-Duplicate-III.md" >}})|Medium||||21.7%| -|0228|Summary Ranges|[Go]({{< relref "/ChapterFour/0200~0299/0228.Summary-Ranges.md" >}})|Easy||||46.4%| -|0229|Majority Element II|[Go]({{< relref "/ChapterFour/0200~0299/0229.Majority-Element-II.md" >}})|Medium||||42.4%| -|0239|Sliding Window Maximum|[Go]({{< relref "/ChapterFour/0200~0299/0239.Sliding-Window-Maximum.md" >}})|Hard||||46.2%| -|0240|Search a 2D Matrix II|[Go]({{< relref "/ChapterFour/0200~0299/0240.Search-a-2D-Matrix-II.md" >}})|Medium||||48.4%| -|0260|Single Number III|[Go]({{< relref "/ChapterFour/0200~0299/0260.Single-Number-III.md" >}})|Medium||||67.2%| -|0268|Missing Number|[Go]({{< relref "/ChapterFour/0200~0299/0268.Missing-Number.md" >}})|Easy||||59.4%| -|0274|H-Index|[Go]({{< relref "/ChapterFour/0200~0299/0274.H-Index.md" >}})|Medium||||37.6%| -|0275|H-Index II|[Go]({{< relref "/ChapterFour/0200~0299/0275.H-Index-II.md" >}})|Medium||||37.0%| -|0283|Move Zeroes|[Go]({{< relref "/ChapterFour/0200~0299/0283.Move-Zeroes.md" >}})|Easy| O(n)| O(1)||60.6%| -|0284|Peeking Iterator|[Go]({{< relref "/ChapterFour/0200~0299/0284.Peeking-Iterator.md" >}})|Medium||||57.6%| -|0287|Find the Duplicate Number|[Go]({{< relref "/ChapterFour/0200~0299/0287.Find-the-Duplicate-Number.md" >}})|Medium| O(n)| O(1)|❤️|58.8%| -|0300|Longest Increasing Subsequence|[Go]({{< relref "/ChapterFour/0300~0399/0300.Longest-Increasing-Subsequence.md" >}})|Medium||||49.3%| -|0303|Range Sum Query - Immutable|[Go]({{< relref "/ChapterFour/0300~0399/0303.Range-Sum-Query-Immutable.md" >}})|Easy||||55.5%| -|0304|Range Sum Query 2D - Immutable|[Go]({{< relref "/ChapterFour/0300~0399/0304.Range-Sum-Query-2D-Immutable.md" >}})|Medium||||47.7%| -|0307|Range Sum Query - Mutable|[Go]({{< relref "/ChapterFour/0300~0399/0307.Range-Sum-Query-Mutable.md" >}})|Medium||||38.7%| -|0309|Best Time to Buy and Sell Stock with Cooldown|[Go]({{< relref "/ChapterFour/0300~0399/0309.Best-Time-to-Buy-and-Sell-Stock-with-Cooldown.md" >}})|Medium||||52.5%| -|0315|Count of Smaller Numbers After Self|[Go]({{< relref "/ChapterFour/0300~0399/0315.Count-of-Smaller-Numbers-After-Self.md" >}})|Hard||||42.0%| -|0318|Maximum Product of Word Lengths|[Go]({{< relref "/ChapterFour/0300~0399/0318.Maximum-Product-of-Word-Lengths.md" >}})|Medium||||56.7%| -|0322|Coin Change|[Go]({{< relref "/ChapterFour/0300~0399/0322.Coin-Change.md" >}})|Medium||||40.1%| -|0324|Wiggle Sort II|[Go]({{< relref "/ChapterFour/0300~0399/0324.Wiggle-Sort-II.md" >}})|Medium||||32.2%| -|0327|Count of Range Sum|[Go]({{< relref "/ChapterFour/0300~0399/0327.Count-of-Range-Sum.md" >}})|Hard||||36.0%| -|0347|Top K Frequent Elements|[Go]({{< relref "/ChapterFour/0300~0399/0347.Top-K-Frequent-Elements.md" >}})|Medium||||65.1%| -|0349|Intersection of Two Arrays|[Go]({{< relref "/ChapterFour/0300~0399/0349.Intersection-of-Two-Arrays.md" >}})|Easy||||69.1%| -|0350|Intersection of Two Arrays II|[Go]({{< relref "/ChapterFour/0300~0399/0350.Intersection-of-Two-Arrays-II.md" >}})|Easy||||54.9%| -|0354|Russian Doll Envelopes|[Go]({{< relref "/ChapterFour/0300~0399/0354.Russian-Doll-Envelopes.md" >}})|Hard||||38.9%| -|0368|Largest Divisible Subset|[Go]({{< relref "/ChapterFour/0300~0399/0368.Largest-Divisible-Subset.md" >}})|Medium||||40.6%| -|0373|Find K Pairs with Smallest Sums|[Go]({{< relref "/ChapterFour/0300~0399/0373.Find-K-Pairs-with-Smallest-Sums.md" >}})|Medium||||38.8%| -|0376|Wiggle Subsequence|[Go]({{< relref "/ChapterFour/0300~0399/0376.Wiggle-Subsequence.md" >}})|Medium||||44.9%| -|0377|Combination Sum IV|[Go]({{< relref "/ChapterFour/0300~0399/0377.Combination-Sum-IV.md" >}})|Medium||||49.4%| -|0378|Kth Smallest Element in a Sorted Matrix|[Go]({{< relref "/ChapterFour/0300~0399/0378.Kth-Smallest-Element-in-a-Sorted-Matrix.md" >}})|Medium||||59.7%| -|0384|Shuffle an Array|[Go]({{< relref "/ChapterFour/0300~0399/0384.Shuffle-an-Array.md" >}})|Medium||||57.0%| -|0391|Perfect Rectangle|[Go]({{< relref "/ChapterFour/0300~0399/0391.Perfect-Rectangle.md" >}})|Hard||||32.1%| -|0393|UTF-8 Validation|[Go]({{< relref "/ChapterFour/0300~0399/0393.UTF-8-Validation.md" >}})|Medium||||39.2%| -|0399|Evaluate Division|[Go]({{< relref "/ChapterFour/0300~0399/0399.Evaluate-Division.md" >}})|Medium||||58.6%| -|0410|Split Array Largest Sum|[Go]({{< relref "/ChapterFour/0400~0499/0410.Split-Array-Largest-Sum.md" >}})|Hard||||52.1%| -|0413|Arithmetic Slices|[Go]({{< relref "/ChapterFour/0400~0499/0413.Arithmetic-Slices.md" >}})|Medium||||64.5%| -|0414|Third Maximum Number|[Go]({{< relref "/ChapterFour/0400~0499/0414.Third-Maximum-Number.md" >}})|Easy||||31.8%| -|0416|Partition Equal Subset Sum|[Go]({{< relref "/ChapterFour/0400~0499/0416.Partition-Equal-Subset-Sum.md" >}})|Medium||||46.4%| -|0417|Pacific Atlantic Water Flow|[Go]({{< relref "/ChapterFour/0400~0499/0417.Pacific-Atlantic-Water-Flow.md" >}})|Medium||||49.2%| -|0421|Maximum XOR of Two Numbers in an Array|[Go]({{< relref "/ChapterFour/0400~0499/0421.Maximum-XOR-of-Two-Numbers-in-an-Array.md" >}})|Medium||||54.3%| -|0435|Non-overlapping Intervals|[Go]({{< relref "/ChapterFour/0400~0499/0435.Non-overlapping-Intervals.md" >}})|Medium||||48.3%| -|0436|Find Right Interval|[Go]({{< relref "/ChapterFour/0400~0499/0436.Find-Right-Interval.md" >}})|Medium||||49.5%| -|0447|Number of Boomerangs|[Go]({{< relref "/ChapterFour/0400~0499/0447.Number-of-Boomerangs.md" >}})|Medium||||54.2%| -|0448|Find All Numbers Disappeared in an Array|[Go]({{< relref "/ChapterFour/0400~0499/0448.Find-All-Numbers-Disappeared-in-an-Array.md" >}})|Easy||||59.1%| -|0453|Minimum Moves to Equal Array Elements|[Go]({{< relref "/ChapterFour/0400~0499/0453.Minimum-Moves-to-Equal-Array-Elements.md" >}})|Medium||||54.1%| -|0454|4Sum II|[Go]({{< relref "/ChapterFour/0400~0499/0454.4Sum-II.md" >}})|Medium||||57.0%| -|0455|Assign Cookies|[Go]({{< relref "/ChapterFour/0400~0499/0455.Assign-Cookies.md" >}})|Easy||||50.7%| -|0456|132 Pattern|[Go]({{< relref "/ChapterFour/0400~0499/0456.132-Pattern.md" >}})|Medium||||30.9%| -|0457|Circular Array Loop|[Go]({{< relref "/ChapterFour/0400~0499/0457.Circular-Array-Loop.md" >}})|Medium||||31.7%| -|0462|Minimum Moves to Equal Array Elements II|[Go]({{< relref "/ChapterFour/0400~0499/0462.Minimum-Moves-to-Equal-Array-Elements-II.md" >}})|Medium||||57.0%| -|0463|Island Perimeter|[Go]({{< relref "/ChapterFour/0400~0499/0463.Island-Perimeter.md" >}})|Easy||||69.0%| -|0473|Matchsticks to Square|[Go]({{< relref "/ChapterFour/0400~0499/0473.Matchsticks-to-Square.md" >}})|Medium||||40.3%| -|0474|Ones and Zeroes|[Go]({{< relref "/ChapterFour/0400~0499/0474.Ones-and-Zeroes.md" >}})|Medium||||44.6%| -|0475|Heaters|[Go]({{< relref "/ChapterFour/0400~0499/0475.Heaters.md" >}})|Medium||||35.3%| -|0477|Total Hamming Distance|[Go]({{< relref "/ChapterFour/0400~0499/0477.Total-Hamming-Distance.md" >}})|Medium||||52.0%| -|0480|Sliding Window Median|[Go]({{< relref "/ChapterFour/0400~0499/0480.Sliding-Window-Median.md" >}})|Hard||||40.9%| -|0485|Max Consecutive Ones|[Go]({{< relref "/ChapterFour/0400~0499/0485.Max-Consecutive-Ones.md" >}})|Easy||||55.1%| -|0491|Increasing Subsequences|[Go]({{< relref "/ChapterFour/0400~0499/0491.Increasing-Subsequences.md" >}})|Medium||||50.9%| -|0493|Reverse Pairs|[Go]({{< relref "/ChapterFour/0400~0499/0493.Reverse-Pairs.md" >}})|Hard||||29.9%| -|0494|Target Sum|[Go]({{< relref "/ChapterFour/0400~0499/0494.Target-Sum.md" >}})|Medium||||45.4%| -|0495|Teemo Attacking|[Go]({{< relref "/ChapterFour/0400~0499/0495.Teemo-Attacking.md" >}})|Easy||||56.9%| -|0496|Next Greater Element I|[Go]({{< relref "/ChapterFour/0400~0499/0496.Next-Greater-Element-I.md" >}})|Easy||||70.1%| -|0498|Diagonal Traverse|[Go]({{< relref "/ChapterFour/0400~0499/0498.Diagonal-Traverse.md" >}})|Medium||||56.8%| -|0500|Keyboard Row|[Go]({{< relref "/ChapterFour/0500~0599/0500.Keyboard-Row.md" >}})|Easy||||68.0%| -|0503|Next Greater Element II|[Go]({{< relref "/ChapterFour/0500~0599/0503.Next-Greater-Element-II.md" >}})|Medium||||62.1%| -|0506|Relative Ranks|[Go]({{< relref "/ChapterFour/0500~0599/0506.Relative-Ranks.md" >}})|Easy||||56.8%| -|0518|Coin Change 2|[Go]({{< relref "/ChapterFour/0500~0599/0518.Coin-Change-2.md" >}})|Medium||||57.5%| -|0523|Continuous Subarray Sum|[Go]({{< relref "/ChapterFour/0500~0599/0523.Continuous-Subarray-Sum.md" >}})|Medium||||27.3%| -|0524|Longest Word in Dictionary through Deleting|[Go]({{< relref "/ChapterFour/0500~0599/0524.Longest-Word-in-Dictionary-through-Deleting.md" >}})|Medium||||50.9%| -|0525|Contiguous Array|[Go]({{< relref "/ChapterFour/0500~0599/0525.Contiguous-Array.md" >}})|Medium||||46.3%| -|0526|Beautiful Arrangement|[Go]({{< relref "/ChapterFour/0500~0599/0526.Beautiful-Arrangement.md" >}})|Medium||||64.3%| -|0529|Minesweeper|[Go]({{< relref "/ChapterFour/0500~0599/0529.Minesweeper.md" >}})|Medium||||64.7%| -|0532|K-diff Pairs in an Array|[Go]({{< relref "/ChapterFour/0500~0599/0532.K-diff-Pairs-in-an-Array.md" >}})|Medium| O(n)| O(n)||40.1%| -|0540|Single Element in a Sorted Array|[Go]({{< relref "/ChapterFour/0500~0599/0540.Single-Element-in-a-Sorted-Array.md" >}})|Medium||||58.7%| -|0542|01 Matrix|[Go]({{< relref "/ChapterFour/0500~0599/0542.01-Matrix.md" >}})|Medium||||43.8%| -|0554|Brick Wall|[Go]({{< relref "/ChapterFour/0500~0599/0554.Brick-Wall.md" >}})|Medium||||52.6%| -|0560|Subarray Sum Equals K|[Go]({{< relref "/ChapterFour/0500~0599/0560.Subarray-Sum-Equals-K.md" >}})|Medium||||44.2%| -|0561|Array Partition I|[Go]({{< relref "/ChapterFour/0500~0599/0561.Array-Partition-I.md" >}})|Easy||||75.7%| -|0566|Reshape the Matrix|[Go]({{< relref "/ChapterFour/0500~0599/0566.Reshape-the-Matrix.md" >}})|Easy| O(n^2)| O(n^2)||62.4%| -|0575|Distribute Candies|[Go]({{< relref "/ChapterFour/0500~0599/0575.Distribute-Candies.md" >}})|Easy||||65.7%| -|0581|Shortest Unsorted Continuous Subarray|[Go]({{< relref "/ChapterFour/0500~0599/0581.Shortest-Unsorted-Continuous-Subarray.md" >}})|Medium||||35.9%| -|0594|Longest Harmonious Subsequence|[Go]({{< relref "/ChapterFour/0500~0599/0594.Longest-Harmonious-Subsequence.md" >}})|Easy||||52.7%| -|0598|Range Addition II|[Go]({{< relref "/ChapterFour/0500~0599/0598.Range-Addition-II.md" >}})|Easy||||54.7%| -|0599|Minimum Index Sum of Two Lists|[Go]({{< relref "/ChapterFour/0500~0599/0599.Minimum-Index-Sum-of-Two-Lists.md" >}})|Easy||||52.8%| -|0605|Can Place Flowers|[Go]({{< relref "/ChapterFour/0600~0699/0605.Can-Place-Flowers.md" >}})|Easy||||33.1%| -|0609|Find Duplicate File in System|[Go]({{< relref "/ChapterFour/0600~0699/0609.Find-Duplicate-File-in-System.md" >}})|Medium||||63.8%| -|0611|Valid Triangle Number|[Go]({{< relref "/ChapterFour/0600~0699/0611.Valid-Triangle-Number.md" >}})|Medium||||49.8%| -|0622|Design Circular Queue|[Go]({{< relref "/ChapterFour/0600~0699/0622.Design-Circular-Queue.md" >}})|Medium||||48.7%| -|0628|Maximum Product of Three Numbers|[Go]({{< relref "/ChapterFour/0600~0699/0628.Maximum-Product-of-Three-Numbers.md" >}})|Easy| O(n)| O(1)||46.7%| -|0630|Course Schedule III|[Go]({{< relref "/ChapterFour/0600~0699/0630.Course-Schedule-III.md" >}})|Hard||||35.7%| -|0632|Smallest Range Covering Elements from K Lists|[Go]({{< relref "/ChapterFour/0600~0699/0632.Smallest-Range-Covering-Elements-from-K-Lists.md" >}})|Hard||||58.6%| -|0636|Exclusive Time of Functions|[Go]({{< relref "/ChapterFour/0600~0699/0636.Exclusive-Time-of-Functions.md" >}})|Medium||||60.3%| -|0638|Shopping Offers|[Go]({{< relref "/ChapterFour/0600~0699/0638.Shopping-Offers.md" >}})|Medium||||54.6%| -|0643|Maximum Average Subarray I|[Go]({{< relref "/ChapterFour/0600~0699/0643.Maximum-Average-Subarray-I.md" >}})|Easy||||43.5%| -|0645|Set Mismatch|[Go]({{< relref "/ChapterFour/0600~0699/0645.Set-Mismatch.md" >}})|Easy||||41.3%| -|0648|Replace Words|[Go]({{< relref "/ChapterFour/0600~0699/0648.Replace-Words.md" >}})|Medium||||62.0%| -|0658|Find K Closest Elements|[Go]({{< relref "/ChapterFour/0600~0699/0658.Find-K-Closest-Elements.md" >}})|Medium||||44.5%| -|0661|Image Smoother|[Go]({{< relref "/ChapterFour/0600~0699/0661.Image-Smoother.md" >}})|Easy||||54.3%| -|0665|Non-decreasing Array|[Go]({{< relref "/ChapterFour/0600~0699/0665.Non-decreasing-Array.md" >}})|Medium||||21.5%| -|0667|Beautiful Arrangement II|[Go]({{< relref "/ChapterFour/0600~0699/0667.Beautiful-Arrangement-II.md" >}})|Medium||||59.4%| -|0674|Longest Continuous Increasing Subsequence|[Go]({{< relref "/ChapterFour/0600~0699/0674.Longest-Continuous-Increasing-Subsequence.md" >}})|Easy||||48.4%| -|0682|Baseball Game|[Go]({{< relref "/ChapterFour/0600~0699/0682.Baseball-Game.md" >}})|Easy||||73.1%| -|0695|Max Area of Island|[Go]({{< relref "/ChapterFour/0600~0699/0695.Max-Area-of-Island.md" >}})|Medium||||69.7%| -|0697|Degree of an Array|[Go]({{< relref "/ChapterFour/0600~0699/0697.Degree-of-an-Array.md" >}})|Easy||||55.6%| -|0699|Falling Squares|[Go]({{< relref "/ChapterFour/0600~0699/0699.Falling-Squares.md" >}})|Hard||||43.8%| -|0704|Binary Search|[Go]({{< relref "/ChapterFour/0700~0799/0704.Binary-Search.md" >}})|Easy||||55.3%| -|0705|Design HashSet|[Go]({{< relref "/ChapterFour/0700~0799/0705.Design-HashSet.md" >}})|Easy||||66.5%| -|0706|Design HashMap|[Go]({{< relref "/ChapterFour/0700~0799/0706.Design-HashMap.md" >}})|Easy||||65.3%| -|0713|Subarray Product Less Than K|[Go]({{< relref "/ChapterFour/0700~0799/0713.Subarray-Product-Less-Than-K.md" >}})|Medium| O(n)| O(1)||43.8%| -|0714|Best Time to Buy and Sell Stock with Transaction Fee|[Go]({{< relref "/ChapterFour/0700~0799/0714.Best-Time-to-Buy-and-Sell-Stock-with-Transaction-Fee.md" >}})|Medium| O(n)| O(1)||62.2%| -|0717|1-bit and 2-bit Characters|[Go]({{< relref "/ChapterFour/0700~0799/0717.1-bit-and-2-bit-Characters.md" >}})|Easy||||46.2%| -|0718|Maximum Length of Repeated Subarray|[Go]({{< relref "/ChapterFour/0700~0799/0718.Maximum-Length-of-Repeated-Subarray.md" >}})|Medium||||51.4%| -|0719|Find K-th Smallest Pair Distance|[Go]({{< relref "/ChapterFour/0700~0799/0719.Find-K-th-Smallest-Pair-Distance.md" >}})|Hard||||35.1%| -|0720|Longest Word in Dictionary|[Go]({{< relref "/ChapterFour/0700~0799/0720.Longest-Word-in-Dictionary.md" >}})|Medium||||51.0%| -|0721|Accounts Merge|[Go]({{< relref "/ChapterFour/0700~0799/0721.Accounts-Merge.md" >}})|Medium||||55.9%| -|0724|Find Pivot Index|[Go]({{< relref "/ChapterFour/0700~0799/0724.Find-Pivot-Index.md" >}})|Easy||||51.6%| -|0733|Flood Fill|[Go]({{< relref "/ChapterFour/0700~0799/0733.Flood-Fill.md" >}})|Easy||||58.2%| +|0164|Maximum Gap|[Go]({{< relref "/ChapterFour/0100~0199/0164.Maximum-Gap.md" >}})|Hard||||43.4%| +|0167|Two Sum II - Input Array Is Sorted|[Go]({{< relref "/ChapterFour/0100~0199/0167.Two-Sum-II-Input-Array-Is-Sorted.md" >}})|Medium| O(n)| O(1)||60.0%| +|0169|Majority Element|[Go]({{< relref "/ChapterFour/0100~0199/0169.Majority-Element.md" >}})|Easy||||63.9%| +|0174|Dungeon Game|[Go]({{< relref "/ChapterFour/0100~0199/0174.Dungeon-Game.md" >}})|Hard||||37.5%| +|0179|Largest Number|[Go]({{< relref "/ChapterFour/0100~0199/0179.Largest-Number.md" >}})|Medium||||34.6%| +|0189|Rotate Array|[Go]({{< relref "/ChapterFour/0100~0199/0189.Rotate-Array.md" >}})|Medium||||39.4%| +|0198|House Robber|[Go]({{< relref "/ChapterFour/0100~0199/0198.House-Robber.md" >}})|Medium||||49.4%| +|0200|Number of Islands|[Go]({{< relref "/ChapterFour/0200~0299/0200.Number-of-Islands.md" >}})|Medium||||57.0%| +|0204|Count Primes|[Go]({{< relref "/ChapterFour/0200~0299/0204.Count-Primes.md" >}})|Medium||||33.1%| +|0209|Minimum Size Subarray Sum|[Go]({{< relref "/ChapterFour/0200~0299/0209.Minimum-Size-Subarray-Sum.md" >}})|Medium| O(n)| O(1)||45.0%| +|0212|Word Search II|[Go]({{< relref "/ChapterFour/0200~0299/0212.Word-Search-II.md" >}})|Hard||||36.4%| +|0213|House Robber II|[Go]({{< relref "/ChapterFour/0200~0299/0213.House-Robber-II.md" >}})|Medium||||41.0%| +|0215|Kth Largest Element in an Array|[Go]({{< relref "/ChapterFour/0200~0299/0215.Kth-Largest-Element-in-an-Array.md" >}})|Medium||||66.2%| +|0216|Combination Sum III|[Go]({{< relref "/ChapterFour/0200~0299/0216.Combination-Sum-III.md" >}})|Medium| O(n)| O(1)|❤️|67.6%| +|0217|Contains Duplicate|[Go]({{< relref "/ChapterFour/0200~0299/0217.Contains-Duplicate.md" >}})|Easy| O(n)| O(n)||61.4%| +|0218|The Skyline Problem|[Go]({{< relref "/ChapterFour/0200~0299/0218.The-Skyline-Problem.md" >}})|Hard||||41.9%| +|0219|Contains Duplicate II|[Go]({{< relref "/ChapterFour/0200~0299/0219.Contains-Duplicate-II.md" >}})|Easy| O(n)| O(n)||42.6%| +|0220|Contains Duplicate III|[Go]({{< relref "/ChapterFour/0200~0299/0220.Contains-Duplicate-III.md" >}})|Hard||||22.1%| +|0228|Summary Ranges|[Go]({{< relref "/ChapterFour/0200~0299/0228.Summary-Ranges.md" >}})|Easy||||47.2%| +|0229|Majority Element II|[Go]({{< relref "/ChapterFour/0200~0299/0229.Majority-Element-II.md" >}})|Medium||||45.1%| +|0239|Sliding Window Maximum|[Go]({{< relref "/ChapterFour/0200~0299/0239.Sliding-Window-Maximum.md" >}})|Hard||||46.3%| +|0240|Search a 2D Matrix II|[Go]({{< relref "/ChapterFour/0200~0299/0240.Search-a-2D-Matrix-II.md" >}})|Medium||||51.0%| +|0260|Single Number III|[Go]({{< relref "/ChapterFour/0200~0299/0260.Single-Number-III.md" >}})|Medium||||67.7%| +|0268|Missing Number|[Go]({{< relref "/ChapterFour/0200~0299/0268.Missing-Number.md" >}})|Easy||||62.6%| +|0274|H-Index|[Go]({{< relref "/ChapterFour/0200~0299/0274.H-Index.md" >}})|Medium||||38.3%| +|0275|H-Index II|[Go]({{< relref "/ChapterFour/0200~0299/0275.H-Index-II.md" >}})|Medium||||37.5%| +|0283|Move Zeroes|[Go]({{< relref "/ChapterFour/0200~0299/0283.Move-Zeroes.md" >}})|Easy| O(n)| O(1)||61.4%| +|0284|Peeking Iterator|[Go]({{< relref "/ChapterFour/0200~0299/0284.Peeking-Iterator.md" >}})|Medium||||58.7%| +|0287|Find the Duplicate Number|[Go]({{< relref "/ChapterFour/0200~0299/0287.Find-the-Duplicate-Number.md" >}})|Medium| O(n)| O(1)|❤️|59.1%| +|0300|Longest Increasing Subsequence|[Go]({{< relref "/ChapterFour/0300~0399/0300.Longest-Increasing-Subsequence.md" >}})|Medium||||52.2%| +|0303|Range Sum Query - Immutable|[Go]({{< relref "/ChapterFour/0300~0399/0303.Range-Sum-Query-Immutable.md" >}})|Easy||||59.5%| +|0304|Range Sum Query 2D - Immutable|[Go]({{< relref "/ChapterFour/0300~0399/0304.Range-Sum-Query-2D-Immutable.md" >}})|Medium||||52.9%| +|0307|Range Sum Query - Mutable|[Go]({{< relref "/ChapterFour/0300~0399/0307.Range-Sum-Query-Mutable.md" >}})|Medium||||40.7%| +|0309|Best Time to Buy and Sell Stock with Cooldown|[Go]({{< relref "/ChapterFour/0300~0399/0309.Best-Time-to-Buy-and-Sell-Stock-with-Cooldown.md" >}})|Medium||||56.2%| +|0315|Count of Smaller Numbers After Self|[Go]({{< relref "/ChapterFour/0300~0399/0315.Count-of-Smaller-Numbers-After-Self.md" >}})|Hard||||42.6%| +|0318|Maximum Product of Word Lengths|[Go]({{< relref "/ChapterFour/0300~0399/0318.Maximum-Product-of-Word-Lengths.md" >}})|Medium||||59.9%| +|0322|Coin Change|[Go]({{< relref "/ChapterFour/0300~0399/0322.Coin-Change.md" >}})|Medium||||42.1%| +|0324|Wiggle Sort II|[Go]({{< relref "/ChapterFour/0300~0399/0324.Wiggle-Sort-II.md" >}})|Medium||||33.3%| +|0327|Count of Range Sum|[Go]({{< relref "/ChapterFour/0300~0399/0327.Count-of-Range-Sum.md" >}})|Hard||||35.8%| +|0329|Longest Increasing Path in a Matrix|[Go]({{< relref "/ChapterFour/0300~0399/0329.Longest-Increasing-Path-in-a-Matrix.md" >}})|Hard||||52.4%| +|0347|Top K Frequent Elements|[Go]({{< relref "/ChapterFour/0300~0399/0347.Top-K-Frequent-Elements.md" >}})|Medium||||64.2%| +|0349|Intersection of Two Arrays|[Go]({{< relref "/ChapterFour/0300~0399/0349.Intersection-of-Two-Arrays.md" >}})|Easy||||70.9%| +|0350|Intersection of Two Arrays II|[Go]({{< relref "/ChapterFour/0300~0399/0350.Intersection-of-Two-Arrays-II.md" >}})|Easy||||56.0%| +|0354|Russian Doll Envelopes|[Go]({{< relref "/ChapterFour/0300~0399/0354.Russian-Doll-Envelopes.md" >}})|Hard||||37.9%| +|0368|Largest Divisible Subset|[Go]({{< relref "/ChapterFour/0300~0399/0368.Largest-Divisible-Subset.md" >}})|Medium||||41.6%| +|0373|Find K Pairs with Smallest Sums|[Go]({{< relref "/ChapterFour/0300~0399/0373.Find-K-Pairs-with-Smallest-Sums.md" >}})|Medium||||38.3%| +|0376|Wiggle Subsequence|[Go]({{< relref "/ChapterFour/0300~0399/0376.Wiggle-Subsequence.md" >}})|Medium||||48.3%| +|0377|Combination Sum IV|[Go]({{< relref "/ChapterFour/0300~0399/0377.Combination-Sum-IV.md" >}})|Medium||||52.2%| +|0378|Kth Smallest Element in a Sorted Matrix|[Go]({{< relref "/ChapterFour/0300~0399/0378.Kth-Smallest-Element-in-a-Sorted-Matrix.md" >}})|Medium||||61.8%| +|0384|Shuffle an Array|[Go]({{< relref "/ChapterFour/0300~0399/0384.Shuffle-an-Array.md" >}})|Medium||||57.8%| +|0391|Perfect Rectangle|[Go]({{< relref "/ChapterFour/0300~0399/0391.Perfect-Rectangle.md" >}})|Hard||||32.8%| +|0393|UTF-8 Validation|[Go]({{< relref "/ChapterFour/0300~0399/0393.UTF-8-Validation.md" >}})|Medium||||45.1%| +|0396|Rotate Function|[Go]({{< relref "/ChapterFour/0300~0399/0396.Rotate-Function.md" >}})|Medium||||41.1%| +|0399|Evaluate Division|[Go]({{< relref "/ChapterFour/0300~0399/0399.Evaluate-Division.md" >}})|Medium||||59.7%| +|0410|Split Array Largest Sum|[Go]({{< relref "/ChapterFour/0400~0499/0410.Split-Array-Largest-Sum.md" >}})|Hard||||53.5%| +|0413|Arithmetic Slices|[Go]({{< relref "/ChapterFour/0400~0499/0413.Arithmetic-Slices.md" >}})|Medium||||65.1%| +|0414|Third Maximum Number|[Go]({{< relref "/ChapterFour/0400~0499/0414.Third-Maximum-Number.md" >}})|Easy||||33.2%| +|0416|Partition Equal Subset Sum|[Go]({{< relref "/ChapterFour/0400~0499/0416.Partition-Equal-Subset-Sum.md" >}})|Medium||||46.3%| +|0417|Pacific Atlantic Water Flow|[Go]({{< relref "/ChapterFour/0400~0499/0417.Pacific-Atlantic-Water-Flow.md" >}})|Medium||||54.4%| +|0419|Battleships in a Board|[Go]({{< relref "/ChapterFour/0400~0499/0419.Battleships-in-a-Board.md" >}})|Medium||||74.8%| +|0421|Maximum XOR of Two Numbers in an Array|[Go]({{< relref "/ChapterFour/0400~0499/0421.Maximum-XOR-of-Two-Numbers-in-an-Array.md" >}})|Medium||||54.0%| +|0435|Non-overlapping Intervals|[Go]({{< relref "/ChapterFour/0400~0499/0435.Non-overlapping-Intervals.md" >}})|Medium||||50.3%| +|0436|Find Right Interval|[Go]({{< relref "/ChapterFour/0400~0499/0436.Find-Right-Interval.md" >}})|Medium||||50.8%| +|0447|Number of Boomerangs|[Go]({{< relref "/ChapterFour/0400~0499/0447.Number-of-Boomerangs.md" >}})|Medium||||54.9%| +|0448|Find All Numbers Disappeared in an Array|[Go]({{< relref "/ChapterFour/0400~0499/0448.Find-All-Numbers-Disappeared-in-an-Array.md" >}})|Easy||||59.9%| +|0453|Minimum Moves to Equal Array Elements|[Go]({{< relref "/ChapterFour/0400~0499/0453.Minimum-Moves-to-Equal-Array-Elements.md" >}})|Medium||||56.0%| +|0454|4Sum II|[Go]({{< relref "/ChapterFour/0400~0499/0454.4Sum-II.md" >}})|Medium||||57.2%| +|0455|Assign Cookies|[Go]({{< relref "/ChapterFour/0400~0499/0455.Assign-Cookies.md" >}})|Easy||||49.9%| +|0456|132 Pattern|[Go]({{< relref "/ChapterFour/0400~0499/0456.132-Pattern.md" >}})|Medium||||32.4%| +|0457|Circular Array Loop|[Go]({{< relref "/ChapterFour/0400~0499/0457.Circular-Array-Loop.md" >}})|Medium||||32.6%| +|0462|Minimum Moves to Equal Array Elements II|[Go]({{< relref "/ChapterFour/0400~0499/0462.Minimum-Moves-to-Equal-Array-Elements-II.md" >}})|Medium||||60.0%| +|0463|Island Perimeter|[Go]({{< relref "/ChapterFour/0400~0499/0463.Island-Perimeter.md" >}})|Easy||||69.7%| +|0473|Matchsticks to Square|[Go]({{< relref "/ChapterFour/0400~0499/0473.Matchsticks-to-Square.md" >}})|Medium||||40.2%| +|0474|Ones and Zeroes|[Go]({{< relref "/ChapterFour/0400~0499/0474.Ones-and-Zeroes.md" >}})|Medium||||46.8%| +|0475|Heaters|[Go]({{< relref "/ChapterFour/0400~0499/0475.Heaters.md" >}})|Medium||||36.5%| +|0477|Total Hamming Distance|[Go]({{< relref "/ChapterFour/0400~0499/0477.Total-Hamming-Distance.md" >}})|Medium||||52.2%| +|0480|Sliding Window Median|[Go]({{< relref "/ChapterFour/0400~0499/0480.Sliding-Window-Median.md" >}})|Hard||||41.1%| +|0485|Max Consecutive Ones|[Go]({{< relref "/ChapterFour/0400~0499/0485.Max-Consecutive-Ones.md" >}})|Easy||||56.6%| +|0491|Non-decreasing Subsequences|[Go]({{< relref "/ChapterFour/0400~0499/0491.Non-decreasing-Subsequences.md" >}})|Medium||||60.2%| +|0493|Reverse Pairs|[Go]({{< relref "/ChapterFour/0400~0499/0493.Reverse-Pairs.md" >}})|Hard||||30.9%| +|0494|Target Sum|[Go]({{< relref "/ChapterFour/0400~0499/0494.Target-Sum.md" >}})|Medium||||45.7%| +|0495|Teemo Attacking|[Go]({{< relref "/ChapterFour/0400~0499/0495.Teemo-Attacking.md" >}})|Easy||||56.8%| +|0496|Next Greater Element I|[Go]({{< relref "/ChapterFour/0400~0499/0496.Next-Greater-Element-I.md" >}})|Easy||||71.4%| +|0497|Random Point in Non-overlapping Rectangles|[Go]({{< relref "/ChapterFour/0400~0499/0497.Random-Point-in-Non-overlapping-Rectangles.md" >}})|Medium||||39.4%| +|0498|Diagonal Traverse|[Go]({{< relref "/ChapterFour/0400~0499/0498.Diagonal-Traverse.md" >}})|Medium||||58.3%| +|0500|Keyboard Row|[Go]({{< relref "/ChapterFour/0500~0599/0500.Keyboard-Row.md" >}})|Easy||||69.6%| +|0503|Next Greater Element II|[Go]({{< relref "/ChapterFour/0500~0599/0503.Next-Greater-Element-II.md" >}})|Medium||||63.2%| +|0506|Relative Ranks|[Go]({{< relref "/ChapterFour/0500~0599/0506.Relative-Ranks.md" >}})|Easy||||60.6%| +|0518|Coin Change II|[Go]({{< relref "/ChapterFour/0500~0599/0518.Coin-Change-II.md" >}})|Medium||||60.6%| +|0523|Continuous Subarray Sum|[Go]({{< relref "/ChapterFour/0500~0599/0523.Continuous-Subarray-Sum.md" >}})|Medium||||28.5%| +|0524|Longest Word in Dictionary through Deleting|[Go]({{< relref "/ChapterFour/0500~0599/0524.Longest-Word-in-Dictionary-through-Deleting.md" >}})|Medium||||51.0%| +|0525|Contiguous Array|[Go]({{< relref "/ChapterFour/0500~0599/0525.Contiguous-Array.md" >}})|Medium||||46.8%| +|0526|Beautiful Arrangement|[Go]({{< relref "/ChapterFour/0500~0599/0526.Beautiful-Arrangement.md" >}})|Medium||||64.4%| +|0528|Random Pick with Weight|[Go]({{< relref "/ChapterFour/0500~0599/0528.Random-Pick-with-Weight.md" >}})|Medium||||46.1%| +|0529|Minesweeper|[Go]({{< relref "/ChapterFour/0500~0599/0529.Minesweeper.md" >}})|Medium||||65.7%| +|0532|K-diff Pairs in an Array|[Go]({{< relref "/ChapterFour/0500~0599/0532.K-diff-Pairs-in-an-Array.md" >}})|Medium| O(n)| O(n)||41.2%| +|0540|Single Element in a Sorted Array|[Go]({{< relref "/ChapterFour/0500~0599/0540.Single-Element-in-a-Sorted-Array.md" >}})|Medium||||59.1%| +|0542|01 Matrix|[Go]({{< relref "/ChapterFour/0500~0599/0542.01-Matrix.md" >}})|Medium||||44.8%| +|0554|Brick Wall|[Go]({{< relref "/ChapterFour/0500~0599/0554.Brick-Wall.md" >}})|Medium||||53.6%| +|0560|Subarray Sum Equals K|[Go]({{< relref "/ChapterFour/0500~0599/0560.Subarray-Sum-Equals-K.md" >}})|Medium||||43.7%| +|0561|Array Partition|[Go]({{< relref "/ChapterFour/0500~0599/0561.Array-Partition.md" >}})|Easy||||77.2%| +|0566|Reshape the Matrix|[Go]({{< relref "/ChapterFour/0500~0599/0566.Reshape-the-Matrix.md" >}})|Easy| O(n^2)| O(n^2)||62.9%| +|0575|Distribute Candies|[Go]({{< relref "/ChapterFour/0500~0599/0575.Distribute-Candies.md" >}})|Easy||||66.5%| +|0581|Shortest Unsorted Continuous Subarray|[Go]({{< relref "/ChapterFour/0500~0599/0581.Shortest-Unsorted-Continuous-Subarray.md" >}})|Medium||||36.4%| +|0594|Longest Harmonious Subsequence|[Go]({{< relref "/ChapterFour/0500~0599/0594.Longest-Harmonious-Subsequence.md" >}})|Easy||||53.5%| +|0598|Range Addition II|[Go]({{< relref "/ChapterFour/0500~0599/0598.Range-Addition-II.md" >}})|Easy||||55.3%| +|0599|Minimum Index Sum of Two Lists|[Go]({{< relref "/ChapterFour/0500~0599/0599.Minimum-Index-Sum-of-Two-Lists.md" >}})|Easy||||53.4%| +|0605|Can Place Flowers|[Go]({{< relref "/ChapterFour/0600~0699/0605.Can-Place-Flowers.md" >}})|Easy||||32.8%| +|0609|Find Duplicate File in System|[Go]({{< relref "/ChapterFour/0600~0699/0609.Find-Duplicate-File-in-System.md" >}})|Medium||||67.7%| +|0611|Valid Triangle Number|[Go]({{< relref "/ChapterFour/0600~0699/0611.Valid-Triangle-Number.md" >}})|Medium||||50.6%| +|0622|Design Circular Queue|[Go]({{< relref "/ChapterFour/0600~0699/0622.Design-Circular-Queue.md" >}})|Medium||||51.5%| +|0628|Maximum Product of Three Numbers|[Go]({{< relref "/ChapterFour/0600~0699/0628.Maximum-Product-of-Three-Numbers.md" >}})|Easy| O(n)| O(1)||45.9%| +|0630|Course Schedule III|[Go]({{< relref "/ChapterFour/0600~0699/0630.Course-Schedule-III.md" >}})|Hard||||40.1%| +|0632|Smallest Range Covering Elements from K Lists|[Go]({{< relref "/ChapterFour/0600~0699/0632.Smallest-Range-Covering-Elements-from-K-Lists.md" >}})|Hard||||61.0%| +|0636|Exclusive Time of Functions|[Go]({{< relref "/ChapterFour/0600~0699/0636.Exclusive-Time-of-Functions.md" >}})|Medium||||61.2%| +|0638|Shopping Offers|[Go]({{< relref "/ChapterFour/0600~0699/0638.Shopping-Offers.md" >}})|Medium||||53.3%| +|0643|Maximum Average Subarray I|[Go]({{< relref "/ChapterFour/0600~0699/0643.Maximum-Average-Subarray-I.md" >}})|Easy||||43.7%| +|0645|Set Mismatch|[Go]({{< relref "/ChapterFour/0600~0699/0645.Set-Mismatch.md" >}})|Easy||||42.7%| +|0648|Replace Words|[Go]({{< relref "/ChapterFour/0600~0699/0648.Replace-Words.md" >}})|Medium||||62.7%| +|0658|Find K Closest Elements|[Go]({{< relref "/ChapterFour/0600~0699/0658.Find-K-Closest-Elements.md" >}})|Medium||||46.8%| +|0661|Image Smoother|[Go]({{< relref "/ChapterFour/0600~0699/0661.Image-Smoother.md" >}})|Easy||||55.4%| +|0665|Non-decreasing Array|[Go]({{< relref "/ChapterFour/0600~0699/0665.Non-decreasing-Array.md" >}})|Medium||||24.3%| +|0667|Beautiful Arrangement II|[Go]({{< relref "/ChapterFour/0600~0699/0667.Beautiful-Arrangement-II.md" >}})|Medium||||59.8%| +|0674|Longest Continuous Increasing Subsequence|[Go]({{< relref "/ChapterFour/0600~0699/0674.Longest-Continuous-Increasing-Subsequence.md" >}})|Easy||||49.3%| +|0682|Baseball Game|[Go]({{< relref "/ChapterFour/0600~0699/0682.Baseball-Game.md" >}})|Easy||||74.3%| +|0695|Max Area of Island|[Go]({{< relref "/ChapterFour/0600~0699/0695.Max-Area-of-Island.md" >}})|Medium||||71.8%| +|0697|Degree of an Array|[Go]({{< relref "/ChapterFour/0600~0699/0697.Degree-of-an-Array.md" >}})|Easy||||56.0%| +|0699|Falling Squares|[Go]({{< relref "/ChapterFour/0600~0699/0699.Falling-Squares.md" >}})|Hard||||44.7%| +|0704|Binary Search|[Go]({{< relref "/ChapterFour/0700~0799/0704.Binary-Search.md" >}})|Easy||||56.1%| +|0705|Design HashSet|[Go]({{< relref "/ChapterFour/0700~0799/0705.Design-HashSet.md" >}})|Easy||||65.6%| +|0706|Design HashMap|[Go]({{< relref "/ChapterFour/0700~0799/0706.Design-HashMap.md" >}})|Easy||||64.7%| +|0710|Random Pick with Blacklist|[Go]({{< relref "/ChapterFour/0700~0799/0710.Random-Pick-with-Blacklist.md" >}})|Hard||||33.5%| +|0713|Subarray Product Less Than K|[Go]({{< relref "/ChapterFour/0700~0799/0713.Subarray-Product-Less-Than-K.md" >}})|Medium| O(n)| O(1)||45.8%| +|0714|Best Time to Buy and Sell Stock with Transaction Fee|[Go]({{< relref "/ChapterFour/0700~0799/0714.Best-Time-to-Buy-and-Sell-Stock-with-Transaction-Fee.md" >}})|Medium| O(n)| O(1)||65.2%| +|0717|1-bit and 2-bit Characters|[Go]({{< relref "/ChapterFour/0700~0799/0717.1-bit-and-2-bit-Characters.md" >}})|Easy||||45.7%| +|0718|Maximum Length of Repeated Subarray|[Go]({{< relref "/ChapterFour/0700~0799/0718.Maximum-Length-of-Repeated-Subarray.md" >}})|Medium||||51.3%| +|0719|Find K-th Smallest Pair Distance|[Go]({{< relref "/ChapterFour/0700~0799/0719.Find-K-th-Smallest-Pair-Distance.md" >}})|Hard||||36.7%| +|0720|Longest Word in Dictionary|[Go]({{< relref "/ChapterFour/0700~0799/0720.Longest-Word-in-Dictionary.md" >}})|Medium||||52.0%| +|0721|Accounts Merge|[Go]({{< relref "/ChapterFour/0700~0799/0721.Accounts-Merge.md" >}})|Medium||||56.3%| +|0724|Find Pivot Index|[Go]({{< relref "/ChapterFour/0700~0799/0724.Find-Pivot-Index.md" >}})|Easy||||54.7%| +|0733|Flood Fill|[Go]({{< relref "/ChapterFour/0700~0799/0733.Flood-Fill.md" >}})|Easy||||62.0%| |0735|Asteroid Collision|[Go]({{< relref "/ChapterFour/0700~0799/0735.Asteroid-Collision.md" >}})|Medium||||44.4%| -|0739|Daily Temperatures|[Go]({{< relref "/ChapterFour/0700~0799/0739.Daily-Temperatures.md" >}})|Medium||||67.1%| -|0744|Find Smallest Letter Greater Than Target|[Go]({{< relref "/ChapterFour/0700~0799/0744.Find-Smallest-Letter-Greater-Than-Target.md" >}})|Easy||||45.1%| -|0746|Min Cost Climbing Stairs|[Go]({{< relref "/ChapterFour/0700~0799/0746.Min-Cost-Climbing-Stairs.md" >}})|Easy| O(n)| O(1)||58.8%| -|0747|Largest Number At Least Twice of Others|[Go]({{< relref "/ChapterFour/0700~0799/0747.Largest-Number-At-Least-Twice-of-Others.md" >}})|Easy||||45.3%| -|0748|Shortest Completing Word|[Go]({{< relref "/ChapterFour/0700~0799/0748.Shortest-Completing-Word.md" >}})|Easy||||58.9%| -|0752|Open the Lock|[Go]({{< relref "/ChapterFour/0700~0799/0752.Open-the-Lock.md" >}})|Medium||||55.3%| -|0766|Toeplitz Matrix|[Go]({{< relref "/ChapterFour/0700~0799/0766.Toeplitz-Matrix.md" >}})|Easy| O(n)| O(1)||68.0%| -|0775|Global and Local Inversions|[Go]({{< relref "/ChapterFour/0700~0799/0775.Global-and-Local-Inversions.md" >}})|Medium||||45.1%| -|0778|Swim in Rising Water|[Go]({{< relref "/ChapterFour/0700~0799/0778.Swim-in-Rising-Water.md" >}})|Hard||||58.7%| -|0781|Rabbits in Forest|[Go]({{< relref "/ChapterFour/0700~0799/0781.Rabbits-in-Forest.md" >}})|Medium||||55.7%| -|0786|K-th Smallest Prime Fraction|[Go]({{< relref "/ChapterFour/0700~0799/0786.K-th-Smallest-Prime-Fraction.md" >}})|Hard||||48.6%| -|0794|Valid Tic-Tac-Toe State|[Go]({{< relref "/ChapterFour/0700~0799/0794.Valid-Tic-Tac-Toe-State.md" >}})|Medium||||35.2%| -|0795|Number of Subarrays with Bounded Maximum|[Go]({{< relref "/ChapterFour/0700~0799/0795.Number-of-Subarrays-with-Bounded-Maximum.md" >}})|Medium||||52.4%| -|0803|Bricks Falling When Hit|[Go]({{< relref "/ChapterFour/0800~0899/0803.Bricks-Falling-When-Hit.md" >}})|Hard||||33.9%| -|0807|Max Increase to Keep City Skyline|[Go]({{< relref "/ChapterFour/0800~0899/0807.Max-Increase-to-Keep-City-Skyline.md" >}})|Medium||||85.5%| -|0810|Chalkboard XOR Game|[Go]({{< relref "/ChapterFour/0800~0899/0810.Chalkboard-XOR-Game.md" >}})|Hard||||53.4%| -|0811|Subdomain Visit Count|[Go]({{< relref "/ChapterFour/0800~0899/0811.Subdomain-Visit-Count.md" >}})|Medium||||74.2%| -|0812|Largest Triangle Area|[Go]({{< relref "/ChapterFour/0800~0899/0812.Largest-Triangle-Area.md" >}})|Easy||||59.6%| -|0815|Bus Routes|[Go]({{< relref "/ChapterFour/0800~0899/0815.Bus-Routes.md" >}})|Hard||||45.3%| -|0820|Short Encoding of Words|[Go]({{< relref "/ChapterFour/0800~0899/0820.Short-Encoding-of-Words.md" >}})|Medium||||55.3%| -|0821|Shortest Distance to a Character|[Go]({{< relref "/ChapterFour/0800~0899/0821.Shortest-Distance-to-a-Character.md" >}})|Easy||||71.0%| -|0823|Binary Trees With Factors|[Go]({{< relref "/ChapterFour/0800~0899/0823.Binary-Trees-With-Factors.md" >}})|Medium||||43.7%| -|0825|Friends Of Appropriate Ages|[Go]({{< relref "/ChapterFour/0800~0899/0825.Friends-Of-Appropriate-Ages.md" >}})|Medium||||46.0%| -|0826|Most Profit Assigning Work|[Go]({{< relref "/ChapterFour/0800~0899/0826.Most-Profit-Assigning-Work.md" >}})|Medium||||42.1%| -|0832|Flipping an Image|[Go]({{< relref "/ChapterFour/0800~0899/0832.Flipping-an-Image.md" >}})|Easy||||79.7%| -|0839|Similar String Groups|[Go]({{< relref "/ChapterFour/0800~0899/0839.Similar-String-Groups.md" >}})|Hard||||45.5%| -|0845|Longest Mountain in Array|[Go]({{< relref "/ChapterFour/0800~0899/0845.Longest-Mountain-in-Array.md" >}})|Medium||||39.8%| +|0739|Daily Temperatures|[Go]({{< relref "/ChapterFour/0700~0799/0739.Daily-Temperatures.md" >}})|Medium||||66.3%| +|0744|Find Smallest Letter Greater Than Target|[Go]({{< relref "/ChapterFour/0700~0799/0744.Find-Smallest-Letter-Greater-Than-Target.md" >}})|Easy||||45.8%| +|0746|Min Cost Climbing Stairs|[Go]({{< relref "/ChapterFour/0700~0799/0746.Min-Cost-Climbing-Stairs.md" >}})|Easy| O(n)| O(1)||63.2%| +|0747|Largest Number At Least Twice of Others|[Go]({{< relref "/ChapterFour/0700~0799/0747.Largest-Number-At-Least-Twice-of-Others.md" >}})|Easy||||47.1%| +|0748|Shortest Completing Word|[Go]({{< relref "/ChapterFour/0700~0799/0748.Shortest-Completing-Word.md" >}})|Easy||||59.3%| +|0752|Open the Lock|[Go]({{< relref "/ChapterFour/0700~0799/0752.Open-the-Lock.md" >}})|Medium||||55.6%| +|0766|Toeplitz Matrix|[Go]({{< relref "/ChapterFour/0700~0799/0766.Toeplitz-Matrix.md" >}})|Easy| O(n)| O(1)||68.6%| +|0775|Global and Local Inversions|[Go]({{< relref "/ChapterFour/0700~0799/0775.Global-and-Local-Inversions.md" >}})|Medium||||43.3%| +|0778|Swim in Rising Water|[Go]({{< relref "/ChapterFour/0700~0799/0778.Swim-in-Rising-Water.md" >}})|Hard||||59.8%| +|0781|Rabbits in Forest|[Go]({{< relref "/ChapterFour/0700~0799/0781.Rabbits-in-Forest.md" >}})|Medium||||54.7%| +|0786|K-th Smallest Prime Fraction|[Go]({{< relref "/ChapterFour/0700~0799/0786.K-th-Smallest-Prime-Fraction.md" >}})|Medium||||51.7%| +|0794|Valid Tic-Tac-Toe State|[Go]({{< relref "/ChapterFour/0700~0799/0794.Valid-Tic-Tac-Toe-State.md" >}})|Medium||||35.1%| +|0795|Number of Subarrays with Bounded Maximum|[Go]({{< relref "/ChapterFour/0700~0799/0795.Number-of-Subarrays-with-Bounded-Maximum.md" >}})|Medium||||52.8%| +|0803|Bricks Falling When Hit|[Go]({{< relref "/ChapterFour/0800~0899/0803.Bricks-Falling-When-Hit.md" >}})|Hard||||34.4%| +|0807|Max Increase to Keep City Skyline|[Go]({{< relref "/ChapterFour/0800~0899/0807.Max-Increase-to-Keep-City-Skyline.md" >}})|Medium||||85.9%| +|0810|Chalkboard XOR Game|[Go]({{< relref "/ChapterFour/0800~0899/0810.Chalkboard-XOR-Game.md" >}})|Hard||||55.8%| +|0811|Subdomain Visit Count|[Go]({{< relref "/ChapterFour/0800~0899/0811.Subdomain-Visit-Count.md" >}})|Medium||||75.5%| +|0812|Largest Triangle Area|[Go]({{< relref "/ChapterFour/0800~0899/0812.Largest-Triangle-Area.md" >}})|Easy||||59.9%| +|0815|Bus Routes|[Go]({{< relref "/ChapterFour/0800~0899/0815.Bus-Routes.md" >}})|Hard||||45.6%| +|0817|Linked List Components|[Go]({{< relref "/ChapterFour/0800~0899/0817.Linked-List-Components.md" >}})|Medium||||57.7%| +|0820|Short Encoding of Words|[Go]({{< relref "/ChapterFour/0800~0899/0820.Short-Encoding-of-Words.md" >}})|Medium||||60.6%| +|0821|Shortest Distance to a Character|[Go]({{< relref "/ChapterFour/0800~0899/0821.Shortest-Distance-to-a-Character.md" >}})|Easy||||71.3%| +|0823|Binary Trees With Factors|[Go]({{< relref "/ChapterFour/0800~0899/0823.Binary-Trees-With-Factors.md" >}})|Medium||||49.7%| +|0825|Friends Of Appropriate Ages|[Go]({{< relref "/ChapterFour/0800~0899/0825.Friends-Of-Appropriate-Ages.md" >}})|Medium||||46.3%| +|0826|Most Profit Assigning Work|[Go]({{< relref "/ChapterFour/0800~0899/0826.Most-Profit-Assigning-Work.md" >}})|Medium||||44.9%| +|0832|Flipping an Image|[Go]({{< relref "/ChapterFour/0800~0899/0832.Flipping-an-Image.md" >}})|Easy||||80.8%| +|0839|Similar String Groups|[Go]({{< relref "/ChapterFour/0800~0899/0839.Similar-String-Groups.md" >}})|Hard||||48.0%| +|0845|Longest Mountain in Array|[Go]({{< relref "/ChapterFour/0800~0899/0845.Longest-Mountain-in-Array.md" >}})|Medium||||40.2%| |0846|Hand of Straights|[Go]({{< relref "/ChapterFour/0800~0899/0846.Hand-of-Straights.md" >}})|Medium||||56.2%| -|0850|Rectangle Area II|[Go]({{< relref "/ChapterFour/0800~0899/0850.Rectangle-Area-II.md" >}})|Hard||||53.3%| -|0851|Loud and Rich|[Go]({{< relref "/ChapterFour/0800~0899/0851.Loud-and-Rich.md" >}})|Medium||||56.7%| -|0852|Peak Index in a Mountain Array|[Go]({{< relref "/ChapterFour/0800~0899/0852.Peak-Index-in-a-Mountain-Array.md" >}})|Easy||||70.4%| -|0853|Car Fleet|[Go]({{< relref "/ChapterFour/0800~0899/0853.Car-Fleet.md" >}})|Medium||||48.2%| -|0862|Shortest Subarray with Sum at Least K|[Go]({{< relref "/ChapterFour/0800~0899/0862.Shortest-Subarray-with-Sum-at-Least-K.md" >}})|Hard||||26.2%| -|0867|Transpose Matrix|[Go]({{< relref "/ChapterFour/0800~0899/0867.Transpose-Matrix.md" >}})|Easy| O(n)| O(1)||61.0%| -|0870|Advantage Shuffle|[Go]({{< relref "/ChapterFour/0800~0899/0870.Advantage-Shuffle.md" >}})|Medium||||51.3%| -|0874|Walking Robot Simulation|[Go]({{< relref "/ChapterFour/0800~0899/0874.Walking-Robot-Simulation.md" >}})|Medium||||37.8%| -|0875|Koko Eating Bananas|[Go]({{< relref "/ChapterFour/0800~0899/0875.Koko-Eating-Bananas.md" >}})|Medium||||54.6%| -|0877|Stone Game|[Go]({{< relref "/ChapterFour/0800~0899/0877.Stone-Game.md" >}})|Medium||||69.2%| -|0881|Boats to Save People|[Go]({{< relref "/ChapterFour/0800~0899/0881.Boats-to-Save-People.md" >}})|Medium||||52.5%| -|0885|Spiral Matrix III|[Go]({{< relref "/ChapterFour/0800~0899/0885.Spiral-Matrix-III.md" >}})|Medium||||72.5%| -|0888|Fair Candy Swap|[Go]({{< relref "/ChapterFour/0800~0899/0888.Fair-Candy-Swap.md" >}})|Easy||||60.4%| -|0890|Find and Replace Pattern|[Go]({{< relref "/ChapterFour/0800~0899/0890.Find-and-Replace-Pattern.md" >}})|Medium||||75.6%| -|0891|Sum of Subsequence Widths|[Go]({{< relref "/ChapterFour/0800~0899/0891.Sum-of-Subsequence-Widths.md" >}})|Hard| O(n log n)| O(1)||35.6%| -|0892|Surface Area of 3D Shapes|[Go]({{< relref "/ChapterFour/0800~0899/0892.Surface-Area-of-3D-Shapes.md" >}})|Easy||||61.9%| +|0850|Rectangle Area II|[Go]({{< relref "/ChapterFour/0800~0899/0850.Rectangle-Area-II.md" >}})|Hard||||53.9%| +|0851|Loud and Rich|[Go]({{< relref "/ChapterFour/0800~0899/0851.Loud-and-Rich.md" >}})|Medium||||58.4%| +|0852|Peak Index in a Mountain Array|[Go]({{< relref "/ChapterFour/0800~0899/0852.Peak-Index-in-a-Mountain-Array.md" >}})|Medium||||69.0%| +|0853|Car Fleet|[Go]({{< relref "/ChapterFour/0800~0899/0853.Car-Fleet.md" >}})|Medium||||50.3%| +|0862|Shortest Subarray with Sum at Least K|[Go]({{< relref "/ChapterFour/0800~0899/0862.Shortest-Subarray-with-Sum-at-Least-K.md" >}})|Hard||||26.0%| +|0864|Shortest Path to Get All Keys|[Go]({{< relref "/ChapterFour/0800~0899/0864.Shortest-Path-to-Get-All-Keys.md" >}})|Hard||||45.6%| +|0867|Transpose Matrix|[Go]({{< relref "/ChapterFour/0800~0899/0867.Transpose-Matrix.md" >}})|Easy| O(n)| O(1)||64.3%| +|0870|Advantage Shuffle|[Go]({{< relref "/ChapterFour/0800~0899/0870.Advantage-Shuffle.md" >}})|Medium||||51.9%| +|0874|Walking Robot Simulation|[Go]({{< relref "/ChapterFour/0800~0899/0874.Walking-Robot-Simulation.md" >}})|Medium||||39.0%| +|0875|Koko Eating Bananas|[Go]({{< relref "/ChapterFour/0800~0899/0875.Koko-Eating-Bananas.md" >}})|Medium||||52.1%| +|0877|Stone Game|[Go]({{< relref "/ChapterFour/0800~0899/0877.Stone-Game.md" >}})|Medium||||69.7%| +|0881|Boats to Save People|[Go]({{< relref "/ChapterFour/0800~0899/0881.Boats-to-Save-People.md" >}})|Medium||||55.8%| +|0885|Spiral Matrix III|[Go]({{< relref "/ChapterFour/0800~0899/0885.Spiral-Matrix-III.md" >}})|Medium||||73.5%| +|0888|Fair Candy Swap|[Go]({{< relref "/ChapterFour/0800~0899/0888.Fair-Candy-Swap.md" >}})|Easy||||60.7%| +|0890|Find and Replace Pattern|[Go]({{< relref "/ChapterFour/0800~0899/0890.Find-and-Replace-Pattern.md" >}})|Medium||||77.6%| +|0891|Sum of Subsequence Widths|[Go]({{< relref "/ChapterFour/0800~0899/0891.Sum-of-Subsequence-Widths.md" >}})|Hard| O(n log n)| O(1)||36.7%| +|0892|Surface Area of 3D Shapes|[Go]({{< relref "/ChapterFour/0800~0899/0892.Surface-Area-of-3D-Shapes.md" >}})|Easy||||64.0%| |0896|Monotonic Array|[Go]({{< relref "/ChapterFour/0800~0899/0896.Monotonic-Array.md" >}})|Easy||||58.4%| -|0898|Bitwise ORs of Subarrays|[Go]({{< relref "/ChapterFour/0800~0899/0898.Bitwise-ORs-of-Subarrays.md" >}})|Medium||||36.3%| -|0904|Fruit Into Baskets|[Go]({{< relref "/ChapterFour/0900~0999/0904.Fruit-Into-Baskets.md" >}})|Medium||||42.8%| -|0907|Sum of Subarray Minimums|[Go]({{< relref "/ChapterFour/0900~0999/0907.Sum-of-Subarray-Minimums.md" >}})|Medium| O(n)| O(n)|❤️|33.9%| -|0909|Snakes and Ladders|[Go]({{< relref "/ChapterFour/0900~0999/0909.Snakes-and-Ladders.md" >}})|Medium||||40.5%| -|0910|Smallest Range II|[Go]({{< relref "/ChapterFour/0900~0999/0910.Smallest-Range-II.md" >}})|Medium||||32.8%| -|0911|Online Election|[Go]({{< relref "/ChapterFour/0900~0999/0911.Online-Election.md" >}})|Medium||||51.6%| -|0914|X of a Kind in a Deck of Cards|[Go]({{< relref "/ChapterFour/0900~0999/0914.X-of-a-Kind-in-a-Deck-of-Cards.md" >}})|Easy||||32.9%| -|0916|Word Subsets|[Go]({{< relref "/ChapterFour/0900~0999/0916.Word-Subsets.md" >}})|Medium||||52.6%| -|0918|Maximum Sum Circular Subarray|[Go]({{< relref "/ChapterFour/0900~0999/0918.Maximum-Sum-Circular-Subarray.md" >}})|Medium||||37.2%| -|0922|Sort Array By Parity II|[Go]({{< relref "/ChapterFour/0900~0999/0922.Sort-Array-By-Parity-II.md" >}})|Easy| O(n)| O(1)||70.6%| -|0923|3Sum With Multiplicity|[Go]({{< relref "/ChapterFour/0900~0999/0923.3Sum-With-Multiplicity.md" >}})|Medium||||45.4%| -|0924|Minimize Malware Spread|[Go]({{< relref "/ChapterFour/0900~0999/0924.Minimize-Malware-Spread.md" >}})|Hard||||41.9%| -|0927|Three Equal Parts|[Go]({{< relref "/ChapterFour/0900~0999/0927.Three-Equal-Parts.md" >}})|Hard||||39.4%| -|0928|Minimize Malware Spread II|[Go]({{< relref "/ChapterFour/0900~0999/0928.Minimize-Malware-Spread-II.md" >}})|Hard||||42.3%| -|0930|Binary Subarrays With Sum|[Go]({{< relref "/ChapterFour/0900~0999/0930.Binary-Subarrays-With-Sum.md" >}})|Medium||||48.9%| -|0942|DI String Match|[Go]({{< relref "/ChapterFour/0900~0999/0942.DI-String-Match.md" >}})|Easy||||75.9%| -|0946|Validate Stack Sequences|[Go]({{< relref "/ChapterFour/0900~0999/0946.Validate-Stack-Sequences.md" >}})|Medium||||67.6%| -|0952|Largest Component Size by Common Factor|[Go]({{< relref "/ChapterFour/0900~0999/0952.Largest-Component-Size-by-Common-Factor.md" >}})|Hard||||40.2%| -|0953|Verifying an Alien Dictionary|[Go]({{< relref "/ChapterFour/0900~0999/0953.Verifying-an-Alien-Dictionary.md" >}})|Easy||||52.5%| -|0961|N-Repeated Element in Size 2N Array|[Go]({{< relref "/ChapterFour/0900~0999/0961.N-Repeated-Element-in-Size-2N-Array.md" >}})|Easy||||75.5%| -|0966|Vowel Spellchecker|[Go]({{< relref "/ChapterFour/0900~0999/0966.Vowel-Spellchecker.md" >}})|Medium||||51.6%| -|0969|Pancake Sorting|[Go]({{< relref "/ChapterFour/0900~0999/0969.Pancake-Sorting.md" >}})|Medium| O(n)| O(1)|❤️|69.7%| -|0973|K Closest Points to Origin|[Go]({{< relref "/ChapterFour/0900~0999/0973.K-Closest-Points-to-Origin.md" >}})|Medium||||66.0%| -|0976|Largest Perimeter Triangle|[Go]({{< relref "/ChapterFour/0900~0999/0976.Largest-Perimeter-Triangle.md" >}})|Easy||||55.5%| -|0977|Squares of a Sorted Array|[Go]({{< relref "/ChapterFour/0900~0999/0977.Squares-of-a-Sorted-Array.md" >}})|Easy| O(n)| O(1)||71.6%| -|0978|Longest Turbulent Subarray|[Go]({{< relref "/ChapterFour/0900~0999/0978.Longest-Turbulent-Subarray.md" >}})|Medium||||47.5%| -|0980|Unique Paths III|[Go]({{< relref "/ChapterFour/0900~0999/0980.Unique-Paths-III.md" >}})|Hard||||79.4%| -|0985|Sum of Even Numbers After Queries|[Go]({{< relref "/ChapterFour/0900~0999/0985.Sum-of-Even-Numbers-After-Queries.md" >}})|Medium||||61.0%| -|0986|Interval List Intersections|[Go]({{< relref "/ChapterFour/0900~0999/0986.Interval-List-Intersections.md" >}})|Medium||||71.1%| -|0989|Add to Array-Form of Integer|[Go]({{< relref "/ChapterFour/0900~0999/0989.Add-to-Array-Form-of-Integer.md" >}})|Easy||||45.5%| -|0990|Satisfiability of Equality Equations|[Go]({{< relref "/ChapterFour/0900~0999/0990.Satisfiability-of-Equality-Equations.md" >}})|Medium||||50.1%| -|0992|Subarrays with K Different Integers|[Go]({{< relref "/ChapterFour/0900~0999/0992.Subarrays-with-K-Different-Integers.md" >}})|Hard||||53.4%| -|0995|Minimum Number of K Consecutive Bit Flips|[Go]({{< relref "/ChapterFour/0900~0999/0995.Minimum-Number-of-K-Consecutive-Bit-Flips.md" >}})|Hard||||50.8%| -|0996|Number of Squareful Arrays|[Go]({{< relref "/ChapterFour/0900~0999/0996.Number-of-Squareful-Arrays.md" >}})|Hard||||49.1%| -|0997|Find the Town Judge|[Go]({{< relref "/ChapterFour/0900~0999/0997.Find-the-Town-Judge.md" >}})|Easy||||49.8%| -|0999|Available Captures for Rook|[Go]({{< relref "/ChapterFour/0900~0999/0999.Available-Captures-for-Rook.md" >}})|Easy||||67.6%| -|1002|Find Common Characters|[Go]({{< relref "/ChapterFour/1000~1099/1002.Find-Common-Characters.md" >}})|Easy||||68.4%| -|1004|Max Consecutive Ones III|[Go]({{< relref "/ChapterFour/1000~1099/1004.Max-Consecutive-Ones-III.md" >}})|Medium||||63.0%| -|1005|Maximize Sum Of Array After K Negations|[Go]({{< relref "/ChapterFour/1000~1099/1005.Maximize-Sum-Of-Array-After-K-Negations.md" >}})|Easy||||51.4%| -|1010|Pairs of Songs With Total Durations Divisible by 60|[Go]({{< relref "/ChapterFour/1000~1099/1010.Pairs-of-Songs-With-Total-Durations-Divisible-by-60.md" >}})|Medium||||53.6%| -|1011|Capacity To Ship Packages Within D Days|[Go]({{< relref "/ChapterFour/1000~1099/1011.Capacity-To-Ship-Packages-Within-D-Days.md" >}})|Medium||||63.6%| -|1018|Binary Prefix Divisible By 5|[Go]({{< relref "/ChapterFour/1000~1099/1018.Binary-Prefix-Divisible-By-5.md" >}})|Easy||||47.5%| -|1019|Next Greater Node In Linked List|[Go]({{< relref "/ChapterFour/1000~1099/1019.Next-Greater-Node-In-Linked-List.md" >}})|Medium||||59.6%| -|1020|Number of Enclaves|[Go]({{< relref "/ChapterFour/1000~1099/1020.Number-of-Enclaves.md" >}})|Medium||||62.8%| -|1030|Matrix Cells in Distance Order|[Go]({{< relref "/ChapterFour/1000~1099/1030.Matrix-Cells-in-Distance-Order.md" >}})|Easy||||69.1%| -|1034|Coloring A Border|[Go]({{< relref "/ChapterFour/1000~1099/1034.Coloring-A-Border.md" >}})|Medium||||48.4%| -|1040|Moving Stones Until Consecutive II|[Go]({{< relref "/ChapterFour/1000~1099/1040.Moving-Stones-Until-Consecutive-II.md" >}})|Medium||||55.6%| -|1048|Longest String Chain|[Go]({{< relref "/ChapterFour/1000~1099/1048.Longest-String-Chain.md" >}})|Medium||||57.8%| -|1049|Last Stone Weight II|[Go]({{< relref "/ChapterFour/1000~1099/1049.Last-Stone-Weight-II.md" >}})|Medium||||51.1%| -|1051|Height Checker|[Go]({{< relref "/ChapterFour/1000~1099/1051.Height-Checker.md" >}})|Easy||||74.3%| -|1052|Grumpy Bookstore Owner|[Go]({{< relref "/ChapterFour/1000~1099/1052.Grumpy-Bookstore-Owner.md" >}})|Medium||||56.7%| -|1054|Distant Barcodes|[Go]({{< relref "/ChapterFour/1000~1099/1054.Distant-Barcodes.md" >}})|Medium||||45.2%| -|1073|Adding Two Negabinary Numbers|[Go]({{< relref "/ChapterFour/1000~1099/1073.Adding-Two-Negabinary-Numbers.md" >}})|Medium||||35.9%| -|1074|Number of Submatrices That Sum to Target|[Go]({{< relref "/ChapterFour/1000~1099/1074.Number-of-Submatrices-That-Sum-to-Target.md" >}})|Hard||||66.3%| -|1089|Duplicate Zeros|[Go]({{< relref "/ChapterFour/1000~1099/1089.Duplicate-Zeros.md" >}})|Easy||||51.1%| -|1091|Shortest Path in Binary Matrix|[Go]({{< relref "/ChapterFour/1000~1099/1091.Shortest-Path-in-Binary-Matrix.md" >}})|Medium||||42.7%| -|1105|Filling Bookcase Shelves|[Go]({{< relref "/ChapterFour/1100~1199/1105.Filling-Bookcase-Shelves.md" >}})|Medium||||58.1%| -|1122|Relative Sort Array|[Go]({{< relref "/ChapterFour/1100~1199/1122.Relative-Sort-Array.md" >}})|Easy||||68.2%| -|1128|Number of Equivalent Domino Pairs|[Go]({{< relref "/ChapterFour/1100~1199/1128.Number-of-Equivalent-Domino-Pairs.md" >}})|Easy||||46.3%| -|1157|Online Majority Element In Subarray|[Go]({{< relref "/ChapterFour/1100~1199/1157.Online-Majority-Element-In-Subarray.md" >}})|Hard||||42.1%| -|1160|Find Words That Can Be Formed by Characters|[Go]({{< relref "/ChapterFour/1100~1199/1160.Find-Words-That-Can-Be-Formed-by-Characters.md" >}})|Easy||||67.7%| -|1170|Compare Strings by Frequency of the Smallest Character|[Go]({{< relref "/ChapterFour/1100~1199/1170.Compare-Strings-by-Frequency-of-the-Smallest-Character.md" >}})|Medium||||61.1%| -|1178|Number of Valid Words for Each Puzzle|[Go]({{< relref "/ChapterFour/1100~1199/1178.Number-of-Valid-Words-for-Each-Puzzle.md" >}})|Hard||||46.8%| -|1184|Distance Between Bus Stops|[Go]({{< relref "/ChapterFour/1100~1199/1184.Distance-Between-Bus-Stops.md" >}})|Easy||||54.1%| -|1200|Minimum Absolute Difference|[Go]({{< relref "/ChapterFour/1200~1299/1200.Minimum-Absolute-Difference.md" >}})|Easy||||69.8%| -|1207|Unique Number of Occurrences|[Go]({{< relref "/ChapterFour/1200~1299/1207.Unique-Number-of-Occurrences.md" >}})|Easy||||71.9%| -|1217|Minimum Cost to Move Chips to The Same Position|[Go]({{< relref "/ChapterFour/1200~1299/1217.Minimum-Cost-to-Move-Chips-to-The-Same-Position.md" >}})|Easy||||72.7%| -|1232|Check If It Is a Straight Line|[Go]({{< relref "/ChapterFour/1200~1299/1232.Check-If-It-Is-a-Straight-Line.md" >}})|Easy||||41.9%| -|1235|Maximum Profit in Job Scheduling|[Go]({{< relref "/ChapterFour/1200~1299/1235.Maximum-Profit-in-Job-Scheduling.md" >}})|Hard||||50.9%| -|1239|Maximum Length of a Concatenated String with Unique Characters|[Go]({{< relref "/ChapterFour/1200~1299/1239.Maximum-Length-of-a-Concatenated-String-with-Unique-Characters.md" >}})|Medium||||50.5%| +|0898|Bitwise ORs of Subarrays|[Go]({{< relref "/ChapterFour/0800~0899/0898.Bitwise-ORs-of-Subarrays.md" >}})|Medium||||37.2%| +|0904|Fruit Into Baskets|[Go]({{< relref "/ChapterFour/0900~0999/0904.Fruit-Into-Baskets.md" >}})|Medium||||43.7%| +|0907|Sum of Subarray Minimums|[Go]({{< relref "/ChapterFour/0900~0999/0907.Sum-of-Subarray-Minimums.md" >}})|Medium| O(n)| O(n)|❤️|35.8%| +|0909|Snakes and Ladders|[Go]({{< relref "/ChapterFour/0900~0999/0909.Snakes-and-Ladders.md" >}})|Medium||||45.1%| +|0910|Smallest Range II|[Go]({{< relref "/ChapterFour/0900~0999/0910.Smallest-Range-II.md" >}})|Medium||||35.2%| +|0911|Online Election|[Go]({{< relref "/ChapterFour/0900~0999/0911.Online-Election.md" >}})|Medium||||52.2%| +|0914|X of a Kind in a Deck of Cards|[Go]({{< relref "/ChapterFour/0900~0999/0914.X-of-a-Kind-in-a-Deck-of-Cards.md" >}})|Easy||||31.2%| +|0916|Word Subsets|[Go]({{< relref "/ChapterFour/0900~0999/0916.Word-Subsets.md" >}})|Medium||||53.7%| +|0918|Maximum Sum Circular Subarray|[Go]({{< relref "/ChapterFour/0900~0999/0918.Maximum-Sum-Circular-Subarray.md" >}})|Medium||||43.0%| +|0922|Sort Array By Parity II|[Go]({{< relref "/ChapterFour/0900~0999/0922.Sort-Array-By-Parity-II.md" >}})|Easy| O(n)| O(1)||70.7%| +|0923|3Sum With Multiplicity|[Go]({{< relref "/ChapterFour/0900~0999/0923.3Sum-With-Multiplicity.md" >}})|Medium||||45.3%| +|0924|Minimize Malware Spread|[Go]({{< relref "/ChapterFour/0900~0999/0924.Minimize-Malware-Spread.md" >}})|Hard||||42.1%| +|0927|Three Equal Parts|[Go]({{< relref "/ChapterFour/0900~0999/0927.Three-Equal-Parts.md" >}})|Hard||||39.6%| +|0928|Minimize Malware Spread II|[Go]({{< relref "/ChapterFour/0900~0999/0928.Minimize-Malware-Spread-II.md" >}})|Hard||||42.8%| +|0930|Binary Subarrays With Sum|[Go]({{< relref "/ChapterFour/0900~0999/0930.Binary-Subarrays-With-Sum.md" >}})|Medium||||52.2%| +|0942|DI String Match|[Go]({{< relref "/ChapterFour/0900~0999/0942.DI-String-Match.md" >}})|Easy||||77.3%| +|0946|Validate Stack Sequences|[Go]({{< relref "/ChapterFour/0900~0999/0946.Validate-Stack-Sequences.md" >}})|Medium||||67.7%| +|0952|Largest Component Size by Common Factor|[Go]({{< relref "/ChapterFour/0900~0999/0952.Largest-Component-Size-by-Common-Factor.md" >}})|Hard||||40.0%| +|0953|Verifying an Alien Dictionary|[Go]({{< relref "/ChapterFour/0900~0999/0953.Verifying-an-Alien-Dictionary.md" >}})|Easy||||54.5%| +|0961|N-Repeated Element in Size 2N Array|[Go]({{< relref "/ChapterFour/0900~0999/0961.N-Repeated-Element-in-Size-2N-Array.md" >}})|Easy||||76.1%| +|0966|Vowel Spellchecker|[Go]({{< relref "/ChapterFour/0900~0999/0966.Vowel-Spellchecker.md" >}})|Medium||||51.4%| +|0969|Pancake Sorting|[Go]({{< relref "/ChapterFour/0900~0999/0969.Pancake-Sorting.md" >}})|Medium| O(n)| O(1)|❤️|70.1%| +|0973|K Closest Points to Origin|[Go]({{< relref "/ChapterFour/0900~0999/0973.K-Closest-Points-to-Origin.md" >}})|Medium||||65.7%| +|0976|Largest Perimeter Triangle|[Go]({{< relref "/ChapterFour/0900~0999/0976.Largest-Perimeter-Triangle.md" >}})|Easy||||54.7%| +|0977|Squares of a Sorted Array|[Go]({{< relref "/ChapterFour/0900~0999/0977.Squares-of-a-Sorted-Array.md" >}})|Easy| O(n)| O(1)||71.9%| +|0978|Longest Turbulent Subarray|[Go]({{< relref "/ChapterFour/0900~0999/0978.Longest-Turbulent-Subarray.md" >}})|Medium||||47.2%| +|0980|Unique Paths III|[Go]({{< relref "/ChapterFour/0900~0999/0980.Unique-Paths-III.md" >}})|Hard||||81.7%| +|0985|Sum of Even Numbers After Queries|[Go]({{< relref "/ChapterFour/0900~0999/0985.Sum-of-Even-Numbers-After-Queries.md" >}})|Medium||||68.1%| +|0986|Interval List Intersections|[Go]({{< relref "/ChapterFour/0900~0999/0986.Interval-List-Intersections.md" >}})|Medium||||71.3%| +|0989|Add to Array-Form of Integer|[Go]({{< relref "/ChapterFour/0900~0999/0989.Add-to-Array-Form-of-Integer.md" >}})|Easy||||47.1%| +|0990|Satisfiability of Equality Equations|[Go]({{< relref "/ChapterFour/0900~0999/0990.Satisfiability-of-Equality-Equations.md" >}})|Medium||||50.5%| +|0992|Subarrays with K Different Integers|[Go]({{< relref "/ChapterFour/0900~0999/0992.Subarrays-with-K-Different-Integers.md" >}})|Hard||||54.6%| +|0995|Minimum Number of K Consecutive Bit Flips|[Go]({{< relref "/ChapterFour/0900~0999/0995.Minimum-Number-of-K-Consecutive-Bit-Flips.md" >}})|Hard||||51.2%| +|0996|Number of Squareful Arrays|[Go]({{< relref "/ChapterFour/0900~0999/0996.Number-of-Squareful-Arrays.md" >}})|Hard||||49.2%| +|0997|Find the Town Judge|[Go]({{< relref "/ChapterFour/0900~0999/0997.Find-the-Town-Judge.md" >}})|Easy||||49.5%| +|0999|Available Captures for Rook|[Go]({{< relref "/ChapterFour/0900~0999/0999.Available-Captures-for-Rook.md" >}})|Easy||||68.2%| +|1002|Find Common Characters|[Go]({{< relref "/ChapterFour/1000~1099/1002.Find-Common-Characters.md" >}})|Easy||||68.5%| +|1004|Max Consecutive Ones III|[Go]({{< relref "/ChapterFour/1000~1099/1004.Max-Consecutive-Ones-III.md" >}})|Medium||||63.2%| +|1005|Maximize Sum Of Array After K Negations|[Go]({{< relref "/ChapterFour/1000~1099/1005.Maximize-Sum-Of-Array-After-K-Negations.md" >}})|Easy||||50.8%| +|1010|Pairs of Songs With Total Durations Divisible by 60|[Go]({{< relref "/ChapterFour/1000~1099/1010.Pairs-of-Songs-With-Total-Durations-Divisible-by-60.md" >}})|Medium||||52.8%| +|1011|Capacity To Ship Packages Within D Days|[Go]({{< relref "/ChapterFour/1000~1099/1011.Capacity-To-Ship-Packages-Within-D-Days.md" >}})|Medium||||67.7%| +|1018|Binary Prefix Divisible By 5|[Go]({{< relref "/ChapterFour/1000~1099/1018.Binary-Prefix-Divisible-By-5.md" >}})|Easy||||46.9%| +|1019|Next Greater Node In Linked List|[Go]({{< relref "/ChapterFour/1000~1099/1019.Next-Greater-Node-In-Linked-List.md" >}})|Medium||||59.9%| +|1020|Number of Enclaves|[Go]({{< relref "/ChapterFour/1000~1099/1020.Number-of-Enclaves.md" >}})|Medium||||65.6%| +|1030|Matrix Cells in Distance Order|[Go]({{< relref "/ChapterFour/1000~1099/1030.Matrix-Cells-in-Distance-Order.md" >}})|Easy||||69.7%| +|1034|Coloring A Border|[Go]({{< relref "/ChapterFour/1000~1099/1034.Coloring-A-Border.md" >}})|Medium||||49.2%| +|1037|Valid Boomerang|[Go]({{< relref "/ChapterFour/1000~1099/1037.Valid-Boomerang.md" >}})|Easy||||37.0%| +|1040|Moving Stones Until Consecutive II|[Go]({{< relref "/ChapterFour/1000~1099/1040.Moving-Stones-Until-Consecutive-II.md" >}})|Medium||||55.9%| +|1048|Longest String Chain|[Go]({{< relref "/ChapterFour/1000~1099/1048.Longest-String-Chain.md" >}})|Medium||||59.3%| +|1049|Last Stone Weight II|[Go]({{< relref "/ChapterFour/1000~1099/1049.Last-Stone-Weight-II.md" >}})|Medium||||53.2%| +|1051|Height Checker|[Go]({{< relref "/ChapterFour/1000~1099/1051.Height-Checker.md" >}})|Easy||||75.6%| +|1052|Grumpy Bookstore Owner|[Go]({{< relref "/ChapterFour/1000~1099/1052.Grumpy-Bookstore-Owner.md" >}})|Medium||||57.1%| +|1054|Distant Barcodes|[Go]({{< relref "/ChapterFour/1000~1099/1054.Distant-Barcodes.md" >}})|Medium||||45.9%| +|1073|Adding Two Negabinary Numbers|[Go]({{< relref "/ChapterFour/1000~1099/1073.Adding-Two-Negabinary-Numbers.md" >}})|Medium||||36.5%| +|1074|Number of Submatrices That Sum to Target|[Go]({{< relref "/ChapterFour/1000~1099/1074.Number-of-Submatrices-That-Sum-to-Target.md" >}})|Hard||||69.5%| +|1089|Duplicate Zeros|[Go]({{< relref "/ChapterFour/1000~1099/1089.Duplicate-Zeros.md" >}})|Easy||||51.5%| +|1091|Shortest Path in Binary Matrix|[Go]({{< relref "/ChapterFour/1000~1099/1091.Shortest-Path-in-Binary-Matrix.md" >}})|Medium||||44.7%| +|1093|Statistics from a Large Sample|[Go]({{< relref "/ChapterFour/1000~1099/1093.Statistics-from-a-Large-Sample.md" >}})|Medium||||43.5%| +|1105|Filling Bookcase Shelves|[Go]({{< relref "/ChapterFour/1100~1199/1105.Filling-Bookcase-Shelves.md" >}})|Medium||||59.3%| +|1122|Relative Sort Array|[Go]({{< relref "/ChapterFour/1100~1199/1122.Relative-Sort-Array.md" >}})|Easy||||68.6%| +|1128|Number of Equivalent Domino Pairs|[Go]({{< relref "/ChapterFour/1100~1199/1128.Number-of-Equivalent-Domino-Pairs.md" >}})|Easy||||47.1%| +|1157|Online Majority Element In Subarray|[Go]({{< relref "/ChapterFour/1100~1199/1157.Online-Majority-Element-In-Subarray.md" >}})|Hard||||41.8%| +|1160|Find Words That Can Be Formed by Characters|[Go]({{< relref "/ChapterFour/1100~1199/1160.Find-Words-That-Can-Be-Formed-by-Characters.md" >}})|Easy||||67.5%| +|1170|Compare Strings by Frequency of the Smallest Character|[Go]({{< relref "/ChapterFour/1100~1199/1170.Compare-Strings-by-Frequency-of-the-Smallest-Character.md" >}})|Medium||||61.5%| +|1178|Number of Valid Words for Each Puzzle|[Go]({{< relref "/ChapterFour/1100~1199/1178.Number-of-Valid-Words-for-Each-Puzzle.md" >}})|Hard||||46.3%| +|1184|Distance Between Bus Stops|[Go]({{< relref "/ChapterFour/1100~1199/1184.Distance-Between-Bus-Stops.md" >}})|Easy||||54.0%| +|1200|Minimum Absolute Difference|[Go]({{< relref "/ChapterFour/1200~1299/1200.Minimum-Absolute-Difference.md" >}})|Easy||||69.6%| +|1207|Unique Number of Occurrences|[Go]({{< relref "/ChapterFour/1200~1299/1207.Unique-Number-of-Occurrences.md" >}})|Easy||||73.5%| +|1217|Minimum Cost to Move Chips to The Same Position|[Go]({{< relref "/ChapterFour/1200~1299/1217.Minimum-Cost-to-Move-Chips-to-The-Same-Position.md" >}})|Easy||||71.9%| +|1232|Check If It Is a Straight Line|[Go]({{< relref "/ChapterFour/1200~1299/1232.Check-If-It-Is-a-Straight-Line.md" >}})|Easy||||40.3%| +|1235|Maximum Profit in Job Scheduling|[Go]({{< relref "/ChapterFour/1200~1299/1235.Maximum-Profit-in-Job-Scheduling.md" >}})|Hard||||53.4%| +|1239|Maximum Length of a Concatenated String with Unique Characters|[Go]({{< relref "/ChapterFour/1200~1299/1239.Maximum-Length-of-a-Concatenated-String-with-Unique-Characters.md" >}})|Medium||||52.2%| |1252|Cells with Odd Values in a Matrix|[Go]({{< relref "/ChapterFour/1200~1299/1252.Cells-with-Odd-Values-in-a-Matrix.md" >}})|Easy||||78.5%| -|1254|Number of Closed Islands|[Go]({{< relref "/ChapterFour/1200~1299/1254.Number-of-Closed-Islands.md" >}})|Medium||||63.4%| -|1260|Shift 2D Grid|[Go]({{< relref "/ChapterFour/1200~1299/1260.Shift-2D-Grid.md" >}})|Easy||||68.1%| +|1254|Number of Closed Islands|[Go]({{< relref "/ChapterFour/1200~1299/1254.Number-of-Closed-Islands.md" >}})|Medium||||66.9%| +|1260|Shift 2D Grid|[Go]({{< relref "/ChapterFour/1200~1299/1260.Shift-2D-Grid.md" >}})|Easy||||67.8%| |1266|Minimum Time Visiting All Points|[Go]({{< relref "/ChapterFour/1200~1299/1266.Minimum-Time-Visiting-All-Points.md" >}})|Easy||||79.1%| -|1268|Search Suggestions System|[Go]({{< relref "/ChapterFour/1200~1299/1268.Search-Suggestions-System.md" >}})|Medium||||65.3%| -|1275|Find Winner on a Tic Tac Toe Game|[Go]({{< relref "/ChapterFour/1200~1299/1275.Find-Winner-on-a-Tic-Tac-Toe-Game.md" >}})|Easy||||54.8%| -|1283|Find the Smallest Divisor Given a Threshold|[Go]({{< relref "/ChapterFour/1200~1299/1283.Find-the-Smallest-Divisor-Given-a-Threshold.md" >}})|Medium||||53.9%| -|1287|Element Appearing More Than 25% In Sorted Array|[Go]({{< relref "/ChapterFour/1200~1299/1287.Element-Appearing-More-Than-25-In-Sorted-Array.md" >}})|Easy||||59.6%| -|1295|Find Numbers with Even Number of Digits|[Go]({{< relref "/ChapterFour/1200~1299/1295.Find-Numbers-with-Even-Number-of-Digits.md" >}})|Easy||||77.1%| +|1268|Search Suggestions System|[Go]({{< relref "/ChapterFour/1200~1299/1268.Search-Suggestions-System.md" >}})|Medium||||66.2%| +|1275|Find Winner on a Tic Tac Toe Game|[Go]({{< relref "/ChapterFour/1200~1299/1275.Find-Winner-on-a-Tic-Tac-Toe-Game.md" >}})|Easy||||54.2%| +|1283|Find the Smallest Divisor Given a Threshold|[Go]({{< relref "/ChapterFour/1200~1299/1283.Find-the-Smallest-Divisor-Given-a-Threshold.md" >}})|Medium||||56.2%| +|1287|Element Appearing More Than 25% In Sorted Array|[Go]({{< relref "/ChapterFour/1200~1299/1287.Element-Appearing-More-Than-25-In-Sorted-Array.md" >}})|Easy||||59.4%| +|1293|Shortest Path in a Grid with Obstacles Elimination|[Go]({{< relref "/ChapterFour/1200~1299/1293.Shortest-Path-in-a-Grid-with-Obstacles-Elimination.md" >}})|Hard||||45.3%| +|1295|Find Numbers with Even Number of Digits|[Go]({{< relref "/ChapterFour/1200~1299/1295.Find-Numbers-with-Even-Number-of-Digits.md" >}})|Easy||||77.0%| |1296|Divide Array in Sets of K Consecutive Numbers|[Go]({{< relref "/ChapterFour/1200~1299/1296.Divide-Array-in-Sets-of-K-Consecutive-Numbers.md" >}})|Medium||||56.5%| -|1299|Replace Elements with Greatest Element on Right Side|[Go]({{< relref "/ChapterFour/1200~1299/1299.Replace-Elements-with-Greatest-Element-on-Right-Side.md" >}})|Easy||||74.5%| -|1300|Sum of Mutated Array Closest to Target|[Go]({{< relref "/ChapterFour/1300~1399/1300.Sum-of-Mutated-Array-Closest-to-Target.md" >}})|Medium||||42.8%| -|1304|Find N Unique Integers Sum up to Zero|[Go]({{< relref "/ChapterFour/1300~1399/1304.Find-N-Unique-Integers-Sum-up-to-Zero.md" >}})|Easy||||77.0%| -|1306|Jump Game III|[Go]({{< relref "/ChapterFour/1300~1399/1306.Jump-Game-III.md" >}})|Medium||||62.8%| -|1310|XOR Queries of a Subarray|[Go]({{< relref "/ChapterFour/1300~1399/1310.XOR-Queries-of-a-Subarray.md" >}})|Medium||||71.2%| -|1313|Decompress Run-Length Encoded List|[Go]({{< relref "/ChapterFour/1300~1399/1313.Decompress-Run-Length-Encoded-List.md" >}})|Easy||||85.9%| -|1329|Sort the Matrix Diagonally|[Go]({{< relref "/ChapterFour/1300~1399/1329.Sort-the-Matrix-Diagonally.md" >}})|Medium||||81.3%| -|1337|The K Weakest Rows in a Matrix|[Go]({{< relref "/ChapterFour/1300~1399/1337.The-K-Weakest-Rows-in-a-Matrix.md" >}})|Easy||||74.3%| -|1353|Maximum Number of Events That Can Be Attended|[Go]({{< relref "/ChapterFour/1300~1399/1353.Maximum-Number-of-Events-That-Can-Be-Attended.md" >}})|Medium||||33.4%| -|1380|Lucky Numbers in a Matrix|[Go]({{< relref "/ChapterFour/1300~1399/1380.Lucky-Numbers-in-a-Matrix.md" >}})|Easy||||70.9%| -|1383|Maximum Performance of a Team|[Go]({{< relref "/ChapterFour/1300~1399/1383.Maximum-Performance-of-a-Team.md" >}})|Hard||||41.5%| -|1385|Find the Distance Value Between Two Arrays|[Go]({{< relref "/ChapterFour/1300~1399/1385.Find-the-Distance-Value-Between-Two-Arrays.md" >}})|Easy||||65.9%| -|1389|Create Target Array in the Given Order|[Go]({{< relref "/ChapterFour/1300~1399/1389.Create-Target-Array-in-the-Given-Order.md" >}})|Easy||||85.6%| -|1423|Maximum Points You Can Obtain from Cards|[Go]({{< relref "/ChapterFour/1400~1499/1423.Maximum-Points-You-Can-Obtain-from-Cards.md" >}})|Medium||||50.0%| -|1437|Check If All 1's Are at Least Length K Places Away|[Go]({{< relref "/ChapterFour/1400~1499/1437.Check-If-All-1s-Are-at-Least-Length-K-Places-Away.md" >}})|Easy||||60.0%| -|1438|Longest Continuous Subarray With Absolute Diff Less Than or Equal to Limit|[Go]({{< relref "/ChapterFour/1400~1499/1438.Longest-Continuous-Subarray-With-Absolute-Diff-Less-Than-or-Equal-to-Limit.md" >}})|Medium||||46.4%| -|1439|Find the Kth Smallest Sum of a Matrix With Sorted Rows|[Go]({{< relref "/ChapterFour/1400~1499/1439.Find-the-Kth-Smallest-Sum-of-a-Matrix-With-Sorted-Rows.md" >}})|Hard||||61.5%| -|1442|Count Triplets That Can Form Two Arrays of Equal XOR|[Go]({{< relref "/ChapterFour/1400~1499/1442.Count-Triplets-That-Can-Form-Two-Arrays-of-Equal-XOR.md" >}})|Medium||||74.8%| -|1463|Cherry Pickup II|[Go]({{< relref "/ChapterFour/1400~1499/1463.Cherry-Pickup-II.md" >}})|Hard||||70.7%| -|1464|Maximum Product of Two Elements in an Array|[Go]({{< relref "/ChapterFour/1400~1499/1464.Maximum-Product-of-Two-Elements-in-an-Array.md" >}})|Easy||||78.5%| -|1465|Maximum Area of a Piece of Cake After Horizontal and Vertical Cuts|[Go]({{< relref "/ChapterFour/1400~1499/1465.Maximum-Area-of-a-Piece-of-Cake-After-Horizontal-and-Vertical-Cuts.md" >}})|Medium||||37.1%| -|1470|Shuffle the Array|[Go]({{< relref "/ChapterFour/1400~1499/1470.Shuffle-the-Array.md" >}})|Easy||||88.3%| -|1480|Running Sum of 1d Array|[Go]({{< relref "/ChapterFour/1400~1499/1480.Running-Sum-of-1d-Array.md" >}})|Easy||||89.6%| -|1482|Minimum Number of Days to Make m Bouquets|[Go]({{< relref "/ChapterFour/1400~1499/1482.Minimum-Number-of-Days-to-Make-m-Bouquets.md" >}})|Medium||||56.0%| -|1512|Number of Good Pairs|[Go]({{< relref "/ChapterFour/1500~1599/1512.Number-of-Good-Pairs.md" >}})|Easy||||88.0%| -|1539|Kth Missing Positive Number|[Go]({{< relref "/ChapterFour/1500~1599/1539.Kth-Missing-Positive-Number.md" >}})|Easy||||55.5%| -|1572|Matrix Diagonal Sum|[Go]({{< relref "/ChapterFour/1500~1599/1572.Matrix-Diagonal-Sum.md" >}})|Easy||||79.1%| +|1299|Replace Elements with Greatest Element on Right Side|[Go]({{< relref "/ChapterFour/1200~1299/1299.Replace-Elements-with-Greatest-Element-on-Right-Side.md" >}})|Easy||||73.3%| +|1300|Sum of Mutated Array Closest to Target|[Go]({{< relref "/ChapterFour/1300~1399/1300.Sum-of-Mutated-Array-Closest-to-Target.md" >}})|Medium||||43.6%| +|1304|Find N Unique Integers Sum up to Zero|[Go]({{< relref "/ChapterFour/1300~1399/1304.Find-N-Unique-Integers-Sum-up-to-Zero.md" >}})|Easy||||76.9%| +|1306|Jump Game III|[Go]({{< relref "/ChapterFour/1300~1399/1306.Jump-Game-III.md" >}})|Medium||||63.5%| +|1310|XOR Queries of a Subarray|[Go]({{< relref "/ChapterFour/1300~1399/1310.XOR-Queries-of-a-Subarray.md" >}})|Medium||||72.3%| +|1313|Decompress Run-Length Encoded List|[Go]({{< relref "/ChapterFour/1300~1399/1313.Decompress-Run-Length-Encoded-List.md" >}})|Easy||||85.8%| +|1329|Sort the Matrix Diagonally|[Go]({{< relref "/ChapterFour/1300~1399/1329.Sort-the-Matrix-Diagonally.md" >}})|Medium||||83.3%| +|1337|The K Weakest Rows in a Matrix|[Go]({{< relref "/ChapterFour/1300~1399/1337.The-K-Weakest-Rows-in-a-Matrix.md" >}})|Easy||||72.1%| +|1353|Maximum Number of Events That Can Be Attended|[Go]({{< relref "/ChapterFour/1300~1399/1353.Maximum-Number-of-Events-That-Can-Be-Attended.md" >}})|Medium||||32.5%| +|1380|Lucky Numbers in a Matrix|[Go]({{< relref "/ChapterFour/1300~1399/1380.Lucky-Numbers-in-a-Matrix.md" >}})|Easy||||70.7%| +|1383|Maximum Performance of a Team|[Go]({{< relref "/ChapterFour/1300~1399/1383.Maximum-Performance-of-a-Team.md" >}})|Hard||||48.5%| +|1385|Find the Distance Value Between Two Arrays|[Go]({{< relref "/ChapterFour/1300~1399/1385.Find-the-Distance-Value-Between-Two-Arrays.md" >}})|Easy||||66.6%| +|1389|Create Target Array in the Given Order|[Go]({{< relref "/ChapterFour/1300~1399/1389.Create-Target-Array-in-the-Given-Order.md" >}})|Easy||||85.8%| +|1423|Maximum Points You Can Obtain from Cards|[Go]({{< relref "/ChapterFour/1400~1499/1423.Maximum-Points-You-Can-Obtain-from-Cards.md" >}})|Medium||||52.2%| +|1437|Check If All 1's Are at Least Length K Places Away|[Go]({{< relref "/ChapterFour/1400~1499/1437.Check-If-All-1s-Are-at-Least-Length-K-Places-Away.md" >}})|Easy||||58.7%| +|1438|Longest Continuous Subarray With Absolute Diff Less Than or Equal to Limit|[Go]({{< relref "/ChapterFour/1400~1499/1438.Longest-Continuous-Subarray-With-Absolute-Diff-Less-Than-or-Equal-to-Limit.md" >}})|Medium||||48.3%| +|1439|Find the Kth Smallest Sum of a Matrix With Sorted Rows|[Go]({{< relref "/ChapterFour/1400~1499/1439.Find-the-Kth-Smallest-Sum-of-a-Matrix-With-Sorted-Rows.md" >}})|Hard||||61.4%| +|1442|Count Triplets That Can Form Two Arrays of Equal XOR|[Go]({{< relref "/ChapterFour/1400~1499/1442.Count-Triplets-That-Can-Form-Two-Arrays-of-Equal-XOR.md" >}})|Medium||||76.1%| +|1463|Cherry Pickup II|[Go]({{< relref "/ChapterFour/1400~1499/1463.Cherry-Pickup-II.md" >}})|Hard||||69.5%| +|1464|Maximum Product of Two Elements in an Array|[Go]({{< relref "/ChapterFour/1400~1499/1464.Maximum-Product-of-Two-Elements-in-an-Array.md" >}})|Easy||||80.0%| +|1465|Maximum Area of a Piece of Cake After Horizontal and Vertical Cuts|[Go]({{< relref "/ChapterFour/1400~1499/1465.Maximum-Area-of-a-Piece-of-Cake-After-Horizontal-and-Vertical-Cuts.md" >}})|Medium||||40.9%| +|1470|Shuffle the Array|[Go]({{< relref "/ChapterFour/1400~1499/1470.Shuffle-the-Array.md" >}})|Easy||||89.0%| +|1480|Running Sum of 1d Array|[Go]({{< relref "/ChapterFour/1400~1499/1480.Running-Sum-of-1d-Array.md" >}})|Easy||||87.4%| +|1482|Minimum Number of Days to Make m Bouquets|[Go]({{< relref "/ChapterFour/1400~1499/1482.Minimum-Number-of-Days-to-Make-m-Bouquets.md" >}})|Medium||||54.0%| +|1512|Number of Good Pairs|[Go]({{< relref "/ChapterFour/1500~1599/1512.Number-of-Good-Pairs.md" >}})|Easy||||88.2%| +|1539|Kth Missing Positive Number|[Go]({{< relref "/ChapterFour/1500~1599/1539.Kth-Missing-Positive-Number.md" >}})|Easy||||58.6%| +|1572|Matrix Diagonal Sum|[Go]({{< relref "/ChapterFour/1500~1599/1572.Matrix-Diagonal-Sum.md" >}})|Easy||||80.3%| |1608|Special Array With X Elements Greater Than or Equal X|[Go]({{< relref "/ChapterFour/1600~1699/1608.Special-Array-With-X-Elements-Greater-Than-or-Equal-X.md" >}})|Easy||||60.5%| -|1619|Mean of Array After Removing Some Elements|[Go]({{< relref "/ChapterFour/1600~1699/1619.Mean-of-Array-After-Removing-Some-Elements.md" >}})|Easy||||64.5%| -|1629|Slowest Key|[Go]({{< relref "/ChapterFour/1600~1699/1629.Slowest-Key.md" >}})|Easy||||59.6%| -|1631|Path With Minimum Effort|[Go]({{< relref "/ChapterFour/1600~1699/1631.Path-With-Minimum-Effort.md" >}})|Medium||||55.0%| -|1636|Sort Array by Increasing Frequency|[Go]({{< relref "/ChapterFour/1600~1699/1636.Sort-Array-by-Increasing-Frequency.md" >}})|Easy||||68.4%| -|1640|Check Array Formation Through Concatenation|[Go]({{< relref "/ChapterFour/1600~1699/1640.Check-Array-Formation-Through-Concatenation.md" >}})|Easy||||55.8%| -|1642|Furthest Building You Can Reach|[Go]({{< relref "/ChapterFour/1600~1699/1642.Furthest-Building-You-Can-Reach.md" >}})|Medium||||45.1%| -|1646|Get Maximum in Generated Array|[Go]({{< relref "/ChapterFour/1600~1699/1646.Get-Maximum-in-Generated-Array.md" >}})|Easy||||50.8%| -|1648|Sell Diminishing-Valued Colored Balls|[Go]({{< relref "/ChapterFour/1600~1699/1648.Sell-Diminishing-Valued-Colored-Balls.md" >}})|Medium||||30.8%| -|1649|Create Sorted Array through Instructions|[Go]({{< relref "/ChapterFour/1600~1699/1649.Create-Sorted-Array-through-Instructions.md" >}})|Hard||||37.2%| -|1652|Defuse the Bomb|[Go]({{< relref "/ChapterFour/1600~1699/1652.Defuse-the-Bomb.md" >}})|Easy||||60.8%| -|1654|Minimum Jumps to Reach Home|[Go]({{< relref "/ChapterFour/1600~1699/1654.Minimum-Jumps-to-Reach-Home.md" >}})|Medium||||27.2%| -|1655|Distribute Repeating Integers|[Go]({{< relref "/ChapterFour/1600~1699/1655.Distribute-Repeating-Integers.md" >}})|Hard||||40.3%| -|1656|Design an Ordered Stream|[Go]({{< relref "/ChapterFour/1600~1699/1656.Design-an-Ordered-Stream.md" >}})|Easy||||83.8%| -|1658|Minimum Operations to Reduce X to Zero|[Go]({{< relref "/ChapterFour/1600~1699/1658.Minimum-Operations-to-Reduce-X-to-Zero.md" >}})|Medium||||33.6%| -|1662|Check If Two String Arrays are Equivalent|[Go]({{< relref "/ChapterFour/1600~1699/1662.Check-If-Two-String-Arrays-are-Equivalent.md" >}})|Easy||||82.0%| -|1664|Ways to Make a Fair Array|[Go]({{< relref "/ChapterFour/1600~1699/1664.Ways-to-Make-a-Fair-Array.md" >}})|Medium||||63.2%| -|1665|Minimum Initial Energy to Finish Tasks|[Go]({{< relref "/ChapterFour/1600~1699/1665.Minimum-Initial-Energy-to-Finish-Tasks.md" >}})|Hard||||55.8%| -|1670|Design Front Middle Back Queue|[Go]({{< relref "/ChapterFour/1600~1699/1670.Design-Front-Middle-Back-Queue.md" >}})|Medium||||55.6%| -|1672|Richest Customer Wealth|[Go]({{< relref "/ChapterFour/1600~1699/1672.Richest-Customer-Wealth.md" >}})|Easy||||89.2%| -|1673|Find the Most Competitive Subsequence|[Go]({{< relref "/ChapterFour/1600~1699/1673.Find-the-Most-Competitive-Subsequence.md" >}})|Medium||||48.4%| -|1674|Minimum Moves to Make Array Complementary|[Go]({{< relref "/ChapterFour/1600~1699/1674.Minimum-Moves-to-Make-Array-Complementary.md" >}})|Medium||||37.3%| -|1675|Minimize Deviation in Array|[Go]({{< relref "/ChapterFour/1600~1699/1675.Minimize-Deviation-in-Array.md" >}})|Hard||||52.5%| -|1679|Max Number of K-Sum Pairs|[Go]({{< relref "/ChapterFour/1600~1699/1679.Max-Number-of-K-Sum-Pairs.md" >}})|Medium||||57.7%| -|1681|Minimum Incompatibility|[Go]({{< relref "/ChapterFour/1600~1699/1681.Minimum-Incompatibility.md" >}})|Hard||||37.1%| -|1684|Count the Number of Consistent Strings|[Go]({{< relref "/ChapterFour/1600~1699/1684.Count-the-Number-of-Consistent-Strings.md" >}})|Easy||||81.8%| -|1685|Sum of Absolute Differences in a Sorted Array|[Go]({{< relref "/ChapterFour/1600~1699/1685.Sum-of-Absolute-Differences-in-a-Sorted-Array.md" >}})|Medium||||65.7%| -|1690|Stone Game VII|[Go]({{< relref "/ChapterFour/1600~1699/1690.Stone-Game-VII.md" >}})|Medium||||58.7%| -|1691|Maximum Height by Stacking Cuboids|[Go]({{< relref "/ChapterFour/1600~1699/1691.Maximum-Height-by-Stacking-Cuboids.md" >}})|Hard||||53.6%| -|1695|Maximum Erasure Value|[Go]({{< relref "/ChapterFour/1600~1699/1695.Maximum-Erasure-Value.md" >}})|Medium||||52.4%| -|1696|Jump Game VI|[Go]({{< relref "/ChapterFour/1600~1699/1696.Jump-Game-VI.md" >}})|Medium||||42.8%| -|1700|Number of Students Unable to Eat Lunch|[Go]({{< relref "/ChapterFour/1700~1799/1700.Number-of-Students-Unable-to-Eat-Lunch.md" >}})|Easy||||67.7%| -|1705|Maximum Number of Eaten Apples|[Go]({{< relref "/ChapterFour/1700~1799/1705.Maximum-Number-of-Eaten-Apples.md" >}})|Medium||||36.4%| -|1710|Maximum Units on a Truck|[Go]({{< relref "/ChapterFour/1700~1799/1710.Maximum-Units-on-a-Truck.md" >}})|Easy||||72.0%| -|1720|Decode XORed Array|[Go]({{< relref "/ChapterFour/1700~1799/1720.Decode-XORed-Array.md" >}})|Easy||||85.9%| -|1725|Number Of Rectangles That Can Form The Largest Square|[Go]({{< relref "/ChapterFour/1700~1799/1725.Number-Of-Rectangles-That-Can-Form-The-Largest-Square.md" >}})|Easy||||78.8%| +|1619|Mean of Array After Removing Some Elements|[Go]({{< relref "/ChapterFour/1600~1699/1619.Mean-of-Array-After-Removing-Some-Elements.md" >}})|Easy||||65.8%| +|1629|Slowest Key|[Go]({{< relref "/ChapterFour/1600~1699/1629.Slowest-Key.md" >}})|Easy||||59.2%| +|1631|Path With Minimum Effort|[Go]({{< relref "/ChapterFour/1600~1699/1631.Path-With-Minimum-Effort.md" >}})|Medium||||55.7%| +|1636|Sort Array by Increasing Frequency|[Go]({{< relref "/ChapterFour/1600~1699/1636.Sort-Array-by-Increasing-Frequency.md" >}})|Easy||||69.5%| +|1640|Check Array Formation Through Concatenation|[Go]({{< relref "/ChapterFour/1600~1699/1640.Check-Array-Formation-Through-Concatenation.md" >}})|Easy||||56.2%| +|1642|Furthest Building You Can Reach|[Go]({{< relref "/ChapterFour/1600~1699/1642.Furthest-Building-You-Can-Reach.md" >}})|Medium||||48.3%| +|1646|Get Maximum in Generated Array|[Go]({{< relref "/ChapterFour/1600~1699/1646.Get-Maximum-in-Generated-Array.md" >}})|Easy||||50.2%| +|1648|Sell Diminishing-Valued Colored Balls|[Go]({{< relref "/ChapterFour/1600~1699/1648.Sell-Diminishing-Valued-Colored-Balls.md" >}})|Medium||||30.4%| +|1649|Create Sorted Array through Instructions|[Go]({{< relref "/ChapterFour/1600~1699/1649.Create-Sorted-Array-through-Instructions.md" >}})|Hard||||37.5%| +|1652|Defuse the Bomb|[Go]({{< relref "/ChapterFour/1600~1699/1652.Defuse-the-Bomb.md" >}})|Easy||||62.4%| +|1654|Minimum Jumps to Reach Home|[Go]({{< relref "/ChapterFour/1600~1699/1654.Minimum-Jumps-to-Reach-Home.md" >}})|Medium||||29.1%| +|1655|Distribute Repeating Integers|[Go]({{< relref "/ChapterFour/1600~1699/1655.Distribute-Repeating-Integers.md" >}})|Hard||||39.3%| +|1656|Design an Ordered Stream|[Go]({{< relref "/ChapterFour/1600~1699/1656.Design-an-Ordered-Stream.md" >}})|Easy||||85.2%| +|1658|Minimum Operations to Reduce X to Zero|[Go]({{< relref "/ChapterFour/1600~1699/1658.Minimum-Operations-to-Reduce-X-to-Zero.md" >}})|Medium||||37.6%| +|1662|Check If Two String Arrays are Equivalent|[Go]({{< relref "/ChapterFour/1600~1699/1662.Check-If-Two-String-Arrays-are-Equivalent.md" >}})|Easy||||83.5%| +|1664|Ways to Make a Fair Array|[Go]({{< relref "/ChapterFour/1600~1699/1664.Ways-to-Make-a-Fair-Array.md" >}})|Medium||||63.3%| +|1665|Minimum Initial Energy to Finish Tasks|[Go]({{< relref "/ChapterFour/1600~1699/1665.Minimum-Initial-Energy-to-Finish-Tasks.md" >}})|Hard||||56.4%| +|1670|Design Front Middle Back Queue|[Go]({{< relref "/ChapterFour/1600~1699/1670.Design-Front-Middle-Back-Queue.md" >}})|Medium||||57.2%| +|1672|Richest Customer Wealth|[Go]({{< relref "/ChapterFour/1600~1699/1672.Richest-Customer-Wealth.md" >}})|Easy||||87.9%| +|1673|Find the Most Competitive Subsequence|[Go]({{< relref "/ChapterFour/1600~1699/1673.Find-the-Most-Competitive-Subsequence.md" >}})|Medium||||49.3%| +|1674|Minimum Moves to Make Array Complementary|[Go]({{< relref "/ChapterFour/1600~1699/1674.Minimum-Moves-to-Make-Array-Complementary.md" >}})|Medium||||38.7%| +|1675|Minimize Deviation in Array|[Go]({{< relref "/ChapterFour/1600~1699/1675.Minimize-Deviation-in-Array.md" >}})|Hard||||54.6%| +|1679|Max Number of K-Sum Pairs|[Go]({{< relref "/ChapterFour/1600~1699/1679.Max-Number-of-K-Sum-Pairs.md" >}})|Medium||||57.3%| +|1681|Minimum Incompatibility|[Go]({{< relref "/ChapterFour/1600~1699/1681.Minimum-Incompatibility.md" >}})|Hard||||37.8%| +|1684|Count the Number of Consistent Strings|[Go]({{< relref "/ChapterFour/1600~1699/1684.Count-the-Number-of-Consistent-Strings.md" >}})|Easy||||82.3%| +|1685|Sum of Absolute Differences in a Sorted Array|[Go]({{< relref "/ChapterFour/1600~1699/1685.Sum-of-Absolute-Differences-in-a-Sorted-Array.md" >}})|Medium||||63.5%| +|1690|Stone Game VII|[Go]({{< relref "/ChapterFour/1600~1699/1690.Stone-Game-VII.md" >}})|Medium||||58.1%| +|1691|Maximum Height by Stacking Cuboids|[Go]({{< relref "/ChapterFour/1600~1699/1691.Maximum-Height-by-Stacking-Cuboids.md" >}})|Hard||||54.6%| +|1695|Maximum Erasure Value|[Go]({{< relref "/ChapterFour/1600~1699/1695.Maximum-Erasure-Value.md" >}})|Medium||||57.6%| +|1696|Jump Game VI|[Go]({{< relref "/ChapterFour/1600~1699/1696.Jump-Game-VI.md" >}})|Medium||||46.1%| +|1700|Number of Students Unable to Eat Lunch|[Go]({{< relref "/ChapterFour/1700~1799/1700.Number-of-Students-Unable-to-Eat-Lunch.md" >}})|Easy||||68.8%| +|1705|Maximum Number of Eaten Apples|[Go]({{< relref "/ChapterFour/1700~1799/1705.Maximum-Number-of-Eaten-Apples.md" >}})|Medium||||38.0%| +|1710|Maximum Units on a Truck|[Go]({{< relref "/ChapterFour/1700~1799/1710.Maximum-Units-on-a-Truck.md" >}})|Easy||||73.8%| +|1720|Decode XORed Array|[Go]({{< relref "/ChapterFour/1700~1799/1720.Decode-XORed-Array.md" >}})|Easy||||85.8%| +|1725|Number Of Rectangles That Can Form The Largest Square|[Go]({{< relref "/ChapterFour/1700~1799/1725.Number-Of-Rectangles-That-Can-Form-The-Largest-Square.md" >}})|Easy||||78.6%| |1732|Find the Highest Altitude|[Go]({{< relref "/ChapterFour/1700~1799/1732.Find-the-Highest-Altitude.md" >}})|Easy||||78.9%| -|1734|Decode XORed Permutation|[Go]({{< relref "/ChapterFour/1700~1799/1734.Decode-XORed-Permutation.md" >}})|Medium||||60.8%| -|1738|Find Kth Largest XOR Coordinate Value|[Go]({{< relref "/ChapterFour/1700~1799/1738.Find-Kth-Largest-XOR-Coordinate-Value.md" >}})|Medium||||61.9%| -|1744|Can You Eat Your Favorite Candy on Your Favorite Day?|[Go]({{< relref "/ChapterFour/1700~1799/1744.Can-You-Eat-Your-Favorite-Candy-on-Your-Favorite-Day.md" >}})|Medium||||32.3%| -|1748|Sum of Unique Elements|[Go]({{< relref "/ChapterFour/1700~1799/1748.Sum-of-Unique-Elements.md" >}})|Easy||||75.6%| -|1752|Check if Array Is Sorted and Rotated|[Go]({{< relref "/ChapterFour/1700~1799/1752.Check-if-Array-Is-Sorted-and-Rotated.md" >}})|Easy||||47.9%| -|1816|Truncate Sentence|[Go]({{< relref "/ChapterFour/1800~1899/1816.Truncate-Sentence.md" >}})|Easy||||81.3%| -|1818|Minimum Absolute Sum Difference|[Go]({{< relref "/ChapterFour/1800~1899/1818.Minimum-Absolute-Sum-Difference.md" >}})|Medium||||29.4%| -|1846|Maximum Element After Decreasing and Rearranging|[Go]({{< relref "/ChapterFour/1800~1899/1846.Maximum-Element-After-Decreasing-and-Rearranging.md" >}})|Medium||||57.9%| -|1877|Minimize Maximum Pair Sum in Array|[Go]({{< relref "/ChapterFour/1800~1899/1877.Minimize-Maximum-Pair-Sum-in-Array.md" >}})|Medium||||80.7%| -|1984|Minimum Difference Between Highest and Lowest of K Scores|[Go]({{< relref "/ChapterFour/1900~1999/1984.Minimum-Difference-Between-Highest-and-Lowest-of-K-Scores.md" >}})|Easy||||53.5%| -|2022|Convert 1D Array Into 2D Array|[Go]({{< relref "/ChapterFour/2000~2099/2022.Convert-1D-Array-Into-2D-Array.md" >}})|Easy||||59.0%| -|2164|Sort Even and Odd Indices Independently|[Go]({{< relref "/ChapterFour/2100~2199/2164.Sort-Even-and-Odd-Indices-Independently.md" >}})|Easy||||67.5%| -|2166|Design Bitset|[Go]({{< relref "/ChapterFour/2100~2199/2166.Design-Bitset.md" >}})|Medium||||29.7%| -|2170|Minimum Operations to Make the Array Alternating|[Go]({{< relref "/ChapterFour/2100~2199/2170.Minimum-Operations-to-Make-the-Array-Alternating.md" >}})|Medium||||32.8%| -|2171|Removing Minimum Number of Magic Beans|[Go]({{< relref "/ChapterFour/2100~2199/2171.Removing-Minimum-Number-of-Magic-Beans.md" >}})|Medium||||41.1%| -|2183|Count Array Pairs Divisible by K|[Go]({{< relref "/ChapterFour/2100~2199/2183.Count-Array-Pairs-Divisible-by-K.md" >}})|Hard||||26.9%| +|1734|Decode XORed Permutation|[Go]({{< relref "/ChapterFour/1700~1799/1734.Decode-XORed-Permutation.md" >}})|Medium||||63.0%| +|1738|Find Kth Largest XOR Coordinate Value|[Go]({{< relref "/ChapterFour/1700~1799/1738.Find-Kth-Largest-XOR-Coordinate-Value.md" >}})|Medium||||61.0%| +|1744|Can You Eat Your Favorite Candy on Your Favorite Day?|[Go]({{< relref "/ChapterFour/1700~1799/1744.Can-You-Eat-Your-Favorite-Candy-on-Your-Favorite-Day.md" >}})|Medium||||33.1%| +|1748|Sum of Unique Elements|[Go]({{< relref "/ChapterFour/1700~1799/1748.Sum-of-Unique-Elements.md" >}})|Easy||||76.3%| +|1752|Check if Array Is Sorted and Rotated|[Go]({{< relref "/ChapterFour/1700~1799/1752.Check-if-Array-Is-Sorted-and-Rotated.md" >}})|Easy||||50.1%| +|1816|Truncate Sentence|[Go]({{< relref "/ChapterFour/1800~1899/1816.Truncate-Sentence.md" >}})|Easy||||83.1%| +|1818|Minimum Absolute Sum Difference|[Go]({{< relref "/ChapterFour/1800~1899/1818.Minimum-Absolute-Sum-Difference.md" >}})|Medium||||30.4%| +|1846|Maximum Element After Decreasing and Rearranging|[Go]({{< relref "/ChapterFour/1800~1899/1846.Maximum-Element-After-Decreasing-and-Rearranging.md" >}})|Medium||||58.9%| +|1877|Minimize Maximum Pair Sum in Array|[Go]({{< relref "/ChapterFour/1800~1899/1877.Minimize-Maximum-Pair-Sum-in-Array.md" >}})|Medium||||79.9%| +|1984|Minimum Difference Between Highest and Lowest of K Scores|[Go]({{< relref "/ChapterFour/1900~1999/1984.Minimum-Difference-Between-Highest-and-Lowest-of-K-Scores.md" >}})|Easy||||54.5%| +|2021|Brightest Position on Street|[Go]({{< relref "/ChapterFour/2000~2099/2021.Brightest-Position-on-Street.md" >}})|Medium||||62.1%| +|2022|Convert 1D Array Into 2D Array|[Go]({{< relref "/ChapterFour/2000~2099/2022.Convert-1D-Array-Into-2D-Array.md" >}})|Easy||||59.1%| +|2037|Minimum Number of Moves to Seat Everyone|[Go]({{< relref "/ChapterFour/2000~2099/2037.Minimum-Number-of-Moves-to-Seat-Everyone.md" >}})|Easy||||82.1%| +|2043|Simple Bank System|[Go]({{< relref "/ChapterFour/2000~2099/2043.Simple-Bank-System.md" >}})|Medium||||65.2%| +|2164|Sort Even and Odd Indices Independently|[Go]({{< relref "/ChapterFour/2100~2199/2164.Sort-Even-and-Odd-Indices-Independently.md" >}})|Easy||||64.9%| +|2166|Design Bitset|[Go]({{< relref "/ChapterFour/2100~2199/2166.Design-Bitset.md" >}})|Medium||||31.8%| +|2170|Minimum Operations to Make the Array Alternating|[Go]({{< relref "/ChapterFour/2100~2199/2170.Minimum-Operations-to-Make-the-Array-Alternating.md" >}})|Medium||||33.2%| +|2171|Removing Minimum Number of Magic Beans|[Go]({{< relref "/ChapterFour/2100~2199/2171.Removing-Minimum-Number-of-Magic-Beans.md" >}})|Medium||||42.1%| +|2183|Count Array Pairs Divisible by K|[Go]({{< relref "/ChapterFour/2100~2199/2183.Count-Array-Pairs-Divisible-by-K.md" >}})|Hard||||28.3%| |------------|-------------------------------------------------------|-------| ----------------| ---------------|-------------|-------------|-------------| diff --git a/website/content/ChapterTwo/Backtracking.md b/website/content/ChapterTwo/Backtracking.md index f8c8ffa4b..fd1b61831 100644 --- a/website/content/ChapterTwo/Backtracking.md +++ b/website/content/ChapterTwo/Backtracking.md @@ -100,45 +100,45 @@ func updateMatrix_BFS(matrix [][]int) [][]int { | No. | Title | Solution | Difficulty | TimeComplexity | SpaceComplexity |Favorite| Acceptance | |:--------:|:------- | :--------: | :----------: | :----: | :-----: | :-----: |:-----: | -|0017|Letter Combinations of a Phone Number|[Go]({{< relref "/ChapterFour/0001~0099/0017.Letter-Combinations-of-a-Phone-Number.md" >}})|Medium| O(log n)| O(1)||53.6%| -|0022|Generate Parentheses|[Go]({{< relref "/ChapterFour/0001~0099/0022.Generate-Parentheses.md" >}})|Medium| O(log n)| O(1)||70.1%| -|0037|Sudoku Solver|[Go]({{< relref "/ChapterFour/0001~0099/0037.Sudoku-Solver.md" >}})|Hard| O(n^2)| O(n^2)|❤️|54.0%| -|0039|Combination Sum|[Go]({{< relref "/ChapterFour/0001~0099/0039.Combination-Sum.md" >}})|Medium| O(n log n)| O(n)||65.5%| -|0040|Combination Sum II|[Go]({{< relref "/ChapterFour/0001~0099/0040.Combination-Sum-II.md" >}})|Medium| O(n log n)| O(n)||52.4%| -|0046|Permutations|[Go]({{< relref "/ChapterFour/0001~0099/0046.Permutations.md" >}})|Medium| O(n)| O(n)|❤️|72.3%| -|0047|Permutations II|[Go]({{< relref "/ChapterFour/0001~0099/0047.Permutations-II.md" >}})|Medium| O(n^2)| O(n)|❤️|54.1%| -|0051|N-Queens|[Go]({{< relref "/ChapterFour/0001~0099/0051.N-Queens.md" >}})|Hard| O(n!)| O(n)|❤️|57.5%| -|0052|N-Queens II|[Go]({{< relref "/ChapterFour/0001~0099/0052.N-Queens-II.md" >}})|Hard| O(n!)| O(n)|❤️|66.3%| -|0077|Combinations|[Go]({{< relref "/ChapterFour/0001~0099/0077.Combinations.md" >}})|Medium| O(n)| O(n)|❤️|64.0%| -|0078|Subsets|[Go]({{< relref "/ChapterFour/0001~0099/0078.Subsets.md" >}})|Medium| O(n^2)| O(n)|❤️|71.5%| -|0079|Word Search|[Go]({{< relref "/ChapterFour/0001~0099/0079.Word-Search.md" >}})|Medium| O(n^2)| O(n^2)|❤️|39.7%| -|0089|Gray Code|[Go]({{< relref "/ChapterFour/0001~0099/0089.Gray-Code.md" >}})|Medium| O(n)| O(1)||55.3%| -|0090|Subsets II|[Go]({{< relref "/ChapterFour/0001~0099/0090.Subsets-II.md" >}})|Medium| O(n^2)| O(n)|❤️|53.3%| -|0093|Restore IP Addresses|[Go]({{< relref "/ChapterFour/0001~0099/0093.Restore-IP-Addresses.md" >}})|Medium| O(n)| O(n)|❤️|41.9%| -|0095|Unique Binary Search Trees II|[Go]({{< relref "/ChapterFour/0001~0099/0095.Unique-Binary-Search-Trees-II.md" >}})|Medium||||49.5%| -|0113|Path Sum II|[Go]({{< relref "/ChapterFour/0100~0199/0113.Path-Sum-II.md" >}})|Medium||||54.0%| -|0126|Word Ladder II|[Go]({{< relref "/ChapterFour/0100~0199/0126.Word-Ladder-II.md" >}})|Hard| O(n)| O(n^2)|❤️|27.0%| -|0131|Palindrome Partitioning|[Go]({{< relref "/ChapterFour/0100~0199/0131.Palindrome-Partitioning.md" >}})|Medium| O(n)| O(n^2)|❤️|59.5%| -|0212|Word Search II|[Go]({{< relref "/ChapterFour/0200~0299/0212.Word-Search-II.md" >}})|Hard| O(n^2)| O(n^2)|❤️|38.0%| -|0216|Combination Sum III|[Go]({{< relref "/ChapterFour/0200~0299/0216.Combination-Sum-III.md" >}})|Medium| O(n)| O(1)|❤️|64.0%| -|0257|Binary Tree Paths|[Go]({{< relref "/ChapterFour/0200~0299/0257.Binary-Tree-Paths.md" >}})|Easy||||58.7%| -|0301|Remove Invalid Parentheses|[Go]({{< relref "/ChapterFour/0300~0399/0301.Remove-Invalid-Parentheses.md" >}})|Hard||||46.9%| -|0306|Additive Number|[Go]({{< relref "/ChapterFour/0300~0399/0306.Additive-Number.md" >}})|Medium| O(n^2)| O(1)|❤️|30.6%| -|0357|Count Numbers with Unique Digits|[Go]({{< relref "/ChapterFour/0300~0399/0357.Count-Numbers-with-Unique-Digits.md" >}})|Medium| O(1)| O(1)||50.6%| -|0401|Binary Watch|[Go]({{< relref "/ChapterFour/0400~0499/0401.Binary-Watch.md" >}})|Easy| O(1)| O(1)||50.5%| -|0473|Matchsticks to Square|[Go]({{< relref "/ChapterFour/0400~0499/0473.Matchsticks-to-Square.md" >}})|Medium||||40.3%| -|0491|Increasing Subsequences|[Go]({{< relref "/ChapterFour/0400~0499/0491.Increasing-Subsequences.md" >}})|Medium||||50.9%| -|0494|Target Sum|[Go]({{< relref "/ChapterFour/0400~0499/0494.Target-Sum.md" >}})|Medium||||45.4%| -|0526|Beautiful Arrangement|[Go]({{< relref "/ChapterFour/0500~0599/0526.Beautiful-Arrangement.md" >}})|Medium| O(n^2)| O(1)|❤️|64.3%| -|0638|Shopping Offers|[Go]({{< relref "/ChapterFour/0600~0699/0638.Shopping-Offers.md" >}})|Medium||||54.6%| -|0784|Letter Case Permutation|[Go]({{< relref "/ChapterFour/0700~0799/0784.Letter-Case-Permutation.md" >}})|Medium| O(n)| O(n)||72.4%| -|0816|Ambiguous Coordinates|[Go]({{< relref "/ChapterFour/0800~0899/0816.Ambiguous-Coordinates.md" >}})|Medium||||55.9%| -|0842|Split Array into Fibonacci Sequence|[Go]({{< relref "/ChapterFour/0800~0899/0842.Split-Array-into-Fibonacci-Sequence.md" >}})|Medium| O(n^2)| O(1)|❤️|37.8%| -|0980|Unique Paths III|[Go]({{< relref "/ChapterFour/0900~0999/0980.Unique-Paths-III.md" >}})|Hard| O(n log n)| O(n)||79.4%| -|0996|Number of Squareful Arrays|[Go]({{< relref "/ChapterFour/0900~0999/0996.Number-of-Squareful-Arrays.md" >}})|Hard| O(n log n)| O(n) ||49.1%| -|1079|Letter Tile Possibilities|[Go]({{< relref "/ChapterFour/1000~1099/1079.Letter-Tile-Possibilities.md" >}})|Medium| O(n^2)| O(1)|❤️|76.1%| -|1239|Maximum Length of a Concatenated String with Unique Characters|[Go]({{< relref "/ChapterFour/1200~1299/1239.Maximum-Length-of-a-Concatenated-String-with-Unique-Characters.md" >}})|Medium||||50.5%| -|1655|Distribute Repeating Integers|[Go]({{< relref "/ChapterFour/1600~1699/1655.Distribute-Repeating-Integers.md" >}})|Hard||||40.3%| +|0017|Letter Combinations of a Phone Number|[Go]({{< relref "/ChapterFour/0001~0099/0017.Letter-Combinations-of-a-Phone-Number.md" >}})|Medium| O(log n)| O(1)||56.6%| +|0022|Generate Parentheses|[Go]({{< relref "/ChapterFour/0001~0099/0022.Generate-Parentheses.md" >}})|Medium| O(log n)| O(1)||72.5%| +|0037|Sudoku Solver|[Go]({{< relref "/ChapterFour/0001~0099/0037.Sudoku-Solver.md" >}})|Hard| O(n^2)| O(n^2)|❤️|57.7%| +|0039|Combination Sum|[Go]({{< relref "/ChapterFour/0001~0099/0039.Combination-Sum.md" >}})|Medium| O(n log n)| O(n)||68.6%| +|0040|Combination Sum II|[Go]({{< relref "/ChapterFour/0001~0099/0040.Combination-Sum-II.md" >}})|Medium| O(n log n)| O(n)||53.4%| +|0046|Permutations|[Go]({{< relref "/ChapterFour/0001~0099/0046.Permutations.md" >}})|Medium| O(n)| O(n)|❤️|75.7%| +|0047|Permutations II|[Go]({{< relref "/ChapterFour/0001~0099/0047.Permutations-II.md" >}})|Medium| O(n^2)| O(n)|❤️|57.4%| +|0051|N-Queens|[Go]({{< relref "/ChapterFour/0001~0099/0051.N-Queens.md" >}})|Hard| O(n!)| O(n)|❤️|64.2%| +|0052|N-Queens II|[Go]({{< relref "/ChapterFour/0001~0099/0052.N-Queens-II.md" >}})|Hard| O(n!)| O(n)|❤️|71.6%| +|0077|Combinations|[Go]({{< relref "/ChapterFour/0001~0099/0077.Combinations.md" >}})|Medium| O(n)| O(n)|❤️|67.0%| +|0078|Subsets|[Go]({{< relref "/ChapterFour/0001~0099/0078.Subsets.md" >}})|Medium| O(n^2)| O(n)|❤️|74.9%| +|0079|Word Search|[Go]({{< relref "/ChapterFour/0001~0099/0079.Word-Search.md" >}})|Medium| O(n^2)| O(n^2)|❤️|40.2%| +|0089|Gray Code|[Go]({{< relref "/ChapterFour/0001~0099/0089.Gray-Code.md" >}})|Medium| O(n)| O(1)||57.2%| +|0090|Subsets II|[Go]({{< relref "/ChapterFour/0001~0099/0090.Subsets-II.md" >}})|Medium| O(n^2)| O(n)|❤️|55.9%| +|0093|Restore IP Addresses|[Go]({{< relref "/ChapterFour/0001~0099/0093.Restore-IP-Addresses.md" >}})|Medium| O(n)| O(n)|❤️|47.4%| +|0095|Unique Binary Search Trees II|[Go]({{< relref "/ChapterFour/0001~0099/0095.Unique-Binary-Search-Trees-II.md" >}})|Medium||||52.4%| +|0113|Path Sum II|[Go]({{< relref "/ChapterFour/0100~0199/0113.Path-Sum-II.md" >}})|Medium||||57.1%| +|0126|Word Ladder II|[Go]({{< relref "/ChapterFour/0100~0199/0126.Word-Ladder-II.md" >}})|Hard| O(n)| O(n^2)|❤️|27.5%| +|0131|Palindrome Partitioning|[Go]({{< relref "/ChapterFour/0100~0199/0131.Palindrome-Partitioning.md" >}})|Medium| O(n)| O(n^2)|❤️|64.9%| +|0212|Word Search II|[Go]({{< relref "/ChapterFour/0200~0299/0212.Word-Search-II.md" >}})|Hard| O(n^2)| O(n^2)|❤️|36.4%| +|0216|Combination Sum III|[Go]({{< relref "/ChapterFour/0200~0299/0216.Combination-Sum-III.md" >}})|Medium| O(n)| O(1)|❤️|67.6%| +|0257|Binary Tree Paths|[Go]({{< relref "/ChapterFour/0200~0299/0257.Binary-Tree-Paths.md" >}})|Easy||||61.4%| +|0301|Remove Invalid Parentheses|[Go]({{< relref "/ChapterFour/0300~0399/0301.Remove-Invalid-Parentheses.md" >}})|Hard||||47.2%| +|0306|Additive Number|[Go]({{< relref "/ChapterFour/0300~0399/0306.Additive-Number.md" >}})|Medium| O(n^2)| O(1)|❤️|31.1%| +|0357|Count Numbers with Unique Digits|[Go]({{< relref "/ChapterFour/0300~0399/0357.Count-Numbers-with-Unique-Digits.md" >}})|Medium| O(1)| O(1)||51.9%| +|0401|Binary Watch|[Go]({{< relref "/ChapterFour/0400~0499/0401.Binary-Watch.md" >}})|Easy| O(1)| O(1)||52.3%| +|0473|Matchsticks to Square|[Go]({{< relref "/ChapterFour/0400~0499/0473.Matchsticks-to-Square.md" >}})|Medium||||40.2%| +|0491|Non-decreasing Subsequences|[Go]({{< relref "/ChapterFour/0400~0499/0491.Non-decreasing-Subsequences.md" >}})|Medium||||60.2%| +|0494|Target Sum|[Go]({{< relref "/ChapterFour/0400~0499/0494.Target-Sum.md" >}})|Medium||||45.7%| +|0526|Beautiful Arrangement|[Go]({{< relref "/ChapterFour/0500~0599/0526.Beautiful-Arrangement.md" >}})|Medium| O(n^2)| O(1)|❤️|64.4%| +|0638|Shopping Offers|[Go]({{< relref "/ChapterFour/0600~0699/0638.Shopping-Offers.md" >}})|Medium||||53.3%| +|0784|Letter Case Permutation|[Go]({{< relref "/ChapterFour/0700~0799/0784.Letter-Case-Permutation.md" >}})|Medium| O(n)| O(n)||73.8%| +|0816|Ambiguous Coordinates|[Go]({{< relref "/ChapterFour/0800~0899/0816.Ambiguous-Coordinates.md" >}})|Medium||||56.4%| +|0842|Split Array into Fibonacci Sequence|[Go]({{< relref "/ChapterFour/0800~0899/0842.Split-Array-into-Fibonacci-Sequence.md" >}})|Medium| O(n^2)| O(1)|❤️|38.4%| +|0980|Unique Paths III|[Go]({{< relref "/ChapterFour/0900~0999/0980.Unique-Paths-III.md" >}})|Hard| O(n log n)| O(n)||81.7%| +|0996|Number of Squareful Arrays|[Go]({{< relref "/ChapterFour/0900~0999/0996.Number-of-Squareful-Arrays.md" >}})|Hard| O(n log n)| O(n) ||49.2%| +|1079|Letter Tile Possibilities|[Go]({{< relref "/ChapterFour/1000~1099/1079.Letter-Tile-Possibilities.md" >}})|Medium| O(n^2)| O(1)|❤️|76.0%| +|1239|Maximum Length of a Concatenated String with Unique Characters|[Go]({{< relref "/ChapterFour/1200~1299/1239.Maximum-Length-of-a-Concatenated-String-with-Unique-Characters.md" >}})|Medium||||52.2%| +|1655|Distribute Repeating Integers|[Go]({{< relref "/ChapterFour/1600~1699/1655.Distribute-Repeating-Integers.md" >}})|Hard||||39.3%| |------------|-------------------------------------------------------|-------| ----------------| ---------------|-------------|-------------|-------------| diff --git a/website/content/ChapterTwo/Binary_Indexed_Tree.md b/website/content/ChapterTwo/Binary_Indexed_Tree.md index 3c5b4e520..6a988987e 100644 --- a/website/content/ChapterTwo/Binary_Indexed_Tree.md +++ b/website/content/ChapterTwo/Binary_Indexed_Tree.md @@ -10,13 +10,13 @@ weight: 19 | No. | Title | Solution | Difficulty | TimeComplexity | SpaceComplexity |Favorite| Acceptance | |:--------:|:------- | :--------: | :----------: | :----: | :-----: | :-----: |:-----: | -|0218|The Skyline Problem|[Go]({{< relref "/ChapterFour/0200~0299/0218.The-Skyline-Problem.md" >}})|Hard||||38.7%| -|0307|Range Sum Query - Mutable|[Go]({{< relref "/ChapterFour/0300~0399/0307.Range-Sum-Query-Mutable.md" >}})|Medium||||38.7%| -|0315|Count of Smaller Numbers After Self|[Go]({{< relref "/ChapterFour/0300~0399/0315.Count-of-Smaller-Numbers-After-Self.md" >}})|Hard||||42.0%| -|0327|Count of Range Sum|[Go]({{< relref "/ChapterFour/0300~0399/0327.Count-of-Range-Sum.md" >}})|Hard||||36.0%| -|0493|Reverse Pairs|[Go]({{< relref "/ChapterFour/0400~0499/0493.Reverse-Pairs.md" >}})|Hard||||29.9%| -|1157|Online Majority Element In Subarray|[Go]({{< relref "/ChapterFour/1100~1199/1157.Online-Majority-Element-In-Subarray.md" >}})|Hard||||42.1%| -|1649|Create Sorted Array through Instructions|[Go]({{< relref "/ChapterFour/1600~1699/1649.Create-Sorted-Array-through-Instructions.md" >}})|Hard||||37.2%| +|0218|The Skyline Problem|[Go]({{< relref "/ChapterFour/0200~0299/0218.The-Skyline-Problem.md" >}})|Hard||||41.9%| +|0307|Range Sum Query - Mutable|[Go]({{< relref "/ChapterFour/0300~0399/0307.Range-Sum-Query-Mutable.md" >}})|Medium||||40.7%| +|0315|Count of Smaller Numbers After Self|[Go]({{< relref "/ChapterFour/0300~0399/0315.Count-of-Smaller-Numbers-After-Self.md" >}})|Hard||||42.6%| +|0327|Count of Range Sum|[Go]({{< relref "/ChapterFour/0300~0399/0327.Count-of-Range-Sum.md" >}})|Hard||||35.8%| +|0493|Reverse Pairs|[Go]({{< relref "/ChapterFour/0400~0499/0493.Reverse-Pairs.md" >}})|Hard||||30.9%| +|1157|Online Majority Element In Subarray|[Go]({{< relref "/ChapterFour/1100~1199/1157.Online-Majority-Element-In-Subarray.md" >}})|Hard||||41.8%| +|1649|Create Sorted Array through Instructions|[Go]({{< relref "/ChapterFour/1600~1699/1649.Create-Sorted-Array-through-Instructions.md" >}})|Hard||||37.5%| |------------|-------------------------------------------------------|-------| ----------------| ---------------|-------------|-------------|-------------| diff --git a/website/content/ChapterTwo/Binary_Search.md b/website/content/ChapterTwo/Binary_Search.md index 49ab70fcf..bbfa80272 100644 --- a/website/content/ChapterTwo/Binary_Search.md +++ b/website/content/ChapterTwo/Binary_Search.md @@ -131,87 +131,90 @@ func peakIndexInMountainArray(A []int) int { | No. | Title | Solution | Difficulty | TimeComplexity | SpaceComplexity |Favorite| Acceptance | |:--------:|:------- | :--------: | :----------: | :----: | :-----: | :-----: |:-----: | -|0004|Median of Two Sorted Arrays|[Go]({{< relref "/ChapterFour/0001~0099/0004.Median-of-Two-Sorted-Arrays.md" >}})|Hard||||34.1%| -|0033|Search in Rotated Sorted Array|[Go]({{< relref "/ChapterFour/0001~0099/0033.Search-in-Rotated-Sorted-Array.md" >}})|Medium||||37.8%| -|0034|Find First and Last Position of Element in Sorted Array|[Go]({{< relref "/ChapterFour/0001~0099/0034.Find-First-and-Last-Position-of-Element-in-Sorted-Array.md" >}})|Medium||||40.0%| -|0035|Search Insert Position|[Go]({{< relref "/ChapterFour/0001~0099/0035.Search-Insert-Position.md" >}})|Easy||||42.3%| -|0069|Sqrt(x)|[Go]({{< relref "/ChapterFour/0001~0099/0069.Sqrtx.md" >}})|Easy| O(log n)| O(1)||36.5%| -|0074|Search a 2D Matrix|[Go]({{< relref "/ChapterFour/0001~0099/0074.Search-a-2D-Matrix.md" >}})|Medium||||44.4%| -|0081|Search in Rotated Sorted Array II|[Go]({{< relref "/ChapterFour/0001~0099/0081.Search-in-Rotated-Sorted-Array-II.md" >}})|Medium||||35.6%| -|0153|Find Minimum in Rotated Sorted Array|[Go]({{< relref "/ChapterFour/0100~0199/0153.Find-Minimum-in-Rotated-Sorted-Array.md" >}})|Medium||||47.9%| -|0154|Find Minimum in Rotated Sorted Array II|[Go]({{< relref "/ChapterFour/0100~0199/0154.Find-Minimum-in-Rotated-Sorted-Array-II.md" >}})|Hard||||43.3%| +|0004|Median of Two Sorted Arrays|[Go]({{< relref "/ChapterFour/0001~0099/0004.Median-of-Two-Sorted-Arrays.md" >}})|Hard||||36.2%| +|0033|Search in Rotated Sorted Array|[Go]({{< relref "/ChapterFour/0001~0099/0033.Search-in-Rotated-Sorted-Array.md" >}})|Medium||||39.0%| +|0034|Find First and Last Position of Element in Sorted Array|[Go]({{< relref "/ChapterFour/0001~0099/0034.Find-First-and-Last-Position-of-Element-in-Sorted-Array.md" >}})|Medium||||41.9%| +|0035|Search Insert Position|[Go]({{< relref "/ChapterFour/0001~0099/0035.Search-Insert-Position.md" >}})|Easy||||43.4%| +|0069|Sqrt(x)|[Go]({{< relref "/ChapterFour/0001~0099/0069.Sqrtx.md" >}})|Easy| O(log n)| O(1)||37.4%| +|0074|Search a 2D Matrix|[Go]({{< relref "/ChapterFour/0001~0099/0074.Search-a-2D-Matrix.md" >}})|Medium||||47.7%| +|0081|Search in Rotated Sorted Array II|[Go]({{< relref "/ChapterFour/0001~0099/0081.Search-in-Rotated-Sorted-Array-II.md" >}})|Medium||||35.7%| +|0153|Find Minimum in Rotated Sorted Array|[Go]({{< relref "/ChapterFour/0100~0199/0153.Find-Minimum-in-Rotated-Sorted-Array.md" >}})|Medium||||48.9%| +|0154|Find Minimum in Rotated Sorted Array II|[Go]({{< relref "/ChapterFour/0100~0199/0154.Find-Minimum-in-Rotated-Sorted-Array-II.md" >}})|Hard||||43.5%| |0162|Find Peak Element|[Go]({{< relref "/ChapterFour/0100~0199/0162.Find-Peak-Element.md" >}})|Medium||||46.0%| -|0167|Two Sum II - Input Array Is Sorted|[Go]({{< relref "/ChapterFour/0100~0199/0167.Two-Sum-II-Input-Array-Is-Sorted.md" >}})|Medium| O(n)| O(1)||58.7%| -|0209|Minimum Size Subarray Sum|[Go]({{< relref "/ChapterFour/0200~0299/0209.Minimum-Size-Subarray-Sum.md" >}})|Medium| O(n)| O(1)||43.3%| -|0222|Count Complete Tree Nodes|[Go]({{< relref "/ChapterFour/0200~0299/0222.Count-Complete-Tree-Nodes.md" >}})|Medium| O(n)| O(1)||55.3%| -|0240|Search a 2D Matrix II|[Go]({{< relref "/ChapterFour/0200~0299/0240.Search-a-2D-Matrix-II.md" >}})|Medium||||48.4%| -|0275|H-Index II|[Go]({{< relref "/ChapterFour/0200~0299/0275.H-Index-II.md" >}})|Medium||||37.0%| -|0278|First Bad Version|[Go]({{< relref "/ChapterFour/0200~0299/0278.First-Bad-Version.md" >}})|Easy||||41.7%| -|0287|Find the Duplicate Number|[Go]({{< relref "/ChapterFour/0200~0299/0287.Find-the-Duplicate-Number.md" >}})|Medium| O(n)| O(1)|❤️|58.8%| -|0300|Longest Increasing Subsequence|[Go]({{< relref "/ChapterFour/0300~0399/0300.Longest-Increasing-Subsequence.md" >}})|Medium| O(n log n)| O(n)||49.3%| -|0315|Count of Smaller Numbers After Self|[Go]({{< relref "/ChapterFour/0300~0399/0315.Count-of-Smaller-Numbers-After-Self.md" >}})|Hard||||42.0%| -|0327|Count of Range Sum|[Go]({{< relref "/ChapterFour/0300~0399/0327.Count-of-Range-Sum.md" >}})|Hard||||36.0%| -|0349|Intersection of Two Arrays|[Go]({{< relref "/ChapterFour/0300~0399/0349.Intersection-of-Two-Arrays.md" >}})|Easy| O(n)| O(n) ||69.1%| -|0350|Intersection of Two Arrays II|[Go]({{< relref "/ChapterFour/0300~0399/0350.Intersection-of-Two-Arrays-II.md" >}})|Easy| O(n)| O(n) ||54.9%| -|0352|Data Stream as Disjoint Intervals|[Go]({{< relref "/ChapterFour/0300~0399/0352.Data-Stream-as-Disjoint-Intervals.md" >}})|Hard||||50.7%| -|0354|Russian Doll Envelopes|[Go]({{< relref "/ChapterFour/0300~0399/0354.Russian-Doll-Envelopes.md" >}})|Hard||||38.9%| -|0367|Valid Perfect Square|[Go]({{< relref "/ChapterFour/0300~0399/0367.Valid-Perfect-Square.md" >}})|Easy||||43.0%| -|0374|Guess Number Higher or Lower|[Go]({{< relref "/ChapterFour/0300~0399/0374.Guess-Number-Higher-or-Lower.md" >}})|Easy||||49.2%| -|0378|Kth Smallest Element in a Sorted Matrix|[Go]({{< relref "/ChapterFour/0300~0399/0378.Kth-Smallest-Element-in-a-Sorted-Matrix.md" >}})|Medium||||59.7%| -|0400|Nth Digit|[Go]({{< relref "/ChapterFour/0400~0499/0400.Nth-Digit.md" >}})|Medium||||33.5%| -|0410|Split Array Largest Sum|[Go]({{< relref "/ChapterFour/0400~0499/0410.Split-Array-Largest-Sum.md" >}})|Hard||||52.1%| -|0436|Find Right Interval|[Go]({{< relref "/ChapterFour/0400~0499/0436.Find-Right-Interval.md" >}})|Medium||||49.5%| -|0441|Arranging Coins|[Go]({{< relref "/ChapterFour/0400~0499/0441.Arranging-Coins.md" >}})|Easy||||45.4%| -|0456|132 Pattern|[Go]({{< relref "/ChapterFour/0400~0499/0456.132-Pattern.md" >}})|Medium||||30.9%| -|0475|Heaters|[Go]({{< relref "/ChapterFour/0400~0499/0475.Heaters.md" >}})|Medium||||35.3%| -|0483|Smallest Good Base|[Go]({{< relref "/ChapterFour/0400~0499/0483.Smallest-Good-Base.md" >}})|Hard||||37.8%| -|0493|Reverse Pairs|[Go]({{< relref "/ChapterFour/0400~0499/0493.Reverse-Pairs.md" >}})|Hard||||29.9%| -|0497|Random Point in Non-overlapping Rectangles|[Go]({{< relref "/ChapterFour/0400~0499/0497.Random-Point-in-Non-overlapping-Rectangles.md" >}})|Medium||||39.1%| +|0167|Two Sum II - Input Array Is Sorted|[Go]({{< relref "/ChapterFour/0100~0199/0167.Two-Sum-II-Input-Array-Is-Sorted.md" >}})|Medium| O(n)| O(1)||60.0%| +|0209|Minimum Size Subarray Sum|[Go]({{< relref "/ChapterFour/0200~0299/0209.Minimum-Size-Subarray-Sum.md" >}})|Medium| O(n)| O(1)||45.0%| +|0222|Count Complete Tree Nodes|[Go]({{< relref "/ChapterFour/0200~0299/0222.Count-Complete-Tree-Nodes.md" >}})|Medium| O(n)| O(1)||60.6%| +|0240|Search a 2D Matrix II|[Go]({{< relref "/ChapterFour/0200~0299/0240.Search-a-2D-Matrix-II.md" >}})|Medium||||51.0%| +|0268|Missing Number|[Go]({{< relref "/ChapterFour/0200~0299/0268.Missing-Number.md" >}})|Easy||||62.6%| +|0275|H-Index II|[Go]({{< relref "/ChapterFour/0200~0299/0275.H-Index-II.md" >}})|Medium||||37.5%| +|0278|First Bad Version|[Go]({{< relref "/ChapterFour/0200~0299/0278.First-Bad-Version.md" >}})|Easy||||43.3%| +|0287|Find the Duplicate Number|[Go]({{< relref "/ChapterFour/0200~0299/0287.Find-the-Duplicate-Number.md" >}})|Medium| O(n)| O(1)|❤️|59.1%| +|0300|Longest Increasing Subsequence|[Go]({{< relref "/ChapterFour/0300~0399/0300.Longest-Increasing-Subsequence.md" >}})|Medium| O(n log n)| O(n)||52.2%| +|0315|Count of Smaller Numbers After Self|[Go]({{< relref "/ChapterFour/0300~0399/0315.Count-of-Smaller-Numbers-After-Self.md" >}})|Hard||||42.6%| +|0327|Count of Range Sum|[Go]({{< relref "/ChapterFour/0300~0399/0327.Count-of-Range-Sum.md" >}})|Hard||||35.8%| +|0349|Intersection of Two Arrays|[Go]({{< relref "/ChapterFour/0300~0399/0349.Intersection-of-Two-Arrays.md" >}})|Easy| O(n)| O(n) ||70.9%| +|0350|Intersection of Two Arrays II|[Go]({{< relref "/ChapterFour/0300~0399/0350.Intersection-of-Two-Arrays-II.md" >}})|Easy| O(n)| O(n) ||56.0%| +|0352|Data Stream as Disjoint Intervals|[Go]({{< relref "/ChapterFour/0300~0399/0352.Data-Stream-as-Disjoint-Intervals.md" >}})|Hard||||59.7%| +|0354|Russian Doll Envelopes|[Go]({{< relref "/ChapterFour/0300~0399/0354.Russian-Doll-Envelopes.md" >}})|Hard||||37.9%| +|0367|Valid Perfect Square|[Go]({{< relref "/ChapterFour/0300~0399/0367.Valid-Perfect-Square.md" >}})|Easy||||43.3%| +|0374|Guess Number Higher or Lower|[Go]({{< relref "/ChapterFour/0300~0399/0374.Guess-Number-Higher-or-Lower.md" >}})|Easy||||51.9%| +|0378|Kth Smallest Element in a Sorted Matrix|[Go]({{< relref "/ChapterFour/0300~0399/0378.Kth-Smallest-Element-in-a-Sorted-Matrix.md" >}})|Medium||||61.8%| +|0400|Nth Digit|[Go]({{< relref "/ChapterFour/0400~0499/0400.Nth-Digit.md" >}})|Medium||||34.1%| +|0410|Split Array Largest Sum|[Go]({{< relref "/ChapterFour/0400~0499/0410.Split-Array-Largest-Sum.md" >}})|Hard||||53.5%| +|0436|Find Right Interval|[Go]({{< relref "/ChapterFour/0400~0499/0436.Find-Right-Interval.md" >}})|Medium||||50.8%| +|0441|Arranging Coins|[Go]({{< relref "/ChapterFour/0400~0499/0441.Arranging-Coins.md" >}})|Easy||||46.2%| +|0456|132 Pattern|[Go]({{< relref "/ChapterFour/0400~0499/0456.132-Pattern.md" >}})|Medium||||32.4%| +|0475|Heaters|[Go]({{< relref "/ChapterFour/0400~0499/0475.Heaters.md" >}})|Medium||||36.5%| +|0483|Smallest Good Base|[Go]({{< relref "/ChapterFour/0400~0499/0483.Smallest-Good-Base.md" >}})|Hard||||38.8%| +|0493|Reverse Pairs|[Go]({{< relref "/ChapterFour/0400~0499/0493.Reverse-Pairs.md" >}})|Hard||||30.9%| +|0497|Random Point in Non-overlapping Rectangles|[Go]({{< relref "/ChapterFour/0400~0499/0497.Random-Point-in-Non-overlapping-Rectangles.md" >}})|Medium||||39.4%| |0528|Random Pick with Weight|[Go]({{< relref "/ChapterFour/0500~0599/0528.Random-Pick-with-Weight.md" >}})|Medium||||46.1%| -|0532|K-diff Pairs in an Array|[Go]({{< relref "/ChapterFour/0500~0599/0532.K-diff-Pairs-in-an-Array.md" >}})|Medium||||40.1%| -|0540|Single Element in a Sorted Array|[Go]({{< relref "/ChapterFour/0500~0599/0540.Single-Element-in-a-Sorted-Array.md" >}})|Medium||||58.7%| -|0611|Valid Triangle Number|[Go]({{< relref "/ChapterFour/0600~0699/0611.Valid-Triangle-Number.md" >}})|Medium||||49.8%| -|0633|Sum of Square Numbers|[Go]({{< relref "/ChapterFour/0600~0699/0633.Sum-of-Square-Numbers.md" >}})|Medium||||34.7%| -|0658|Find K Closest Elements|[Go]({{< relref "/ChapterFour/0600~0699/0658.Find-K-Closest-Elements.md" >}})|Medium||||44.5%| -|0668|Kth Smallest Number in Multiplication Table|[Go]({{< relref "/ChapterFour/0600~0699/0668.Kth-Smallest-Number-in-Multiplication-Table.md" >}})|Hard||||51.1%| -|0704|Binary Search|[Go]({{< relref "/ChapterFour/0700~0799/0704.Binary-Search.md" >}})|Easy||||55.3%| -|0710|Random Pick with Blacklist|[Go]({{< relref "/ChapterFour/0700~0799/0710.Random-Pick-with-Blacklist.md" >}})|Hard| O(n)| O(n) ||33.2%| -|0718|Maximum Length of Repeated Subarray|[Go]({{< relref "/ChapterFour/0700~0799/0718.Maximum-Length-of-Repeated-Subarray.md" >}})|Medium||||51.4%| -|0719|Find K-th Smallest Pair Distance|[Go]({{< relref "/ChapterFour/0700~0799/0719.Find-K-th-Smallest-Pair-Distance.md" >}})|Hard||||35.1%| -|0744|Find Smallest Letter Greater Than Target|[Go]({{< relref "/ChapterFour/0700~0799/0744.Find-Smallest-Letter-Greater-Than-Target.md" >}})|Easy||||45.1%| -|0778|Swim in Rising Water|[Go]({{< relref "/ChapterFour/0700~0799/0778.Swim-in-Rising-Water.md" >}})|Hard||||58.7%| -|0786|K-th Smallest Prime Fraction|[Go]({{< relref "/ChapterFour/0700~0799/0786.K-th-Smallest-Prime-Fraction.md" >}})|Hard||||48.6%| -|0793|Preimage Size of Factorial Zeroes Function|[Go]({{< relref "/ChapterFour/0700~0799/0793.Preimage-Size-of-Factorial-Zeroes-Function.md" >}})|Hard||||41.8%| -|0825|Friends Of Appropriate Ages|[Go]({{< relref "/ChapterFour/0800~0899/0825.Friends-Of-Appropriate-Ages.md" >}})|Medium||||46.0%| -|0826|Most Profit Assigning Work|[Go]({{< relref "/ChapterFour/0800~0899/0826.Most-Profit-Assigning-Work.md" >}})|Medium||||42.1%| -|0852|Peak Index in a Mountain Array|[Go]({{< relref "/ChapterFour/0800~0899/0852.Peak-Index-in-a-Mountain-Array.md" >}})|Easy||||70.4%| -|0862|Shortest Subarray with Sum at Least K|[Go]({{< relref "/ChapterFour/0800~0899/0862.Shortest-Subarray-with-Sum-at-Least-K.md" >}})|Hard||||26.2%| -|0875|Koko Eating Bananas|[Go]({{< relref "/ChapterFour/0800~0899/0875.Koko-Eating-Bananas.md" >}})|Medium||||54.6%| -|0878|Nth Magical Number|[Go]({{< relref "/ChapterFour/0800~0899/0878.Nth-Magical-Number.md" >}})|Hard||||35.8%| -|0887|Super Egg Drop|[Go]({{< relref "/ChapterFour/0800~0899/0887.Super-Egg-Drop.md" >}})|Hard||||27.2%| -|0888|Fair Candy Swap|[Go]({{< relref "/ChapterFour/0800~0899/0888.Fair-Candy-Swap.md" >}})|Easy||||60.4%| -|0911|Online Election|[Go]({{< relref "/ChapterFour/0900~0999/0911.Online-Election.md" >}})|Medium||||51.6%| -|0981|Time Based Key-Value Store|[Go]({{< relref "/ChapterFour/0900~0999/0981.Time-Based-Key-Value-Store.md" >}})|Medium||||52.7%| -|1004|Max Consecutive Ones III|[Go]({{< relref "/ChapterFour/1000~1099/1004.Max-Consecutive-Ones-III.md" >}})|Medium||||63.0%| -|1011|Capacity To Ship Packages Within D Days|[Go]({{< relref "/ChapterFour/1000~1099/1011.Capacity-To-Ship-Packages-Within-D-Days.md" >}})|Medium||||63.6%| -|1157|Online Majority Element In Subarray|[Go]({{< relref "/ChapterFour/1100~1199/1157.Online-Majority-Element-In-Subarray.md" >}})|Hard||||42.1%| -|1170|Compare Strings by Frequency of the Smallest Character|[Go]({{< relref "/ChapterFour/1100~1199/1170.Compare-Strings-by-Frequency-of-the-Smallest-Character.md" >}})|Medium||||61.1%| -|1201|Ugly Number III|[Go]({{< relref "/ChapterFour/1200~1299/1201.Ugly-Number-III.md" >}})|Medium||||28.1%| -|1208|Get Equal Substrings Within Budget|[Go]({{< relref "/ChapterFour/1200~1299/1208.Get-Equal-Substrings-Within-Budget.md" >}})|Medium||||46.5%| -|1235|Maximum Profit in Job Scheduling|[Go]({{< relref "/ChapterFour/1200~1299/1235.Maximum-Profit-in-Job-Scheduling.md" >}})|Hard||||50.9%| -|1283|Find the Smallest Divisor Given a Threshold|[Go]({{< relref "/ChapterFour/1200~1299/1283.Find-the-Smallest-Divisor-Given-a-Threshold.md" >}})|Medium||||53.9%| -|1300|Sum of Mutated Array Closest to Target|[Go]({{< relref "/ChapterFour/1300~1399/1300.Sum-of-Mutated-Array-Closest-to-Target.md" >}})|Medium||||42.8%| -|1337|The K Weakest Rows in a Matrix|[Go]({{< relref "/ChapterFour/1300~1399/1337.The-K-Weakest-Rows-in-a-Matrix.md" >}})|Easy||||74.3%| -|1385|Find the Distance Value Between Two Arrays|[Go]({{< relref "/ChapterFour/1300~1399/1385.Find-the-Distance-Value-Between-Two-Arrays.md" >}})|Easy||||65.9%| -|1439|Find the Kth Smallest Sum of a Matrix With Sorted Rows|[Go]({{< relref "/ChapterFour/1400~1499/1439.Find-the-Kth-Smallest-Sum-of-a-Matrix-With-Sorted-Rows.md" >}})|Hard||||61.5%| -|1482|Minimum Number of Days to Make m Bouquets|[Go]({{< relref "/ChapterFour/1400~1499/1482.Minimum-Number-of-Days-to-Make-m-Bouquets.md" >}})|Medium||||56.0%| -|1539|Kth Missing Positive Number|[Go]({{< relref "/ChapterFour/1500~1599/1539.Kth-Missing-Positive-Number.md" >}})|Easy||||55.5%| +|0532|K-diff Pairs in an Array|[Go]({{< relref "/ChapterFour/0500~0599/0532.K-diff-Pairs-in-an-Array.md" >}})|Medium||||41.2%| +|0540|Single Element in a Sorted Array|[Go]({{< relref "/ChapterFour/0500~0599/0540.Single-Element-in-a-Sorted-Array.md" >}})|Medium||||59.1%| +|0611|Valid Triangle Number|[Go]({{< relref "/ChapterFour/0600~0699/0611.Valid-Triangle-Number.md" >}})|Medium||||50.6%| +|0633|Sum of Square Numbers|[Go]({{< relref "/ChapterFour/0600~0699/0633.Sum-of-Square-Numbers.md" >}})|Medium||||34.4%| +|0658|Find K Closest Elements|[Go]({{< relref "/ChapterFour/0600~0699/0658.Find-K-Closest-Elements.md" >}})|Medium||||46.8%| +|0668|Kth Smallest Number in Multiplication Table|[Go]({{< relref "/ChapterFour/0600~0699/0668.Kth-Smallest-Number-in-Multiplication-Table.md" >}})|Hard||||51.4%| +|0704|Binary Search|[Go]({{< relref "/ChapterFour/0700~0799/0704.Binary-Search.md" >}})|Easy||||56.1%| +|0710|Random Pick with Blacklist|[Go]({{< relref "/ChapterFour/0700~0799/0710.Random-Pick-with-Blacklist.md" >}})|Hard| O(n)| O(n) ||33.5%| +|0718|Maximum Length of Repeated Subarray|[Go]({{< relref "/ChapterFour/0700~0799/0718.Maximum-Length-of-Repeated-Subarray.md" >}})|Medium||||51.3%| +|0719|Find K-th Smallest Pair Distance|[Go]({{< relref "/ChapterFour/0700~0799/0719.Find-K-th-Smallest-Pair-Distance.md" >}})|Hard||||36.7%| +|0729|My Calendar I|[Go]({{< relref "/ChapterFour/0700~0799/0729.My-Calendar-I.md" >}})|Medium||||56.8%| +|0732|My Calendar III|[Go]({{< relref "/ChapterFour/0700~0799/0732.My-Calendar-III.md" >}})|Hard||||71.5%| +|0744|Find Smallest Letter Greater Than Target|[Go]({{< relref "/ChapterFour/0700~0799/0744.Find-Smallest-Letter-Greater-Than-Target.md" >}})|Easy||||45.8%| +|0778|Swim in Rising Water|[Go]({{< relref "/ChapterFour/0700~0799/0778.Swim-in-Rising-Water.md" >}})|Hard||||59.8%| +|0786|K-th Smallest Prime Fraction|[Go]({{< relref "/ChapterFour/0700~0799/0786.K-th-Smallest-Prime-Fraction.md" >}})|Medium||||51.7%| +|0793|Preimage Size of Factorial Zeroes Function|[Go]({{< relref "/ChapterFour/0700~0799/0793.Preimage-Size-of-Factorial-Zeroes-Function.md" >}})|Hard||||43.2%| +|0825|Friends Of Appropriate Ages|[Go]({{< relref "/ChapterFour/0800~0899/0825.Friends-Of-Appropriate-Ages.md" >}})|Medium||||46.3%| +|0826|Most Profit Assigning Work|[Go]({{< relref "/ChapterFour/0800~0899/0826.Most-Profit-Assigning-Work.md" >}})|Medium||||44.9%| +|0852|Peak Index in a Mountain Array|[Go]({{< relref "/ChapterFour/0800~0899/0852.Peak-Index-in-a-Mountain-Array.md" >}})|Medium||||69.0%| +|0862|Shortest Subarray with Sum at Least K|[Go]({{< relref "/ChapterFour/0800~0899/0862.Shortest-Subarray-with-Sum-at-Least-K.md" >}})|Hard||||26.0%| +|0875|Koko Eating Bananas|[Go]({{< relref "/ChapterFour/0800~0899/0875.Koko-Eating-Bananas.md" >}})|Medium||||52.1%| +|0878|Nth Magical Number|[Go]({{< relref "/ChapterFour/0800~0899/0878.Nth-Magical-Number.md" >}})|Hard||||35.4%| +|0887|Super Egg Drop|[Go]({{< relref "/ChapterFour/0800~0899/0887.Super-Egg-Drop.md" >}})|Hard||||27.1%| +|0888|Fair Candy Swap|[Go]({{< relref "/ChapterFour/0800~0899/0888.Fair-Candy-Swap.md" >}})|Easy||||60.7%| +|0911|Online Election|[Go]({{< relref "/ChapterFour/0900~0999/0911.Online-Election.md" >}})|Medium||||52.2%| +|0981|Time Based Key-Value Store|[Go]({{< relref "/ChapterFour/0900~0999/0981.Time-Based-Key-Value-Store.md" >}})|Medium||||52.2%| +|1004|Max Consecutive Ones III|[Go]({{< relref "/ChapterFour/1000~1099/1004.Max-Consecutive-Ones-III.md" >}})|Medium||||63.2%| +|1011|Capacity To Ship Packages Within D Days|[Go]({{< relref "/ChapterFour/1000~1099/1011.Capacity-To-Ship-Packages-Within-D-Days.md" >}})|Medium||||67.7%| +|1157|Online Majority Element In Subarray|[Go]({{< relref "/ChapterFour/1100~1199/1157.Online-Majority-Element-In-Subarray.md" >}})|Hard||||41.8%| +|1170|Compare Strings by Frequency of the Smallest Character|[Go]({{< relref "/ChapterFour/1100~1199/1170.Compare-Strings-by-Frequency-of-the-Smallest-Character.md" >}})|Medium||||61.5%| +|1201|Ugly Number III|[Go]({{< relref "/ChapterFour/1200~1299/1201.Ugly-Number-III.md" >}})|Medium||||28.9%| +|1208|Get Equal Substrings Within Budget|[Go]({{< relref "/ChapterFour/1200~1299/1208.Get-Equal-Substrings-Within-Budget.md" >}})|Medium||||48.6%| +|1235|Maximum Profit in Job Scheduling|[Go]({{< relref "/ChapterFour/1200~1299/1235.Maximum-Profit-in-Job-Scheduling.md" >}})|Hard||||53.4%| +|1283|Find the Smallest Divisor Given a Threshold|[Go]({{< relref "/ChapterFour/1200~1299/1283.Find-the-Smallest-Divisor-Given-a-Threshold.md" >}})|Medium||||56.2%| +|1300|Sum of Mutated Array Closest to Target|[Go]({{< relref "/ChapterFour/1300~1399/1300.Sum-of-Mutated-Array-Closest-to-Target.md" >}})|Medium||||43.6%| +|1337|The K Weakest Rows in a Matrix|[Go]({{< relref "/ChapterFour/1300~1399/1337.The-K-Weakest-Rows-in-a-Matrix.md" >}})|Easy||||72.1%| +|1385|Find the Distance Value Between Two Arrays|[Go]({{< relref "/ChapterFour/1300~1399/1385.Find-the-Distance-Value-Between-Two-Arrays.md" >}})|Easy||||66.6%| +|1439|Find the Kth Smallest Sum of a Matrix With Sorted Rows|[Go]({{< relref "/ChapterFour/1400~1499/1439.Find-the-Kth-Smallest-Sum-of-a-Matrix-With-Sorted-Rows.md" >}})|Hard||||61.4%| +|1482|Minimum Number of Days to Make m Bouquets|[Go]({{< relref "/ChapterFour/1400~1499/1482.Minimum-Number-of-Days-to-Make-m-Bouquets.md" >}})|Medium||||54.0%| +|1539|Kth Missing Positive Number|[Go]({{< relref "/ChapterFour/1500~1599/1539.Kth-Missing-Positive-Number.md" >}})|Easy||||58.6%| |1608|Special Array With X Elements Greater Than or Equal X|[Go]({{< relref "/ChapterFour/1600~1699/1608.Special-Array-With-X-Elements-Greater-Than-or-Equal-X.md" >}})|Easy||||60.5%| -|1631|Path With Minimum Effort|[Go]({{< relref "/ChapterFour/1600~1699/1631.Path-With-Minimum-Effort.md" >}})|Medium||||55.0%| -|1648|Sell Diminishing-Valued Colored Balls|[Go]({{< relref "/ChapterFour/1600~1699/1648.Sell-Diminishing-Valued-Colored-Balls.md" >}})|Medium||||30.8%| -|1649|Create Sorted Array through Instructions|[Go]({{< relref "/ChapterFour/1600~1699/1649.Create-Sorted-Array-through-Instructions.md" >}})|Hard||||37.2%| -|1658|Minimum Operations to Reduce X to Zero|[Go]({{< relref "/ChapterFour/1600~1699/1658.Minimum-Operations-to-Reduce-X-to-Zero.md" >}})|Medium||||33.6%| -|1818|Minimum Absolute Sum Difference|[Go]({{< relref "/ChapterFour/1800~1899/1818.Minimum-Absolute-Sum-Difference.md" >}})|Medium||||29.4%| +|1631|Path With Minimum Effort|[Go]({{< relref "/ChapterFour/1600~1699/1631.Path-With-Minimum-Effort.md" >}})|Medium||||55.7%| +|1648|Sell Diminishing-Valued Colored Balls|[Go]({{< relref "/ChapterFour/1600~1699/1648.Sell-Diminishing-Valued-Colored-Balls.md" >}})|Medium||||30.4%| +|1649|Create Sorted Array through Instructions|[Go]({{< relref "/ChapterFour/1600~1699/1649.Create-Sorted-Array-through-Instructions.md" >}})|Hard||||37.5%| +|1658|Minimum Operations to Reduce X to Zero|[Go]({{< relref "/ChapterFour/1600~1699/1658.Minimum-Operations-to-Reduce-X-to-Zero.md" >}})|Medium||||37.6%| +|1818|Minimum Absolute Sum Difference|[Go]({{< relref "/ChapterFour/1800~1899/1818.Minimum-Absolute-Sum-Difference.md" >}})|Medium||||30.4%| |------------|-------------------------------------------------------|-------| ----------------| ---------------|-------------|-------------|-------------| diff --git a/website/content/ChapterTwo/Bit_Manipulation.md b/website/content/ChapterTwo/Bit_Manipulation.md index 4f5b75c38..e1c9ac95d 100644 --- a/website/content/ChapterTwo/Bit_Manipulation.md +++ b/website/content/ChapterTwo/Bit_Manipulation.md @@ -44,65 +44,65 @@ X & ~X = 0 | No. | Title | Solution | Difficulty | TimeComplexity | SpaceComplexity |Favorite| Acceptance | |:--------:|:------- | :--------: | :----------: | :----: | :-----: | :-----: |:-----: | -|0029|Divide Two Integers|[Go]({{< relref "/ChapterFour/0001~0099/0029.Divide-Two-Integers.md" >}})|Medium||||17.0%| -|0067|Add Binary|[Go]({{< relref "/ChapterFour/0001~0099/0067.Add-Binary.md" >}})|Easy||||50.5%| -|0078|Subsets|[Go]({{< relref "/ChapterFour/0001~0099/0078.Subsets.md" >}})|Medium| O(n^2)| O(n)|❤️|71.5%| -|0089|Gray Code|[Go]({{< relref "/ChapterFour/0001~0099/0089.Gray-Code.md" >}})|Medium||||55.3%| -|0090|Subsets II|[Go]({{< relref "/ChapterFour/0001~0099/0090.Subsets-II.md" >}})|Medium||||53.3%| -|0136|Single Number|[Go]({{< relref "/ChapterFour/0100~0199/0136.Single-Number.md" >}})|Easy| O(n)| O(1)||69.4%| -|0137|Single Number II|[Go]({{< relref "/ChapterFour/0100~0199/0137.Single-Number-II.md" >}})|Medium| O(n)| O(1)|❤️|56.6%| -|0187|Repeated DNA Sequences|[Go]({{< relref "/ChapterFour/0100~0199/0187.Repeated-DNA-Sequences.md" >}})|Medium| O(n)| O(1)||44.7%| -|0190|Reverse Bits|[Go]({{< relref "/ChapterFour/0100~0199/0190.Reverse-Bits.md" >}})|Easy| O(n)| O(1)|❤️|49.0%| -|0191|Number of 1 Bits|[Go]({{< relref "/ChapterFour/0100~0199/0191.Number-of-1-Bits.md" >}})|Easy| O(n)| O(1)||60.6%| -|0201|Bitwise AND of Numbers Range|[Go]({{< relref "/ChapterFour/0200~0299/0201.Bitwise-AND-of-Numbers-Range.md" >}})|Medium| O(n)| O(1)|❤️|41.8%| -|0231|Power of Two|[Go]({{< relref "/ChapterFour/0200~0299/0231.Power-of-Two.md" >}})|Easy| O(1)| O(1)||45.0%| -|0260|Single Number III|[Go]({{< relref "/ChapterFour/0200~0299/0260.Single-Number-III.md" >}})|Medium| O(n)| O(1)|❤️|67.2%| -|0268|Missing Number|[Go]({{< relref "/ChapterFour/0200~0299/0268.Missing-Number.md" >}})|Easy| O(n)| O(1)||59.4%| -|0287|Find the Duplicate Number|[Go]({{< relref "/ChapterFour/0200~0299/0287.Find-the-Duplicate-Number.md" >}})|Medium||||58.8%| -|0318|Maximum Product of Word Lengths|[Go]({{< relref "/ChapterFour/0300~0399/0318.Maximum-Product-of-Word-Lengths.md" >}})|Medium| O(n)| O(1)||56.7%| -|0338|Counting Bits|[Go]({{< relref "/ChapterFour/0300~0399/0338.Counting-Bits.md" >}})|Easy| O(n)| O(n)||74.3%| -|0342|Power of Four|[Go]({{< relref "/ChapterFour/0300~0399/0342.Power-of-Four.md" >}})|Easy| O(n)| O(1)||44.0%| -|0371|Sum of Two Integers|[Go]({{< relref "/ChapterFour/0300~0399/0371.Sum-of-Two-Integers.md" >}})|Medium| O(n)| O(1)||50.6%| -|0389|Find the Difference|[Go]({{< relref "/ChapterFour/0300~0399/0389.Find-the-Difference.md" >}})|Easy| O(n)| O(1)||60.5%| -|0393|UTF-8 Validation|[Go]({{< relref "/ChapterFour/0300~0399/0393.UTF-8-Validation.md" >}})|Medium| O(n)| O(1)||39.2%| -|0397|Integer Replacement|[Go]({{< relref "/ChapterFour/0300~0399/0397.Integer-Replacement.md" >}})|Medium| O(n)| O(1)||34.7%| -|0401|Binary Watch|[Go]({{< relref "/ChapterFour/0400~0499/0401.Binary-Watch.md" >}})|Easy| O(1)| O(1)||50.5%| -|0405|Convert a Number to Hexadecimal|[Go]({{< relref "/ChapterFour/0400~0499/0405.Convert-a-Number-to-Hexadecimal.md" >}})|Easy| O(n)| O(1)||45.8%| -|0421|Maximum XOR of Two Numbers in an Array|[Go]({{< relref "/ChapterFour/0400~0499/0421.Maximum-XOR-of-Two-Numbers-in-an-Array.md" >}})|Medium| O(n)| O(1)|❤️|54.3%| -|0461|Hamming Distance|[Go]({{< relref "/ChapterFour/0400~0499/0461.Hamming-Distance.md" >}})|Easy| O(n)| O(1)||74.5%| -|0473|Matchsticks to Square|[Go]({{< relref "/ChapterFour/0400~0499/0473.Matchsticks-to-Square.md" >}})|Medium||||40.3%| -|0476|Number Complement|[Go]({{< relref "/ChapterFour/0400~0499/0476.Number-Complement.md" >}})|Easy| O(n)| O(1)||66.7%| -|0477|Total Hamming Distance|[Go]({{< relref "/ChapterFour/0400~0499/0477.Total-Hamming-Distance.md" >}})|Medium| O(n)| O(1)||52.0%| -|0491|Increasing Subsequences|[Go]({{< relref "/ChapterFour/0400~0499/0491.Increasing-Subsequences.md" >}})|Medium||||50.9%| -|0526|Beautiful Arrangement|[Go]({{< relref "/ChapterFour/0500~0599/0526.Beautiful-Arrangement.md" >}})|Medium||||64.3%| -|0638|Shopping Offers|[Go]({{< relref "/ChapterFour/0600~0699/0638.Shopping-Offers.md" >}})|Medium||||54.6%| -|0645|Set Mismatch|[Go]({{< relref "/ChapterFour/0600~0699/0645.Set-Mismatch.md" >}})|Easy||||41.3%| -|0693|Binary Number with Alternating Bits|[Go]({{< relref "/ChapterFour/0600~0699/0693.Binary-Number-with-Alternating-Bits.md" >}})|Easy| O(n)| O(1)|❤️|60.9%| -|0756|Pyramid Transition Matrix|[Go]({{< relref "/ChapterFour/0700~0799/0756.Pyramid-Transition-Matrix.md" >}})|Medium| O(n log n)| O(n)||54.6%| -|0762|Prime Number of Set Bits in Binary Representation|[Go]({{< relref "/ChapterFour/0700~0799/0762.Prime-Number-of-Set-Bits-in-Binary-Representation.md" >}})|Easy| O(n)| O(1)||66.8%| -|0784|Letter Case Permutation|[Go]({{< relref "/ChapterFour/0700~0799/0784.Letter-Case-Permutation.md" >}})|Medium| O(n)| O(1)||72.4%| -|0810|Chalkboard XOR Game|[Go]({{< relref "/ChapterFour/0800~0899/0810.Chalkboard-XOR-Game.md" >}})|Hard||||53.4%| -|0864|Shortest Path to Get All Keys|[Go]({{< relref "/ChapterFour/0800~0899/0864.Shortest-Path-to-Get-All-Keys.md" >}})|Hard||||44.6%| -|0898|Bitwise ORs of Subarrays|[Go]({{< relref "/ChapterFour/0800~0899/0898.Bitwise-ORs-of-Subarrays.md" >}})|Medium| O(n)| O(1)||36.3%| -|0980|Unique Paths III|[Go]({{< relref "/ChapterFour/0900~0999/0980.Unique-Paths-III.md" >}})|Hard||||79.4%| -|0995|Minimum Number of K Consecutive Bit Flips|[Go]({{< relref "/ChapterFour/0900~0999/0995.Minimum-Number-of-K-Consecutive-Bit-Flips.md" >}})|Hard||||50.8%| -|0996|Number of Squareful Arrays|[Go]({{< relref "/ChapterFour/0900~0999/0996.Number-of-Squareful-Arrays.md" >}})|Hard||||49.1%| -|1009|Complement of Base 10 Integer|[Go]({{< relref "/ChapterFour/1000~1099/1009.Complement-of-Base-10-Integer.md" >}})|Easy||||62.3%| -|1178|Number of Valid Words for Each Puzzle|[Go]({{< relref "/ChapterFour/1100~1199/1178.Number-of-Valid-Words-for-Each-Puzzle.md" >}})|Hard||||46.8%| -|1239|Maximum Length of a Concatenated String with Unique Characters|[Go]({{< relref "/ChapterFour/1200~1299/1239.Maximum-Length-of-a-Concatenated-String-with-Unique-Characters.md" >}})|Medium||||50.5%| -|1310|XOR Queries of a Subarray|[Go]({{< relref "/ChapterFour/1300~1399/1310.XOR-Queries-of-a-Subarray.md" >}})|Medium||||71.2%| -|1442|Count Triplets That Can Form Two Arrays of Equal XOR|[Go]({{< relref "/ChapterFour/1400~1499/1442.Count-Triplets-That-Can-Form-Two-Arrays-of-Equal-XOR.md" >}})|Medium||||74.8%| -|1461|Check If a String Contains All Binary Codes of Size K|[Go]({{< relref "/ChapterFour/1400~1499/1461.Check-If-a-String-Contains-All-Binary-Codes-of-Size-K.md" >}})|Medium||||54.5%| -|1486|XOR Operation in an Array|[Go]({{< relref "/ChapterFour/1400~1499/1486.XOR-Operation-in-an-Array.md" >}})|Easy||||84.2%| -|1655|Distribute Repeating Integers|[Go]({{< relref "/ChapterFour/1600~1699/1655.Distribute-Repeating-Integers.md" >}})|Hard||||40.3%| -|1659|Maximize Grid Happiness|[Go]({{< relref "/ChapterFour/1600~1699/1659.Maximize-Grid-Happiness.md" >}})|Hard||||37.7%| -|1680|Concatenation of Consecutive Binary Numbers|[Go]({{< relref "/ChapterFour/1600~1699/1680.Concatenation-of-Consecutive-Binary-Numbers.md" >}})|Medium||||52.6%| -|1681|Minimum Incompatibility|[Go]({{< relref "/ChapterFour/1600~1699/1681.Minimum-Incompatibility.md" >}})|Hard||||37.1%| -|1684|Count the Number of Consistent Strings|[Go]({{< relref "/ChapterFour/1600~1699/1684.Count-the-Number-of-Consistent-Strings.md" >}})|Easy||||81.8%| -|1720|Decode XORed Array|[Go]({{< relref "/ChapterFour/1700~1799/1720.Decode-XORed-Array.md" >}})|Easy||||85.9%| -|1734|Decode XORed Permutation|[Go]({{< relref "/ChapterFour/1700~1799/1734.Decode-XORed-Permutation.md" >}})|Medium||||60.8%| -|1738|Find Kth Largest XOR Coordinate Value|[Go]({{< relref "/ChapterFour/1700~1799/1738.Find-Kth-Largest-XOR-Coordinate-Value.md" >}})|Medium||||61.9%| -|1763|Longest Nice Substring|[Go]({{< relref "/ChapterFour/1700~1799/1763.Longest-Nice-Substring.md" >}})|Easy||||61.8%| +|0029|Divide Two Integers|[Go]({{< relref "/ChapterFour/0001~0099/0029.Divide-Two-Integers.md" >}})|Medium||||17.2%| +|0067|Add Binary|[Go]({{< relref "/ChapterFour/0001~0099/0067.Add-Binary.md" >}})|Easy||||52.4%| +|0078|Subsets|[Go]({{< relref "/ChapterFour/0001~0099/0078.Subsets.md" >}})|Medium| O(n^2)| O(n)|❤️|74.9%| +|0089|Gray Code|[Go]({{< relref "/ChapterFour/0001~0099/0089.Gray-Code.md" >}})|Medium||||57.2%| +|0090|Subsets II|[Go]({{< relref "/ChapterFour/0001~0099/0090.Subsets-II.md" >}})|Medium||||55.9%| +|0136|Single Number|[Go]({{< relref "/ChapterFour/0100~0199/0136.Single-Number.md" >}})|Easy| O(n)| O(1)||70.7%| +|0137|Single Number II|[Go]({{< relref "/ChapterFour/0100~0199/0137.Single-Number-II.md" >}})|Medium| O(n)| O(1)|❤️|58.5%| +|0187|Repeated DNA Sequences|[Go]({{< relref "/ChapterFour/0100~0199/0187.Repeated-DNA-Sequences.md" >}})|Medium| O(n)| O(1)||47.0%| +|0190|Reverse Bits|[Go]({{< relref "/ChapterFour/0100~0199/0190.Reverse-Bits.md" >}})|Easy| O(n)| O(1)|❤️|54.0%| +|0191|Number of 1 Bits|[Go]({{< relref "/ChapterFour/0100~0199/0191.Number-of-1-Bits.md" >}})|Easy| O(n)| O(1)||66.6%| +|0201|Bitwise AND of Numbers Range|[Go]({{< relref "/ChapterFour/0200~0299/0201.Bitwise-AND-of-Numbers-Range.md" >}})|Medium| O(n)| O(1)|❤️|42.5%| +|0231|Power of Two|[Go]({{< relref "/ChapterFour/0200~0299/0231.Power-of-Two.md" >}})|Easy| O(1)| O(1)||46.0%| +|0260|Single Number III|[Go]({{< relref "/ChapterFour/0200~0299/0260.Single-Number-III.md" >}})|Medium| O(n)| O(1)|❤️|67.7%| +|0268|Missing Number|[Go]({{< relref "/ChapterFour/0200~0299/0268.Missing-Number.md" >}})|Easy| O(n)| O(1)||62.6%| +|0287|Find the Duplicate Number|[Go]({{< relref "/ChapterFour/0200~0299/0287.Find-the-Duplicate-Number.md" >}})|Medium||||59.1%| +|0318|Maximum Product of Word Lengths|[Go]({{< relref "/ChapterFour/0300~0399/0318.Maximum-Product-of-Word-Lengths.md" >}})|Medium| O(n)| O(1)||59.9%| +|0338|Counting Bits|[Go]({{< relref "/ChapterFour/0300~0399/0338.Counting-Bits.md" >}})|Easy| O(n)| O(n)||75.8%| +|0342|Power of Four|[Go]({{< relref "/ChapterFour/0300~0399/0342.Power-of-Four.md" >}})|Easy| O(n)| O(1)||46.2%| +|0371|Sum of Two Integers|[Go]({{< relref "/ChapterFour/0300~0399/0371.Sum-of-Two-Integers.md" >}})|Medium| O(n)| O(1)||50.7%| +|0389|Find the Difference|[Go]({{< relref "/ChapterFour/0300~0399/0389.Find-the-Difference.md" >}})|Easy| O(n)| O(1)||59.9%| +|0393|UTF-8 Validation|[Go]({{< relref "/ChapterFour/0300~0399/0393.UTF-8-Validation.md" >}})|Medium| O(n)| O(1)||45.1%| +|0397|Integer Replacement|[Go]({{< relref "/ChapterFour/0300~0399/0397.Integer-Replacement.md" >}})|Medium| O(n)| O(1)||35.2%| +|0401|Binary Watch|[Go]({{< relref "/ChapterFour/0400~0499/0401.Binary-Watch.md" >}})|Easy| O(1)| O(1)||52.3%| +|0405|Convert a Number to Hexadecimal|[Go]({{< relref "/ChapterFour/0400~0499/0405.Convert-a-Number-to-Hexadecimal.md" >}})|Easy| O(n)| O(1)||46.8%| +|0421|Maximum XOR of Two Numbers in an Array|[Go]({{< relref "/ChapterFour/0400~0499/0421.Maximum-XOR-of-Two-Numbers-in-an-Array.md" >}})|Medium| O(n)| O(1)|❤️|54.0%| +|0461|Hamming Distance|[Go]({{< relref "/ChapterFour/0400~0499/0461.Hamming-Distance.md" >}})|Easy| O(n)| O(1)||75.0%| +|0473|Matchsticks to Square|[Go]({{< relref "/ChapterFour/0400~0499/0473.Matchsticks-to-Square.md" >}})|Medium||||40.2%| +|0476|Number Complement|[Go]({{< relref "/ChapterFour/0400~0499/0476.Number-Complement.md" >}})|Easy| O(n)| O(1)||67.4%| +|0477|Total Hamming Distance|[Go]({{< relref "/ChapterFour/0400~0499/0477.Total-Hamming-Distance.md" >}})|Medium| O(n)| O(1)||52.2%| +|0491|Non-decreasing Subsequences|[Go]({{< relref "/ChapterFour/0400~0499/0491.Non-decreasing-Subsequences.md" >}})|Medium||||60.2%| +|0526|Beautiful Arrangement|[Go]({{< relref "/ChapterFour/0500~0599/0526.Beautiful-Arrangement.md" >}})|Medium||||64.4%| +|0638|Shopping Offers|[Go]({{< relref "/ChapterFour/0600~0699/0638.Shopping-Offers.md" >}})|Medium||||53.3%| +|0645|Set Mismatch|[Go]({{< relref "/ChapterFour/0600~0699/0645.Set-Mismatch.md" >}})|Easy||||42.7%| +|0693|Binary Number with Alternating Bits|[Go]({{< relref "/ChapterFour/0600~0699/0693.Binary-Number-with-Alternating-Bits.md" >}})|Easy| O(n)| O(1)|❤️|61.6%| +|0756|Pyramid Transition Matrix|[Go]({{< relref "/ChapterFour/0700~0799/0756.Pyramid-Transition-Matrix.md" >}})|Medium| O(n log n)| O(n)||52.7%| +|0762|Prime Number of Set Bits in Binary Representation|[Go]({{< relref "/ChapterFour/0700~0799/0762.Prime-Number-of-Set-Bits-in-Binary-Representation.md" >}})|Easy| O(n)| O(1)||68.0%| +|0784|Letter Case Permutation|[Go]({{< relref "/ChapterFour/0700~0799/0784.Letter-Case-Permutation.md" >}})|Medium| O(n)| O(1)||73.8%| +|0810|Chalkboard XOR Game|[Go]({{< relref "/ChapterFour/0800~0899/0810.Chalkboard-XOR-Game.md" >}})|Hard||||55.8%| +|0864|Shortest Path to Get All Keys|[Go]({{< relref "/ChapterFour/0800~0899/0864.Shortest-Path-to-Get-All-Keys.md" >}})|Hard||||45.6%| +|0898|Bitwise ORs of Subarrays|[Go]({{< relref "/ChapterFour/0800~0899/0898.Bitwise-ORs-of-Subarrays.md" >}})|Medium| O(n)| O(1)||37.2%| +|0980|Unique Paths III|[Go]({{< relref "/ChapterFour/0900~0999/0980.Unique-Paths-III.md" >}})|Hard||||81.7%| +|0995|Minimum Number of K Consecutive Bit Flips|[Go]({{< relref "/ChapterFour/0900~0999/0995.Minimum-Number-of-K-Consecutive-Bit-Flips.md" >}})|Hard||||51.2%| +|0996|Number of Squareful Arrays|[Go]({{< relref "/ChapterFour/0900~0999/0996.Number-of-Squareful-Arrays.md" >}})|Hard||||49.2%| +|1009|Complement of Base 10 Integer|[Go]({{< relref "/ChapterFour/1000~1099/1009.Complement-of-Base-10-Integer.md" >}})|Easy||||61.5%| +|1178|Number of Valid Words for Each Puzzle|[Go]({{< relref "/ChapterFour/1100~1199/1178.Number-of-Valid-Words-for-Each-Puzzle.md" >}})|Hard||||46.3%| +|1239|Maximum Length of a Concatenated String with Unique Characters|[Go]({{< relref "/ChapterFour/1200~1299/1239.Maximum-Length-of-a-Concatenated-String-with-Unique-Characters.md" >}})|Medium||||52.2%| +|1310|XOR Queries of a Subarray|[Go]({{< relref "/ChapterFour/1300~1399/1310.XOR-Queries-of-a-Subarray.md" >}})|Medium||||72.3%| +|1442|Count Triplets That Can Form Two Arrays of Equal XOR|[Go]({{< relref "/ChapterFour/1400~1499/1442.Count-Triplets-That-Can-Form-Two-Arrays-of-Equal-XOR.md" >}})|Medium||||76.1%| +|1461|Check If a String Contains All Binary Codes of Size K|[Go]({{< relref "/ChapterFour/1400~1499/1461.Check-If-a-String-Contains-All-Binary-Codes-of-Size-K.md" >}})|Medium||||56.6%| +|1486|XOR Operation in an Array|[Go]({{< relref "/ChapterFour/1400~1499/1486.XOR-Operation-in-an-Array.md" >}})|Easy||||84.6%| +|1655|Distribute Repeating Integers|[Go]({{< relref "/ChapterFour/1600~1699/1655.Distribute-Repeating-Integers.md" >}})|Hard||||39.3%| +|1659|Maximize Grid Happiness|[Go]({{< relref "/ChapterFour/1600~1699/1659.Maximize-Grid-Happiness.md" >}})|Hard||||38.8%| +|1680|Concatenation of Consecutive Binary Numbers|[Go]({{< relref "/ChapterFour/1600~1699/1680.Concatenation-of-Consecutive-Binary-Numbers.md" >}})|Medium||||57.0%| +|1681|Minimum Incompatibility|[Go]({{< relref "/ChapterFour/1600~1699/1681.Minimum-Incompatibility.md" >}})|Hard||||37.8%| +|1684|Count the Number of Consistent Strings|[Go]({{< relref "/ChapterFour/1600~1699/1684.Count-the-Number-of-Consistent-Strings.md" >}})|Easy||||82.3%| +|1720|Decode XORed Array|[Go]({{< relref "/ChapterFour/1700~1799/1720.Decode-XORed-Array.md" >}})|Easy||||85.8%| +|1734|Decode XORed Permutation|[Go]({{< relref "/ChapterFour/1700~1799/1734.Decode-XORed-Permutation.md" >}})|Medium||||63.0%| +|1738|Find Kth Largest XOR Coordinate Value|[Go]({{< relref "/ChapterFour/1700~1799/1738.Find-Kth-Largest-XOR-Coordinate-Value.md" >}})|Medium||||61.0%| +|1763|Longest Nice Substring|[Go]({{< relref "/ChapterFour/1700~1799/1763.Longest-Nice-Substring.md" >}})|Easy||||61.5%| |------------|-------------------------------------------------------|-------| ----------------| ---------------|-------------|-------------|-------------| diff --git a/website/content/ChapterTwo/Breadth_First_Search.md b/website/content/ChapterTwo/Breadth_First_Search.md index c8c6b5b11..631b6dff9 100644 --- a/website/content/ChapterTwo/Breadth_First_Search.md +++ b/website/content/ChapterTwo/Breadth_First_Search.md @@ -9,85 +9,86 @@ weight: 10 | No. | Title | Solution | Difficulty | TimeComplexity | SpaceComplexity |Favorite| Acceptance | |:--------:|:------- | :--------: | :----------: | :----: | :-----: | :-----: |:-----: | -|0100|Same Tree|[Go]({{< relref "/ChapterFour/0100~0199/0100.Same-Tree.md" >}})|Easy||||55.5%| -|0101|Symmetric Tree|[Go]({{< relref "/ChapterFour/0100~0199/0101.Symmetric-Tree.md" >}})|Easy| O(n)| O(1)||51.6%| -|0102|Binary Tree Level Order Traversal|[Go]({{< relref "/ChapterFour/0100~0199/0102.Binary-Tree-Level-Order-Traversal.md" >}})|Medium| O(n)| O(1)||60.9%| -|0103|Binary Tree Zigzag Level Order Traversal|[Go]({{< relref "/ChapterFour/0100~0199/0103.Binary-Tree-Zigzag-Level-Order-Traversal.md" >}})|Medium| O(n)| O(n)||53.6%| -|0104|Maximum Depth of Binary Tree|[Go]({{< relref "/ChapterFour/0100~0199/0104.Maximum-Depth-of-Binary-Tree.md" >}})|Easy||||71.9%| -|0107|Binary Tree Level Order Traversal II|[Go]({{< relref "/ChapterFour/0100~0199/0107.Binary-Tree-Level-Order-Traversal-II.md" >}})|Medium| O(n)| O(1)||58.7%| -|0111|Minimum Depth of Binary Tree|[Go]({{< relref "/ChapterFour/0100~0199/0111.Minimum-Depth-of-Binary-Tree.md" >}})|Easy| O(n)| O(1)||42.5%| -|0112|Path Sum|[Go]({{< relref "/ChapterFour/0100~0199/0112.Path-Sum.md" >}})|Easy||||45.5%| -|0116|Populating Next Right Pointers in Each Node|[Go]({{< relref "/ChapterFour/0100~0199/0116.Populating-Next-Right-Pointers-in-Each-Node.md" >}})|Medium||||57.0%| -|0126|Word Ladder II|[Go]({{< relref "/ChapterFour/0100~0199/0126.Word-Ladder-II.md" >}})|Hard| O(n)| O(n^2)|❤️|27.0%| -|0127|Word Ladder|[Go]({{< relref "/ChapterFour/0100~0199/0127.Word-Ladder.md" >}})|Hard| O(n)| O(n)||35.5%| -|0130|Surrounded Regions|[Go]({{< relref "/ChapterFour/0100~0199/0130.Surrounded-Regions.md" >}})|Medium||||34.0%| -|0199|Binary Tree Right Side View|[Go]({{< relref "/ChapterFour/0100~0199/0199.Binary-Tree-Right-Side-View.md" >}})|Medium| O(n)| O(1)||59.6%| -|0200|Number of Islands|[Go]({{< relref "/ChapterFour/0200~0299/0200.Number-of-Islands.md" >}})|Medium| O(n^2)| O(n^2)||53.9%| -|0207|Course Schedule|[Go]({{< relref "/ChapterFour/0200~0299/0207.Course-Schedule.md" >}})|Medium| O(n^2)| O(n^2)||45.1%| -|0210|Course Schedule II|[Go]({{< relref "/ChapterFour/0200~0299/0210.Course-Schedule-II.md" >}})|Medium| O(n^2)| O(n^2)||46.6%| -|0226|Invert Binary Tree|[Go]({{< relref "/ChapterFour/0200~0299/0226.Invert-Binary-Tree.md" >}})|Easy||||71.6%| -|0279|Perfect Squares|[Go]({{< relref "/ChapterFour/0200~0299/0279.Perfect-Squares.md" >}})|Medium||||51.9%| -|0297|Serialize and Deserialize Binary Tree|[Go]({{< relref "/ChapterFour/0200~0299/0297.Serialize-and-Deserialize-Binary-Tree.md" >}})|Hard||||53.8%| -|0301|Remove Invalid Parentheses|[Go]({{< relref "/ChapterFour/0300~0399/0301.Remove-Invalid-Parentheses.md" >}})|Hard||||46.9%| -|0322|Coin Change|[Go]({{< relref "/ChapterFour/0300~0399/0322.Coin-Change.md" >}})|Medium||||40.1%| -|0329|Longest Increasing Path in a Matrix|[Go]({{< relref "/ChapterFour/0300~0399/0329.Longest-Increasing-Path-in-a-Matrix.md" >}})|Hard||||49.7%| -|0399|Evaluate Division|[Go]({{< relref "/ChapterFour/0300~0399/0399.Evaluate-Division.md" >}})|Medium||||58.6%| -|0404|Sum of Left Leaves|[Go]({{< relref "/ChapterFour/0400~0499/0404.Sum-of-Left-Leaves.md" >}})|Easy||||55.1%| -|0417|Pacific Atlantic Water Flow|[Go]({{< relref "/ChapterFour/0400~0499/0417.Pacific-Atlantic-Water-Flow.md" >}})|Medium||||49.2%| -|0429|N-ary Tree Level Order Traversal|[Go]({{< relref "/ChapterFour/0400~0499/0429.N-ary-Tree-Level-Order-Traversal.md" >}})|Medium||||68.9%| -|0433|Minimum Genetic Mutation|[Go]({{< relref "/ChapterFour/0400~0499/0433.Minimum-Genetic-Mutation.md" >}})|Medium||||46.8%| -|0463|Island Perimeter|[Go]({{< relref "/ChapterFour/0400~0499/0463.Island-Perimeter.md" >}})|Easy||||69.0%| -|0488|Zuma Game|[Go]({{< relref "/ChapterFour/0400~0499/0488.Zuma-Game.md" >}})|Hard||||36.1%| -|0513|Find Bottom Left Tree Value|[Go]({{< relref "/ChapterFour/0500~0599/0513.Find-Bottom-Left-Tree-Value.md" >}})|Medium||||65.2%| -|0515|Find Largest Value in Each Tree Row|[Go]({{< relref "/ChapterFour/0500~0599/0515.Find-Largest-Value-in-Each-Tree-Row.md" >}})|Medium| O(n)| O(n)||64.5%| -|0529|Minesweeper|[Go]({{< relref "/ChapterFour/0500~0599/0529.Minesweeper.md" >}})|Medium||||64.7%| -|0530|Minimum Absolute Difference in BST|[Go]({{< relref "/ChapterFour/0500~0599/0530.Minimum-Absolute-Difference-in-BST.md" >}})|Easy||||56.3%| -|0542|01 Matrix|[Go]({{< relref "/ChapterFour/0500~0599/0542.01-Matrix.md" >}})|Medium| O(n)| O(1)||43.8%| -|0547|Number of Provinces|[Go]({{< relref "/ChapterFour/0500~0599/0547.Number-of-Provinces.md" >}})|Medium||||62.6%| -|0559|Maximum Depth of N-ary Tree|[Go]({{< relref "/ChapterFour/0500~0599/0559.Maximum-Depth-of-N-ary-Tree.md" >}})|Easy||||71.1%| -|0617|Merge Two Binary Trees|[Go]({{< relref "/ChapterFour/0600~0699/0617.Merge-Two-Binary-Trees.md" >}})|Easy||||77.9%| -|0623|Add One Row to Tree|[Go]({{< relref "/ChapterFour/0600~0699/0623.Add-One-Row-to-Tree.md" >}})|Medium||||53.9%| -|0637|Average of Levels in Binary Tree|[Go]({{< relref "/ChapterFour/0600~0699/0637.Average-of-Levels-in-Binary-Tree.md" >}})|Easy||||68.7%| -|0653|Two Sum IV - Input is a BST|[Go]({{< relref "/ChapterFour/0600~0699/0653.Two-Sum-IV-Input-is-a-BST.md" >}})|Easy||||58.8%| -|0662|Maximum Width of Binary Tree|[Go]({{< relref "/ChapterFour/0600~0699/0662.Maximum-Width-of-Binary-Tree.md" >}})|Medium||||40.3%| -|0684|Redundant Connection|[Go]({{< relref "/ChapterFour/0600~0699/0684.Redundant-Connection.md" >}})|Medium||||61.1%| -|0685|Redundant Connection II|[Go]({{< relref "/ChapterFour/0600~0699/0685.Redundant-Connection-II.md" >}})|Hard||||33.8%| -|0690|Employee Importance|[Go]({{< relref "/ChapterFour/0600~0699/0690.Employee-Importance.md" >}})|Medium||||64.0%| -|0695|Max Area of Island|[Go]({{< relref "/ChapterFour/0600~0699/0695.Max-Area-of-Island.md" >}})|Medium||||69.7%| -|0721|Accounts Merge|[Go]({{< relref "/ChapterFour/0700~0799/0721.Accounts-Merge.md" >}})|Medium||||55.9%| -|0733|Flood Fill|[Go]({{< relref "/ChapterFour/0700~0799/0733.Flood-Fill.md" >}})|Easy||||58.2%| -|0752|Open the Lock|[Go]({{< relref "/ChapterFour/0700~0799/0752.Open-the-Lock.md" >}})|Medium||||55.3%| -|0756|Pyramid Transition Matrix|[Go]({{< relref "/ChapterFour/0700~0799/0756.Pyramid-Transition-Matrix.md" >}})|Medium||||54.6%| -|0765|Couples Holding Hands|[Go]({{< relref "/ChapterFour/0700~0799/0765.Couples-Holding-Hands.md" >}})|Hard||||56.5%| -|0778|Swim in Rising Water|[Go]({{< relref "/ChapterFour/0700~0799/0778.Swim-in-Rising-Water.md" >}})|Hard||||58.7%| -|0783|Minimum Distance Between BST Nodes|[Go]({{< relref "/ChapterFour/0700~0799/0783.Minimum-Distance-Between-BST-Nodes.md" >}})|Easy||||56.1%| -|0785|Is Graph Bipartite?|[Go]({{< relref "/ChapterFour/0700~0799/0785.Is-Graph-Bipartite.md" >}})|Medium||||51.6%| -|0802|Find Eventual Safe States|[Go]({{< relref "/ChapterFour/0800~0899/0802.Find-Eventual-Safe-States.md" >}})|Medium||||52.6%| -|0815|Bus Routes|[Go]({{< relref "/ChapterFour/0800~0899/0815.Bus-Routes.md" >}})|Hard||||45.3%| -|0839|Similar String Groups|[Go]({{< relref "/ChapterFour/0800~0899/0839.Similar-String-Groups.md" >}})|Hard||||45.5%| -|0841|Keys and Rooms|[Go]({{< relref "/ChapterFour/0800~0899/0841.Keys-and-Rooms.md" >}})|Medium||||69.0%| -|0863|All Nodes Distance K in Binary Tree|[Go]({{< relref "/ChapterFour/0800~0899/0863.All-Nodes-Distance-K-in-Binary-Tree.md" >}})|Medium||||61.1%| -|0864|Shortest Path to Get All Keys|[Go]({{< relref "/ChapterFour/0800~0899/0864.Shortest-Path-to-Get-All-Keys.md" >}})|Hard||||44.6%| -|0909|Snakes and Ladders|[Go]({{< relref "/ChapterFour/0900~0999/0909.Snakes-and-Ladders.md" >}})|Medium||||40.5%| -|0924|Minimize Malware Spread|[Go]({{< relref "/ChapterFour/0900~0999/0924.Minimize-Malware-Spread.md" >}})|Hard||||41.9%| -|0928|Minimize Malware Spread II|[Go]({{< relref "/ChapterFour/0900~0999/0928.Minimize-Malware-Spread-II.md" >}})|Hard||||42.3%| -|0958|Check Completeness of a Binary Tree|[Go]({{< relref "/ChapterFour/0900~0999/0958.Check-Completeness-of-a-Binary-Tree.md" >}})|Medium||||53.6%| -|0959|Regions Cut By Slashes|[Go]({{< relref "/ChapterFour/0900~0999/0959.Regions-Cut-By-Slashes.md" >}})|Medium||||68.6%| -|0987|Vertical Order Traversal of a Binary Tree|[Go]({{< relref "/ChapterFour/0900~0999/0987.Vertical-Order-Traversal-of-a-Binary-Tree.md" >}})|Hard||||41.6%| -|0993|Cousins in Binary Tree|[Go]({{< relref "/ChapterFour/0900~0999/0993.Cousins-in-Binary-Tree.md" >}})|Easy| O(n)| O(1)||53.8%| -|1020|Number of Enclaves|[Go]({{< relref "/ChapterFour/1000~1099/1020.Number-of-Enclaves.md" >}})|Medium||||62.8%| -|1034|Coloring A Border|[Go]({{< relref "/ChapterFour/1000~1099/1034.Coloring-A-Border.md" >}})|Medium||||48.4%| -|1091|Shortest Path in Binary Matrix|[Go]({{< relref "/ChapterFour/1000~1099/1091.Shortest-Path-in-Binary-Matrix.md" >}})|Medium||||42.7%| -|1123|Lowest Common Ancestor of Deepest Leaves|[Go]({{< relref "/ChapterFour/1100~1199/1123.Lowest-Common-Ancestor-of-Deepest-Leaves.md" >}})|Medium||||70.2%| -|1202|Smallest String With Swaps|[Go]({{< relref "/ChapterFour/1200~1299/1202.Smallest-String-With-Swaps.md" >}})|Medium||||57.1%| -|1203|Sort Items by Groups Respecting Dependencies|[Go]({{< relref "/ChapterFour/1200~1299/1203.Sort-Items-by-Groups-Respecting-Dependencies.md" >}})|Hard||||49.5%| -|1254|Number of Closed Islands|[Go]({{< relref "/ChapterFour/1200~1299/1254.Number-of-Closed-Islands.md" >}})|Medium||||63.4%| -|1302|Deepest Leaves Sum|[Go]({{< relref "/ChapterFour/1300~1399/1302.Deepest-Leaves-Sum.md" >}})|Medium||||85.7%| -|1306|Jump Game III|[Go]({{< relref "/ChapterFour/1300~1399/1306.Jump-Game-III.md" >}})|Medium||||62.8%| -|1319|Number of Operations to Make Network Connected|[Go]({{< relref "/ChapterFour/1300~1399/1319.Number-of-Operations-to-Make-Network-Connected.md" >}})|Medium||||57.8%| -|1609|Even Odd Tree|[Go]({{< relref "/ChapterFour/1600~1699/1609.Even-Odd-Tree.md" >}})|Medium||||53.0%| -|1631|Path With Minimum Effort|[Go]({{< relref "/ChapterFour/1600~1699/1631.Path-With-Minimum-Effort.md" >}})|Medium||||55.0%| -|1654|Minimum Jumps to Reach Home|[Go]({{< relref "/ChapterFour/1600~1699/1654.Minimum-Jumps-to-Reach-Home.md" >}})|Medium||||27.2%| +|0100|Same Tree|[Go]({{< relref "/ChapterFour/0100~0199/0100.Same-Tree.md" >}})|Easy||||58.2%| +|0101|Symmetric Tree|[Go]({{< relref "/ChapterFour/0100~0199/0101.Symmetric-Tree.md" >}})|Easy| O(n)| O(1)||54.3%| +|0102|Binary Tree Level Order Traversal|[Go]({{< relref "/ChapterFour/0100~0199/0102.Binary-Tree-Level-Order-Traversal.md" >}})|Medium| O(n)| O(1)||64.4%| +|0103|Binary Tree Zigzag Level Order Traversal|[Go]({{< relref "/ChapterFour/0100~0199/0103.Binary-Tree-Zigzag-Level-Order-Traversal.md" >}})|Medium| O(n)| O(n)||56.9%| +|0104|Maximum Depth of Binary Tree|[Go]({{< relref "/ChapterFour/0100~0199/0104.Maximum-Depth-of-Binary-Tree.md" >}})|Easy||||73.9%| +|0107|Binary Tree Level Order Traversal II|[Go]({{< relref "/ChapterFour/0100~0199/0107.Binary-Tree-Level-Order-Traversal-II.md" >}})|Medium| O(n)| O(1)||61.2%| +|0111|Minimum Depth of Binary Tree|[Go]({{< relref "/ChapterFour/0100~0199/0111.Minimum-Depth-of-Binary-Tree.md" >}})|Easy| O(n)| O(1)||44.5%| +|0112|Path Sum|[Go]({{< relref "/ChapterFour/0100~0199/0112.Path-Sum.md" >}})|Easy||||48.3%| +|0116|Populating Next Right Pointers in Each Node|[Go]({{< relref "/ChapterFour/0100~0199/0116.Populating-Next-Right-Pointers-in-Each-Node.md" >}})|Medium||||60.4%| +|0126|Word Ladder II|[Go]({{< relref "/ChapterFour/0100~0199/0126.Word-Ladder-II.md" >}})|Hard| O(n)| O(n^2)|❤️|27.5%| +|0127|Word Ladder|[Go]({{< relref "/ChapterFour/0100~0199/0127.Word-Ladder.md" >}})|Hard| O(n)| O(n)||37.2%| +|0130|Surrounded Regions|[Go]({{< relref "/ChapterFour/0100~0199/0130.Surrounded-Regions.md" >}})|Medium||||36.8%| +|0199|Binary Tree Right Side View|[Go]({{< relref "/ChapterFour/0100~0199/0199.Binary-Tree-Right-Side-View.md" >}})|Medium| O(n)| O(1)||61.6%| +|0200|Number of Islands|[Go]({{< relref "/ChapterFour/0200~0299/0200.Number-of-Islands.md" >}})|Medium| O(n^2)| O(n^2)||57.0%| +|0207|Course Schedule|[Go]({{< relref "/ChapterFour/0200~0299/0207.Course-Schedule.md" >}})|Medium| O(n^2)| O(n^2)||45.4%| +|0210|Course Schedule II|[Go]({{< relref "/ChapterFour/0200~0299/0210.Course-Schedule-II.md" >}})|Medium| O(n^2)| O(n^2)||48.5%| +|0226|Invert Binary Tree|[Go]({{< relref "/ChapterFour/0200~0299/0226.Invert-Binary-Tree.md" >}})|Easy||||74.7%| +|0279|Perfect Squares|[Go]({{< relref "/ChapterFour/0200~0299/0279.Perfect-Squares.md" >}})|Medium||||52.7%| +|0297|Serialize and Deserialize Binary Tree|[Go]({{< relref "/ChapterFour/0200~0299/0297.Serialize-and-Deserialize-Binary-Tree.md" >}})|Hard||||55.4%| +|0301|Remove Invalid Parentheses|[Go]({{< relref "/ChapterFour/0300~0399/0301.Remove-Invalid-Parentheses.md" >}})|Hard||||47.2%| +|0322|Coin Change|[Go]({{< relref "/ChapterFour/0300~0399/0322.Coin-Change.md" >}})|Medium||||42.1%| +|0329|Longest Increasing Path in a Matrix|[Go]({{< relref "/ChapterFour/0300~0399/0329.Longest-Increasing-Path-in-a-Matrix.md" >}})|Hard||||52.4%| +|0399|Evaluate Division|[Go]({{< relref "/ChapterFour/0300~0399/0399.Evaluate-Division.md" >}})|Medium||||59.7%| +|0404|Sum of Left Leaves|[Go]({{< relref "/ChapterFour/0400~0499/0404.Sum-of-Left-Leaves.md" >}})|Easy||||56.7%| +|0417|Pacific Atlantic Water Flow|[Go]({{< relref "/ChapterFour/0400~0499/0417.Pacific-Atlantic-Water-Flow.md" >}})|Medium||||54.4%| +|0429|N-ary Tree Level Order Traversal|[Go]({{< relref "/ChapterFour/0400~0499/0429.N-ary-Tree-Level-Order-Traversal.md" >}})|Medium||||70.7%| +|0433|Minimum Genetic Mutation|[Go]({{< relref "/ChapterFour/0400~0499/0433.Minimum-Genetic-Mutation.md" >}})|Medium||||52.4%| +|0463|Island Perimeter|[Go]({{< relref "/ChapterFour/0400~0499/0463.Island-Perimeter.md" >}})|Easy||||69.7%| +|0488|Zuma Game|[Go]({{< relref "/ChapterFour/0400~0499/0488.Zuma-Game.md" >}})|Hard||||33.9%| +|0513|Find Bottom Left Tree Value|[Go]({{< relref "/ChapterFour/0500~0599/0513.Find-Bottom-Left-Tree-Value.md" >}})|Medium||||66.9%| +|0515|Find Largest Value in Each Tree Row|[Go]({{< relref "/ChapterFour/0500~0599/0515.Find-Largest-Value-in-Each-Tree-Row.md" >}})|Medium| O(n)| O(n)||64.6%| +|0529|Minesweeper|[Go]({{< relref "/ChapterFour/0500~0599/0529.Minesweeper.md" >}})|Medium||||65.7%| +|0530|Minimum Absolute Difference in BST|[Go]({{< relref "/ChapterFour/0500~0599/0530.Minimum-Absolute-Difference-in-BST.md" >}})|Easy||||57.3%| +|0542|01 Matrix|[Go]({{< relref "/ChapterFour/0500~0599/0542.01-Matrix.md" >}})|Medium| O(n)| O(1)||44.8%| +|0547|Number of Provinces|[Go]({{< relref "/ChapterFour/0500~0599/0547.Number-of-Provinces.md" >}})|Medium||||63.8%| +|0559|Maximum Depth of N-ary Tree|[Go]({{< relref "/ChapterFour/0500~0599/0559.Maximum-Depth-of-N-ary-Tree.md" >}})|Easy||||71.7%| +|0617|Merge Two Binary Trees|[Go]({{< relref "/ChapterFour/0600~0699/0617.Merge-Two-Binary-Trees.md" >}})|Easy||||78.7%| +|0623|Add One Row to Tree|[Go]({{< relref "/ChapterFour/0600~0699/0623.Add-One-Row-to-Tree.md" >}})|Medium||||59.5%| +|0637|Average of Levels in Binary Tree|[Go]({{< relref "/ChapterFour/0600~0699/0637.Average-of-Levels-in-Binary-Tree.md" >}})|Easy||||71.7%| +|0653|Two Sum IV - Input is a BST|[Go]({{< relref "/ChapterFour/0600~0699/0653.Two-Sum-IV-Input-is-a-BST.md" >}})|Easy||||61.0%| +|0662|Maximum Width of Binary Tree|[Go]({{< relref "/ChapterFour/0600~0699/0662.Maximum-Width-of-Binary-Tree.md" >}})|Medium||||40.7%| +|0684|Redundant Connection|[Go]({{< relref "/ChapterFour/0600~0699/0684.Redundant-Connection.md" >}})|Medium||||62.2%| +|0685|Redundant Connection II|[Go]({{< relref "/ChapterFour/0600~0699/0685.Redundant-Connection-II.md" >}})|Hard||||34.1%| +|0690|Employee Importance|[Go]({{< relref "/ChapterFour/0600~0699/0690.Employee-Importance.md" >}})|Medium||||65.6%| +|0695|Max Area of Island|[Go]({{< relref "/ChapterFour/0600~0699/0695.Max-Area-of-Island.md" >}})|Medium||||71.8%| +|0721|Accounts Merge|[Go]({{< relref "/ChapterFour/0700~0799/0721.Accounts-Merge.md" >}})|Medium||||56.3%| +|0733|Flood Fill|[Go]({{< relref "/ChapterFour/0700~0799/0733.Flood-Fill.md" >}})|Easy||||62.0%| +|0752|Open the Lock|[Go]({{< relref "/ChapterFour/0700~0799/0752.Open-the-Lock.md" >}})|Medium||||55.6%| +|0756|Pyramid Transition Matrix|[Go]({{< relref "/ChapterFour/0700~0799/0756.Pyramid-Transition-Matrix.md" >}})|Medium||||52.7%| +|0765|Couples Holding Hands|[Go]({{< relref "/ChapterFour/0700~0799/0765.Couples-Holding-Hands.md" >}})|Hard||||56.6%| +|0778|Swim in Rising Water|[Go]({{< relref "/ChapterFour/0700~0799/0778.Swim-in-Rising-Water.md" >}})|Hard||||59.8%| +|0783|Minimum Distance Between BST Nodes|[Go]({{< relref "/ChapterFour/0700~0799/0783.Minimum-Distance-Between-BST-Nodes.md" >}})|Easy||||59.3%| +|0785|Is Graph Bipartite?|[Go]({{< relref "/ChapterFour/0700~0799/0785.Is-Graph-Bipartite.md" >}})|Medium||||53.1%| +|0802|Find Eventual Safe States|[Go]({{< relref "/ChapterFour/0800~0899/0802.Find-Eventual-Safe-States.md" >}})|Medium||||56.6%| +|0815|Bus Routes|[Go]({{< relref "/ChapterFour/0800~0899/0815.Bus-Routes.md" >}})|Hard||||45.6%| +|0839|Similar String Groups|[Go]({{< relref "/ChapterFour/0800~0899/0839.Similar-String-Groups.md" >}})|Hard||||48.0%| +|0841|Keys and Rooms|[Go]({{< relref "/ChapterFour/0800~0899/0841.Keys-and-Rooms.md" >}})|Medium||||71.5%| +|0863|All Nodes Distance K in Binary Tree|[Go]({{< relref "/ChapterFour/0800~0899/0863.All-Nodes-Distance-K-in-Binary-Tree.md" >}})|Medium||||62.3%| +|0864|Shortest Path to Get All Keys|[Go]({{< relref "/ChapterFour/0800~0899/0864.Shortest-Path-to-Get-All-Keys.md" >}})|Hard||||45.6%| +|0909|Snakes and Ladders|[Go]({{< relref "/ChapterFour/0900~0999/0909.Snakes-and-Ladders.md" >}})|Medium||||45.1%| +|0924|Minimize Malware Spread|[Go]({{< relref "/ChapterFour/0900~0999/0924.Minimize-Malware-Spread.md" >}})|Hard||||42.1%| +|0928|Minimize Malware Spread II|[Go]({{< relref "/ChapterFour/0900~0999/0928.Minimize-Malware-Spread-II.md" >}})|Hard||||42.8%| +|0958|Check Completeness of a Binary Tree|[Go]({{< relref "/ChapterFour/0900~0999/0958.Check-Completeness-of-a-Binary-Tree.md" >}})|Medium||||56.2%| +|0959|Regions Cut By Slashes|[Go]({{< relref "/ChapterFour/0900~0999/0959.Regions-Cut-By-Slashes.md" >}})|Medium||||69.1%| +|0987|Vertical Order Traversal of a Binary Tree|[Go]({{< relref "/ChapterFour/0900~0999/0987.Vertical-Order-Traversal-of-a-Binary-Tree.md" >}})|Hard||||45.1%| +|0993|Cousins in Binary Tree|[Go]({{< relref "/ChapterFour/0900~0999/0993.Cousins-in-Binary-Tree.md" >}})|Easy| O(n)| O(1)||54.6%| +|1020|Number of Enclaves|[Go]({{< relref "/ChapterFour/1000~1099/1020.Number-of-Enclaves.md" >}})|Medium||||65.6%| +|1034|Coloring A Border|[Go]({{< relref "/ChapterFour/1000~1099/1034.Coloring-A-Border.md" >}})|Medium||||49.2%| +|1091|Shortest Path in Binary Matrix|[Go]({{< relref "/ChapterFour/1000~1099/1091.Shortest-Path-in-Binary-Matrix.md" >}})|Medium||||44.7%| +|1123|Lowest Common Ancestor of Deepest Leaves|[Go]({{< relref "/ChapterFour/1100~1199/1123.Lowest-Common-Ancestor-of-Deepest-Leaves.md" >}})|Medium||||70.9%| +|1202|Smallest String With Swaps|[Go]({{< relref "/ChapterFour/1200~1299/1202.Smallest-String-With-Swaps.md" >}})|Medium||||57.7%| +|1203|Sort Items by Groups Respecting Dependencies|[Go]({{< relref "/ChapterFour/1200~1299/1203.Sort-Items-by-Groups-Respecting-Dependencies.md" >}})|Hard||||51.2%| +|1254|Number of Closed Islands|[Go]({{< relref "/ChapterFour/1200~1299/1254.Number-of-Closed-Islands.md" >}})|Medium||||66.9%| +|1293|Shortest Path in a Grid with Obstacles Elimination|[Go]({{< relref "/ChapterFour/1200~1299/1293.Shortest-Path-in-a-Grid-with-Obstacles-Elimination.md" >}})|Hard||||45.3%| +|1302|Deepest Leaves Sum|[Go]({{< relref "/ChapterFour/1300~1399/1302.Deepest-Leaves-Sum.md" >}})|Medium||||86.6%| +|1306|Jump Game III|[Go]({{< relref "/ChapterFour/1300~1399/1306.Jump-Game-III.md" >}})|Medium||||63.5%| +|1319|Number of Operations to Make Network Connected|[Go]({{< relref "/ChapterFour/1300~1399/1319.Number-of-Operations-to-Make-Network-Connected.md" >}})|Medium||||62.1%| +|1609|Even Odd Tree|[Go]({{< relref "/ChapterFour/1600~1699/1609.Even-Odd-Tree.md" >}})|Medium||||54.4%| +|1631|Path With Minimum Effort|[Go]({{< relref "/ChapterFour/1600~1699/1631.Path-With-Minimum-Effort.md" >}})|Medium||||55.7%| +|1654|Minimum Jumps to Reach Home|[Go]({{< relref "/ChapterFour/1600~1699/1654.Minimum-Jumps-to-Reach-Home.md" >}})|Medium||||29.1%| |------------|-------------------------------------------------------|-------| ----------------| ---------------|-------------|-------------|-------------| diff --git a/website/content/ChapterTwo/Depth_First_Search.md b/website/content/ChapterTwo/Depth_First_Search.md index ee295c856..ac15634e1 100644 --- a/website/content/ChapterTwo/Depth_First_Search.md +++ b/website/content/ChapterTwo/Depth_First_Search.md @@ -9,110 +9,113 @@ weight: 9 | No. | Title | Solution | Difficulty | TimeComplexity | SpaceComplexity |Favorite| Acceptance | |:--------:|:------- | :--------: | :----------: | :----: | :-----: | :-----: |:-----: | -|0094|Binary Tree Inorder Traversal|[Go]({{< relref "/ChapterFour/0001~0099/0094.Binary-Tree-Inorder-Traversal.md" >}})|Easy||||70.8%| -|0098|Validate Binary Search Tree|[Go]({{< relref "/ChapterFour/0001~0099/0098.Validate-Binary-Search-Tree.md" >}})|Medium| O(n)| O(1)||30.5%| -|0099|Recover Binary Search Tree|[Go]({{< relref "/ChapterFour/0001~0099/0099.Recover-Binary-Search-Tree.md" >}})|Medium| O(n)| O(1)||48.7%| -|0100|Same Tree|[Go]({{< relref "/ChapterFour/0100~0199/0100.Same-Tree.md" >}})|Easy| O(n)| O(1)||55.5%| -|0101|Symmetric Tree|[Go]({{< relref "/ChapterFour/0100~0199/0101.Symmetric-Tree.md" >}})|Easy| O(n)| O(1)||51.6%| -|0104|Maximum Depth of Binary Tree|[Go]({{< relref "/ChapterFour/0100~0199/0104.Maximum-Depth-of-Binary-Tree.md" >}})|Easy| O(n)| O(1)||71.9%| -|0110|Balanced Binary Tree|[Go]({{< relref "/ChapterFour/0100~0199/0110.Balanced-Binary-Tree.md" >}})|Easy| O(n)| O(1)||46.8%| -|0111|Minimum Depth of Binary Tree|[Go]({{< relref "/ChapterFour/0100~0199/0111.Minimum-Depth-of-Binary-Tree.md" >}})|Easy| O(n)| O(1)||42.5%| -|0112|Path Sum|[Go]({{< relref "/ChapterFour/0100~0199/0112.Path-Sum.md" >}})|Easy| O(n)| O(1)||45.5%| -|0113|Path Sum II|[Go]({{< relref "/ChapterFour/0100~0199/0113.Path-Sum-II.md" >}})|Medium| O(n)| O(1)||54.0%| -|0114|Flatten Binary Tree to Linked List|[Go]({{< relref "/ChapterFour/0100~0199/0114.Flatten-Binary-Tree-to-Linked-List.md" >}})|Medium| O(n)| O(1)||57.8%| -|0116|Populating Next Right Pointers in Each Node|[Go]({{< relref "/ChapterFour/0100~0199/0116.Populating-Next-Right-Pointers-in-Each-Node.md" >}})|Medium||||57.0%| -|0124|Binary Tree Maximum Path Sum|[Go]({{< relref "/ChapterFour/0100~0199/0124.Binary-Tree-Maximum-Path-Sum.md" >}})|Hard| O(n)| O(1)||37.7%| -|0129|Sum Root to Leaf Numbers|[Go]({{< relref "/ChapterFour/0100~0199/0129.Sum-Root-to-Leaf-Numbers.md" >}})|Medium| O(n)| O(1)||57.0%| -|0130|Surrounded Regions|[Go]({{< relref "/ChapterFour/0100~0199/0130.Surrounded-Regions.md" >}})|Medium||||34.0%| -|0144|Binary Tree Preorder Traversal|[Go]({{< relref "/ChapterFour/0100~0199/0144.Binary-Tree-Preorder-Traversal.md" >}})|Easy||||62.5%| -|0145|Binary Tree Postorder Traversal|[Go]({{< relref "/ChapterFour/0100~0199/0145.Binary-Tree-Postorder-Traversal.md" >}})|Easy||||64.1%| -|0199|Binary Tree Right Side View|[Go]({{< relref "/ChapterFour/0100~0199/0199.Binary-Tree-Right-Side-View.md" >}})|Medium| O(n)| O(1)||59.6%| -|0200|Number of Islands|[Go]({{< relref "/ChapterFour/0200~0299/0200.Number-of-Islands.md" >}})|Medium| O(n^2)| O(n^2)||53.9%| -|0207|Course Schedule|[Go]({{< relref "/ChapterFour/0200~0299/0207.Course-Schedule.md" >}})|Medium| O(n^2)| O(n^2)||45.1%| -|0210|Course Schedule II|[Go]({{< relref "/ChapterFour/0200~0299/0210.Course-Schedule-II.md" >}})|Medium| O(n^2)| O(n^2)||46.6%| +|0094|Binary Tree Inorder Traversal|[Go]({{< relref "/ChapterFour/0001~0099/0094.Binary-Tree-Inorder-Traversal.md" >}})|Easy||||73.8%| +|0098|Validate Binary Search Tree|[Go]({{< relref "/ChapterFour/0001~0099/0098.Validate-Binary-Search-Tree.md" >}})|Medium| O(n)| O(1)||32.0%| +|0099|Recover Binary Search Tree|[Go]({{< relref "/ChapterFour/0001~0099/0099.Recover-Binary-Search-Tree.md" >}})|Medium| O(n)| O(1)||51.0%| +|0100|Same Tree|[Go]({{< relref "/ChapterFour/0100~0199/0100.Same-Tree.md" >}})|Easy| O(n)| O(1)||58.2%| +|0101|Symmetric Tree|[Go]({{< relref "/ChapterFour/0100~0199/0101.Symmetric-Tree.md" >}})|Easy| O(n)| O(1)||54.3%| +|0104|Maximum Depth of Binary Tree|[Go]({{< relref "/ChapterFour/0100~0199/0104.Maximum-Depth-of-Binary-Tree.md" >}})|Easy| O(n)| O(1)||73.9%| +|0110|Balanced Binary Tree|[Go]({{< relref "/ChapterFour/0100~0199/0110.Balanced-Binary-Tree.md" >}})|Easy| O(n)| O(1)||49.1%| +|0111|Minimum Depth of Binary Tree|[Go]({{< relref "/ChapterFour/0100~0199/0111.Minimum-Depth-of-Binary-Tree.md" >}})|Easy| O(n)| O(1)||44.5%| +|0112|Path Sum|[Go]({{< relref "/ChapterFour/0100~0199/0112.Path-Sum.md" >}})|Easy| O(n)| O(1)||48.3%| +|0113|Path Sum II|[Go]({{< relref "/ChapterFour/0100~0199/0113.Path-Sum-II.md" >}})|Medium| O(n)| O(1)||57.1%| +|0114|Flatten Binary Tree to Linked List|[Go]({{< relref "/ChapterFour/0100~0199/0114.Flatten-Binary-Tree-to-Linked-List.md" >}})|Medium| O(n)| O(1)||61.8%| +|0116|Populating Next Right Pointers in Each Node|[Go]({{< relref "/ChapterFour/0100~0199/0116.Populating-Next-Right-Pointers-in-Each-Node.md" >}})|Medium||||60.4%| +|0124|Binary Tree Maximum Path Sum|[Go]({{< relref "/ChapterFour/0100~0199/0124.Binary-Tree-Maximum-Path-Sum.md" >}})|Hard| O(n)| O(1)||39.2%| +|0129|Sum Root to Leaf Numbers|[Go]({{< relref "/ChapterFour/0100~0199/0129.Sum-Root-to-Leaf-Numbers.md" >}})|Medium| O(n)| O(1)||61.0%| +|0130|Surrounded Regions|[Go]({{< relref "/ChapterFour/0100~0199/0130.Surrounded-Regions.md" >}})|Medium||||36.8%| +|0144|Binary Tree Preorder Traversal|[Go]({{< relref "/ChapterFour/0100~0199/0144.Binary-Tree-Preorder-Traversal.md" >}})|Easy||||66.9%| +|0145|Binary Tree Postorder Traversal|[Go]({{< relref "/ChapterFour/0100~0199/0145.Binary-Tree-Postorder-Traversal.md" >}})|Easy||||68.0%| +|0199|Binary Tree Right Side View|[Go]({{< relref "/ChapterFour/0100~0199/0199.Binary-Tree-Right-Side-View.md" >}})|Medium| O(n)| O(1)||61.6%| +|0200|Number of Islands|[Go]({{< relref "/ChapterFour/0200~0299/0200.Number-of-Islands.md" >}})|Medium| O(n^2)| O(n^2)||57.0%| +|0207|Course Schedule|[Go]({{< relref "/ChapterFour/0200~0299/0207.Course-Schedule.md" >}})|Medium| O(n^2)| O(n^2)||45.4%| +|0210|Course Schedule II|[Go]({{< relref "/ChapterFour/0200~0299/0210.Course-Schedule-II.md" >}})|Medium| O(n^2)| O(n^2)||48.5%| |0211|Design Add and Search Words Data Structure|[Go]({{< relref "/ChapterFour/0200~0299/0211.Design-Add-and-Search-Words-Data-Structure.md" >}})|Medium||||44.0%| -|0222|Count Complete Tree Nodes|[Go]({{< relref "/ChapterFour/0200~0299/0222.Count-Complete-Tree-Nodes.md" >}})|Medium||||55.3%| -|0226|Invert Binary Tree|[Go]({{< relref "/ChapterFour/0200~0299/0226.Invert-Binary-Tree.md" >}})|Easy||||71.6%| -|0230|Kth Smallest Element in a BST|[Go]({{< relref "/ChapterFour/0200~0299/0230.Kth-Smallest-Element-in-a-BST.md" >}})|Medium||||67.7%| -|0235|Lowest Common Ancestor of a Binary Search Tree|[Go]({{< relref "/ChapterFour/0200~0299/0235.Lowest-Common-Ancestor-of-a-Binary-Search-Tree.md" >}})|Easy||||57.0%| -|0236|Lowest Common Ancestor of a Binary Tree|[Go]({{< relref "/ChapterFour/0200~0299/0236.Lowest-Common-Ancestor-of-a-Binary-Tree.md" >}})|Medium||||55.4%| -|0257|Binary Tree Paths|[Go]({{< relref "/ChapterFour/0200~0299/0257.Binary-Tree-Paths.md" >}})|Easy| O(n)| O(1)||58.7%| -|0297|Serialize and Deserialize Binary Tree|[Go]({{< relref "/ChapterFour/0200~0299/0297.Serialize-and-Deserialize-Binary-Tree.md" >}})|Hard||||53.8%| -|0329|Longest Increasing Path in a Matrix|[Go]({{< relref "/ChapterFour/0300~0399/0329.Longest-Increasing-Path-in-a-Matrix.md" >}})|Hard||||49.7%| -|0337|House Robber III|[Go]({{< relref "/ChapterFour/0300~0399/0337.House-Robber-III.md" >}})|Medium||||53.5%| -|0341|Flatten Nested List Iterator|[Go]({{< relref "/ChapterFour/0300~0399/0341.Flatten-Nested-List-Iterator.md" >}})|Medium||||58.8%| -|0385|Mini Parser|[Go]({{< relref "/ChapterFour/0300~0399/0385.Mini-Parser.md" >}})|Medium||||35.9%| -|0386|Lexicographical Numbers|[Go]({{< relref "/ChapterFour/0300~0399/0386.Lexicographical-Numbers.md" >}})|Medium||||58.9%| -|0399|Evaluate Division|[Go]({{< relref "/ChapterFour/0300~0399/0399.Evaluate-Division.md" >}})|Medium||||58.6%| -|0404|Sum of Left Leaves|[Go]({{< relref "/ChapterFour/0400~0499/0404.Sum-of-Left-Leaves.md" >}})|Easy||||55.1%| -|0417|Pacific Atlantic Water Flow|[Go]({{< relref "/ChapterFour/0400~0499/0417.Pacific-Atlantic-Water-Flow.md" >}})|Medium||||49.2%| -|0437|Path Sum III|[Go]({{< relref "/ChapterFour/0400~0499/0437.Path-Sum-III.md" >}})|Medium||||50.1%| -|0463|Island Perimeter|[Go]({{< relref "/ChapterFour/0400~0499/0463.Island-Perimeter.md" >}})|Easy||||69.0%| -|0508|Most Frequent Subtree Sum|[Go]({{< relref "/ChapterFour/0500~0599/0508.Most-Frequent-Subtree-Sum.md" >}})|Medium||||62.8%| -|0513|Find Bottom Left Tree Value|[Go]({{< relref "/ChapterFour/0500~0599/0513.Find-Bottom-Left-Tree-Value.md" >}})|Medium||||65.2%| -|0515|Find Largest Value in Each Tree Row|[Go]({{< relref "/ChapterFour/0500~0599/0515.Find-Largest-Value-in-Each-Tree-Row.md" >}})|Medium| O(n)| O(n)||64.5%| -|0529|Minesweeper|[Go]({{< relref "/ChapterFour/0500~0599/0529.Minesweeper.md" >}})|Medium||||64.7%| -|0530|Minimum Absolute Difference in BST|[Go]({{< relref "/ChapterFour/0500~0599/0530.Minimum-Absolute-Difference-in-BST.md" >}})|Easy||||56.3%| -|0538|Convert BST to Greater Tree|[Go]({{< relref "/ChapterFour/0500~0599/0538.Convert-BST-to-Greater-Tree.md" >}})|Medium||||66.2%| -|0543|Diameter of Binary Tree|[Go]({{< relref "/ChapterFour/0500~0599/0543.Diameter-of-Binary-Tree.md" >}})|Easy||||54.3%| -|0547|Number of Provinces|[Go]({{< relref "/ChapterFour/0500~0599/0547.Number-of-Provinces.md" >}})|Medium||||62.6%| -|0559|Maximum Depth of N-ary Tree|[Go]({{< relref "/ChapterFour/0500~0599/0559.Maximum-Depth-of-N-ary-Tree.md" >}})|Easy||||71.1%| -|0563|Binary Tree Tilt|[Go]({{< relref "/ChapterFour/0500~0599/0563.Binary-Tree-Tilt.md" >}})|Easy||||58.5%| -|0572|Subtree of Another Tree|[Go]({{< relref "/ChapterFour/0500~0599/0572.Subtree-of-Another-Tree.md" >}})|Easy||||45.4%| -|0589|N-ary Tree Preorder Traversal|[Go]({{< relref "/ChapterFour/0500~0599/0589.N-ary-Tree-Preorder-Traversal.md" >}})|Easy||||76.1%| -|0617|Merge Two Binary Trees|[Go]({{< relref "/ChapterFour/0600~0699/0617.Merge-Two-Binary-Trees.md" >}})|Easy||||77.9%| -|0623|Add One Row to Tree|[Go]({{< relref "/ChapterFour/0600~0699/0623.Add-One-Row-to-Tree.md" >}})|Medium||||53.9%| -|0637|Average of Levels in Binary Tree|[Go]({{< relref "/ChapterFour/0600~0699/0637.Average-of-Levels-in-Binary-Tree.md" >}})|Easy||||68.7%| -|0653|Two Sum IV - Input is a BST|[Go]({{< relref "/ChapterFour/0600~0699/0653.Two-Sum-IV-Input-is-a-BST.md" >}})|Easy||||58.8%| -|0662|Maximum Width of Binary Tree|[Go]({{< relref "/ChapterFour/0600~0699/0662.Maximum-Width-of-Binary-Tree.md" >}})|Medium||||40.3%| -|0669|Trim a Binary Search Tree|[Go]({{< relref "/ChapterFour/0600~0699/0669.Trim-a-Binary-Search-Tree.md" >}})|Medium||||66.3%| -|0684|Redundant Connection|[Go]({{< relref "/ChapterFour/0600~0699/0684.Redundant-Connection.md" >}})|Medium||||61.1%| -|0685|Redundant Connection II|[Go]({{< relref "/ChapterFour/0600~0699/0685.Redundant-Connection-II.md" >}})|Hard||||33.8%| -|0690|Employee Importance|[Go]({{< relref "/ChapterFour/0600~0699/0690.Employee-Importance.md" >}})|Medium||||64.0%| -|0695|Max Area of Island|[Go]({{< relref "/ChapterFour/0600~0699/0695.Max-Area-of-Island.md" >}})|Medium||||69.7%| -|0721|Accounts Merge|[Go]({{< relref "/ChapterFour/0700~0799/0721.Accounts-Merge.md" >}})|Medium||||55.9%| -|0733|Flood Fill|[Go]({{< relref "/ChapterFour/0700~0799/0733.Flood-Fill.md" >}})|Easy||||58.2%| -|0753|Cracking the Safe|[Go]({{< relref "/ChapterFour/0700~0799/0753.Cracking-the-Safe.md" >}})|Hard||||54.6%| -|0756|Pyramid Transition Matrix|[Go]({{< relref "/ChapterFour/0700~0799/0756.Pyramid-Transition-Matrix.md" >}})|Medium||||54.6%| -|0765|Couples Holding Hands|[Go]({{< relref "/ChapterFour/0700~0799/0765.Couples-Holding-Hands.md" >}})|Hard||||56.5%| -|0778|Swim in Rising Water|[Go]({{< relref "/ChapterFour/0700~0799/0778.Swim-in-Rising-Water.md" >}})|Hard||||58.7%| -|0783|Minimum Distance Between BST Nodes|[Go]({{< relref "/ChapterFour/0700~0799/0783.Minimum-Distance-Between-BST-Nodes.md" >}})|Easy||||56.1%| -|0785|Is Graph Bipartite?|[Go]({{< relref "/ChapterFour/0700~0799/0785.Is-Graph-Bipartite.md" >}})|Medium||||51.6%| -|0802|Find Eventual Safe States|[Go]({{< relref "/ChapterFour/0800~0899/0802.Find-Eventual-Safe-States.md" >}})|Medium||||52.6%| -|0834|Sum of Distances in Tree|[Go]({{< relref "/ChapterFour/0800~0899/0834.Sum-of-Distances-in-Tree.md" >}})|Hard||||53.0%| -|0839|Similar String Groups|[Go]({{< relref "/ChapterFour/0800~0899/0839.Similar-String-Groups.md" >}})|Hard||||45.5%| -|0841|Keys and Rooms|[Go]({{< relref "/ChapterFour/0800~0899/0841.Keys-and-Rooms.md" >}})|Medium||||69.0%| -|0851|Loud and Rich|[Go]({{< relref "/ChapterFour/0800~0899/0851.Loud-and-Rich.md" >}})|Medium||||56.7%| -|0863|All Nodes Distance K in Binary Tree|[Go]({{< relref "/ChapterFour/0800~0899/0863.All-Nodes-Distance-K-in-Binary-Tree.md" >}})|Medium||||61.1%| -|0872|Leaf-Similar Trees|[Go]({{< relref "/ChapterFour/0800~0899/0872.Leaf-Similar-Trees.md" >}})|Easy||||65.0%| -|0897|Increasing Order Search Tree|[Go]({{< relref "/ChapterFour/0800~0899/0897.Increasing-Order-Search-Tree.md" >}})|Easy||||78.3%| -|0924|Minimize Malware Spread|[Go]({{< relref "/ChapterFour/0900~0999/0924.Minimize-Malware-Spread.md" >}})|Hard||||41.9%| -|0928|Minimize Malware Spread II|[Go]({{< relref "/ChapterFour/0900~0999/0928.Minimize-Malware-Spread-II.md" >}})|Hard||||42.3%| -|0938|Range Sum of BST|[Go]({{< relref "/ChapterFour/0900~0999/0938.Range-Sum-of-BST.md" >}})|Easy||||85.1%| -|0947|Most Stones Removed with Same Row or Column|[Go]({{< relref "/ChapterFour/0900~0999/0947.Most-Stones-Removed-with-Same-Row-or-Column.md" >}})|Medium||||56.3%| -|0959|Regions Cut By Slashes|[Go]({{< relref "/ChapterFour/0900~0999/0959.Regions-Cut-By-Slashes.md" >}})|Medium||||68.6%| -|0968|Binary Tree Cameras|[Go]({{< relref "/ChapterFour/0900~0999/0968.Binary-Tree-Cameras.md" >}})|Hard||||41.9%| -|0971|Flip Binary Tree To Match Preorder Traversal|[Go]({{< relref "/ChapterFour/0900~0999/0971.Flip-Binary-Tree-To-Match-Preorder-Traversal.md" >}})|Medium||||49.9%| -|0979|Distribute Coins in Binary Tree|[Go]({{< relref "/ChapterFour/0900~0999/0979.Distribute-Coins-in-Binary-Tree.md" >}})|Medium||||71.6%| -|0987|Vertical Order Traversal of a Binary Tree|[Go]({{< relref "/ChapterFour/0900~0999/0987.Vertical-Order-Traversal-of-a-Binary-Tree.md" >}})|Hard||||41.6%| -|0993|Cousins in Binary Tree|[Go]({{< relref "/ChapterFour/0900~0999/0993.Cousins-in-Binary-Tree.md" >}})|Easy||||53.8%| -|1020|Number of Enclaves|[Go]({{< relref "/ChapterFour/1000~1099/1020.Number-of-Enclaves.md" >}})|Medium||||62.8%| -|1026|Maximum Difference Between Node and Ancestor|[Go]({{< relref "/ChapterFour/1000~1099/1026.Maximum-Difference-Between-Node-and-Ancestor.md" >}})|Medium||||73.2%| -|1028|Recover a Tree From Preorder Traversal|[Go]({{< relref "/ChapterFour/1000~1099/1028.Recover-a-Tree-From-Preorder-Traversal.md" >}})|Hard||||72.4%| -|1034|Coloring A Border|[Go]({{< relref "/ChapterFour/1000~1099/1034.Coloring-A-Border.md" >}})|Medium||||48.4%| -|1038|Binary Search Tree to Greater Sum Tree|[Go]({{< relref "/ChapterFour/1000~1099/1038.Binary-Search-Tree-to-Greater-Sum-Tree.md" >}})|Medium||||84.8%| +|0222|Count Complete Tree Nodes|[Go]({{< relref "/ChapterFour/0200~0299/0222.Count-Complete-Tree-Nodes.md" >}})|Medium||||60.6%| +|0226|Invert Binary Tree|[Go]({{< relref "/ChapterFour/0200~0299/0226.Invert-Binary-Tree.md" >}})|Easy||||74.7%| +|0230|Kth Smallest Element in a BST|[Go]({{< relref "/ChapterFour/0200~0299/0230.Kth-Smallest-Element-in-a-BST.md" >}})|Medium||||70.2%| +|0235|Lowest Common Ancestor of a Binary Search Tree|[Go]({{< relref "/ChapterFour/0200~0299/0235.Lowest-Common-Ancestor-of-a-Binary-Search-Tree.md" >}})|Medium||||61.6%| +|0236|Lowest Common Ancestor of a Binary Tree|[Go]({{< relref "/ChapterFour/0200~0299/0236.Lowest-Common-Ancestor-of-a-Binary-Tree.md" >}})|Medium||||58.8%| +|0257|Binary Tree Paths|[Go]({{< relref "/ChapterFour/0200~0299/0257.Binary-Tree-Paths.md" >}})|Easy| O(n)| O(1)||61.4%| +|0297|Serialize and Deserialize Binary Tree|[Go]({{< relref "/ChapterFour/0200~0299/0297.Serialize-and-Deserialize-Binary-Tree.md" >}})|Hard||||55.4%| +|0329|Longest Increasing Path in a Matrix|[Go]({{< relref "/ChapterFour/0300~0399/0329.Longest-Increasing-Path-in-a-Matrix.md" >}})|Hard||||52.4%| +|0337|House Robber III|[Go]({{< relref "/ChapterFour/0300~0399/0337.House-Robber-III.md" >}})|Medium||||53.9%| +|0341|Flatten Nested List Iterator|[Go]({{< relref "/ChapterFour/0300~0399/0341.Flatten-Nested-List-Iterator.md" >}})|Medium||||61.8%| +|0385|Mini Parser|[Go]({{< relref "/ChapterFour/0300~0399/0385.Mini-Parser.md" >}})|Medium||||36.9%| +|0386|Lexicographical Numbers|[Go]({{< relref "/ChapterFour/0300~0399/0386.Lexicographical-Numbers.md" >}})|Medium||||61.6%| +|0399|Evaluate Division|[Go]({{< relref "/ChapterFour/0300~0399/0399.Evaluate-Division.md" >}})|Medium||||59.7%| +|0404|Sum of Left Leaves|[Go]({{< relref "/ChapterFour/0400~0499/0404.Sum-of-Left-Leaves.md" >}})|Easy||||56.7%| +|0417|Pacific Atlantic Water Flow|[Go]({{< relref "/ChapterFour/0400~0499/0417.Pacific-Atlantic-Water-Flow.md" >}})|Medium||||54.4%| +|0419|Battleships in a Board|[Go]({{< relref "/ChapterFour/0400~0499/0419.Battleships-in-a-Board.md" >}})|Medium||||74.8%| +|0437|Path Sum III|[Go]({{< relref "/ChapterFour/0400~0499/0437.Path-Sum-III.md" >}})|Medium||||48.0%| +|0463|Island Perimeter|[Go]({{< relref "/ChapterFour/0400~0499/0463.Island-Perimeter.md" >}})|Easy||||69.7%| +|0508|Most Frequent Subtree Sum|[Go]({{< relref "/ChapterFour/0500~0599/0508.Most-Frequent-Subtree-Sum.md" >}})|Medium||||64.9%| +|0513|Find Bottom Left Tree Value|[Go]({{< relref "/ChapterFour/0500~0599/0513.Find-Bottom-Left-Tree-Value.md" >}})|Medium||||66.9%| +|0515|Find Largest Value in Each Tree Row|[Go]({{< relref "/ChapterFour/0500~0599/0515.Find-Largest-Value-in-Each-Tree-Row.md" >}})|Medium| O(n)| O(n)||64.6%| +|0529|Minesweeper|[Go]({{< relref "/ChapterFour/0500~0599/0529.Minesweeper.md" >}})|Medium||||65.7%| +|0530|Minimum Absolute Difference in BST|[Go]({{< relref "/ChapterFour/0500~0599/0530.Minimum-Absolute-Difference-in-BST.md" >}})|Easy||||57.3%| +|0538|Convert BST to Greater Tree|[Go]({{< relref "/ChapterFour/0500~0599/0538.Convert-BST-to-Greater-Tree.md" >}})|Medium||||67.8%| +|0543|Diameter of Binary Tree|[Go]({{< relref "/ChapterFour/0500~0599/0543.Diameter-of-Binary-Tree.md" >}})|Easy||||56.8%| +|0547|Number of Provinces|[Go]({{< relref "/ChapterFour/0500~0599/0547.Number-of-Provinces.md" >}})|Medium||||63.8%| +|0559|Maximum Depth of N-ary Tree|[Go]({{< relref "/ChapterFour/0500~0599/0559.Maximum-Depth-of-N-ary-Tree.md" >}})|Easy||||71.7%| +|0563|Binary Tree Tilt|[Go]({{< relref "/ChapterFour/0500~0599/0563.Binary-Tree-Tilt.md" >}})|Easy||||60.1%| +|0572|Subtree of Another Tree|[Go]({{< relref "/ChapterFour/0500~0599/0572.Subtree-of-Another-Tree.md" >}})|Easy||||46.4%| +|0589|N-ary Tree Preorder Traversal|[Go]({{< relref "/ChapterFour/0500~0599/0589.N-ary-Tree-Preorder-Traversal.md" >}})|Easy||||75.8%| +|0617|Merge Two Binary Trees|[Go]({{< relref "/ChapterFour/0600~0699/0617.Merge-Two-Binary-Trees.md" >}})|Easy||||78.7%| +|0623|Add One Row to Tree|[Go]({{< relref "/ChapterFour/0600~0699/0623.Add-One-Row-to-Tree.md" >}})|Medium||||59.5%| +|0637|Average of Levels in Binary Tree|[Go]({{< relref "/ChapterFour/0600~0699/0637.Average-of-Levels-in-Binary-Tree.md" >}})|Easy||||71.7%| +|0653|Two Sum IV - Input is a BST|[Go]({{< relref "/ChapterFour/0600~0699/0653.Two-Sum-IV-Input-is-a-BST.md" >}})|Easy||||61.0%| +|0662|Maximum Width of Binary Tree|[Go]({{< relref "/ChapterFour/0600~0699/0662.Maximum-Width-of-Binary-Tree.md" >}})|Medium||||40.7%| +|0669|Trim a Binary Search Tree|[Go]({{< relref "/ChapterFour/0600~0699/0669.Trim-a-Binary-Search-Tree.md" >}})|Medium||||66.4%| +|0684|Redundant Connection|[Go]({{< relref "/ChapterFour/0600~0699/0684.Redundant-Connection.md" >}})|Medium||||62.2%| +|0685|Redundant Connection II|[Go]({{< relref "/ChapterFour/0600~0699/0685.Redundant-Connection-II.md" >}})|Hard||||34.1%| +|0690|Employee Importance|[Go]({{< relref "/ChapterFour/0600~0699/0690.Employee-Importance.md" >}})|Medium||||65.6%| +|0695|Max Area of Island|[Go]({{< relref "/ChapterFour/0600~0699/0695.Max-Area-of-Island.md" >}})|Medium||||71.8%| +|0721|Accounts Merge|[Go]({{< relref "/ChapterFour/0700~0799/0721.Accounts-Merge.md" >}})|Medium||||56.3%| +|0733|Flood Fill|[Go]({{< relref "/ChapterFour/0700~0799/0733.Flood-Fill.md" >}})|Easy||||62.0%| +|0753|Cracking the Safe|[Go]({{< relref "/ChapterFour/0700~0799/0753.Cracking-the-Safe.md" >}})|Hard||||55.8%| +|0756|Pyramid Transition Matrix|[Go]({{< relref "/ChapterFour/0700~0799/0756.Pyramid-Transition-Matrix.md" >}})|Medium||||52.7%| +|0765|Couples Holding Hands|[Go]({{< relref "/ChapterFour/0700~0799/0765.Couples-Holding-Hands.md" >}})|Hard||||56.6%| +|0778|Swim in Rising Water|[Go]({{< relref "/ChapterFour/0700~0799/0778.Swim-in-Rising-Water.md" >}})|Hard||||59.8%| +|0783|Minimum Distance Between BST Nodes|[Go]({{< relref "/ChapterFour/0700~0799/0783.Minimum-Distance-Between-BST-Nodes.md" >}})|Easy||||59.3%| +|0785|Is Graph Bipartite?|[Go]({{< relref "/ChapterFour/0700~0799/0785.Is-Graph-Bipartite.md" >}})|Medium||||53.1%| +|0802|Find Eventual Safe States|[Go]({{< relref "/ChapterFour/0800~0899/0802.Find-Eventual-Safe-States.md" >}})|Medium||||56.6%| +|0834|Sum of Distances in Tree|[Go]({{< relref "/ChapterFour/0800~0899/0834.Sum-of-Distances-in-Tree.md" >}})|Hard||||59.1%| +|0839|Similar String Groups|[Go]({{< relref "/ChapterFour/0800~0899/0839.Similar-String-Groups.md" >}})|Hard||||48.0%| +|0841|Keys and Rooms|[Go]({{< relref "/ChapterFour/0800~0899/0841.Keys-and-Rooms.md" >}})|Medium||||71.5%| +|0851|Loud and Rich|[Go]({{< relref "/ChapterFour/0800~0899/0851.Loud-and-Rich.md" >}})|Medium||||58.4%| +|0863|All Nodes Distance K in Binary Tree|[Go]({{< relref "/ChapterFour/0800~0899/0863.All-Nodes-Distance-K-in-Binary-Tree.md" >}})|Medium||||62.3%| +|0872|Leaf-Similar Trees|[Go]({{< relref "/ChapterFour/0800~0899/0872.Leaf-Similar-Trees.md" >}})|Easy||||67.6%| +|0897|Increasing Order Search Tree|[Go]({{< relref "/ChapterFour/0800~0899/0897.Increasing-Order-Search-Tree.md" >}})|Easy||||78.4%| +|0924|Minimize Malware Spread|[Go]({{< relref "/ChapterFour/0900~0999/0924.Minimize-Malware-Spread.md" >}})|Hard||||42.1%| +|0928|Minimize Malware Spread II|[Go]({{< relref "/ChapterFour/0900~0999/0928.Minimize-Malware-Spread-II.md" >}})|Hard||||42.8%| +|0938|Range Sum of BST|[Go]({{< relref "/ChapterFour/0900~0999/0938.Range-Sum-of-BST.md" >}})|Easy||||85.9%| +|0947|Most Stones Removed with Same Row or Column|[Go]({{< relref "/ChapterFour/0900~0999/0947.Most-Stones-Removed-with-Same-Row-or-Column.md" >}})|Medium||||58.9%| +|0959|Regions Cut By Slashes|[Go]({{< relref "/ChapterFour/0900~0999/0959.Regions-Cut-By-Slashes.md" >}})|Medium||||69.1%| +|0968|Binary Tree Cameras|[Go]({{< relref "/ChapterFour/0900~0999/0968.Binary-Tree-Cameras.md" >}})|Hard||||46.6%| +|0971|Flip Binary Tree To Match Preorder Traversal|[Go]({{< relref "/ChapterFour/0900~0999/0971.Flip-Binary-Tree-To-Match-Preorder-Traversal.md" >}})|Medium||||50.0%| +|0979|Distribute Coins in Binary Tree|[Go]({{< relref "/ChapterFour/0900~0999/0979.Distribute-Coins-in-Binary-Tree.md" >}})|Medium||||72.2%| +|0987|Vertical Order Traversal of a Binary Tree|[Go]({{< relref "/ChapterFour/0900~0999/0987.Vertical-Order-Traversal-of-a-Binary-Tree.md" >}})|Hard||||45.1%| +|0993|Cousins in Binary Tree|[Go]({{< relref "/ChapterFour/0900~0999/0993.Cousins-in-Binary-Tree.md" >}})|Easy||||54.6%| +|1020|Number of Enclaves|[Go]({{< relref "/ChapterFour/1000~1099/1020.Number-of-Enclaves.md" >}})|Medium||||65.6%| +|1022|Sum of Root To Leaf Binary Numbers|[Go]({{< relref "/ChapterFour/1000~1099/1022.Sum-of-Root-To-Leaf-Binary-Numbers.md" >}})|Easy||||73.5%| +|1026|Maximum Difference Between Node and Ancestor|[Go]({{< relref "/ChapterFour/1000~1099/1026.Maximum-Difference-Between-Node-and-Ancestor.md" >}})|Medium||||75.8%| +|1028|Recover a Tree From Preorder Traversal|[Go]({{< relref "/ChapterFour/1000~1099/1028.Recover-a-Tree-From-Preorder-Traversal.md" >}})|Hard||||73.3%| +|1034|Coloring A Border|[Go]({{< relref "/ChapterFour/1000~1099/1034.Coloring-A-Border.md" >}})|Medium||||49.2%| +|1038|Binary Search Tree to Greater Sum Tree|[Go]({{< relref "/ChapterFour/1000~1099/1038.Binary-Search-Tree-to-Greater-Sum-Tree.md" >}})|Medium||||85.5%| |1110|Delete Nodes And Return Forest|[Go]({{< relref "/ChapterFour/1100~1199/1110.Delete-Nodes-And-Return-Forest.md" >}})|Medium||||69.3%| -|1123|Lowest Common Ancestor of Deepest Leaves|[Go]({{< relref "/ChapterFour/1100~1199/1123.Lowest-Common-Ancestor-of-Deepest-Leaves.md" >}})|Medium||||70.2%| -|1145|Binary Tree Coloring Game|[Go]({{< relref "/ChapterFour/1100~1199/1145.Binary-Tree-Coloring-Game.md" >}})|Medium||||51.2%| -|1202|Smallest String With Swaps|[Go]({{< relref "/ChapterFour/1200~1299/1202.Smallest-String-With-Swaps.md" >}})|Medium||||57.1%| -|1203|Sort Items by Groups Respecting Dependencies|[Go]({{< relref "/ChapterFour/1200~1299/1203.Sort-Items-by-Groups-Respecting-Dependencies.md" >}})|Hard||||49.5%| -|1254|Number of Closed Islands|[Go]({{< relref "/ChapterFour/1200~1299/1254.Number-of-Closed-Islands.md" >}})|Medium||||63.4%| -|1302|Deepest Leaves Sum|[Go]({{< relref "/ChapterFour/1300~1399/1302.Deepest-Leaves-Sum.md" >}})|Medium||||85.7%| -|1305|All Elements in Two Binary Search Trees|[Go]({{< relref "/ChapterFour/1300~1399/1305.All-Elements-in-Two-Binary-Search-Trees.md" >}})|Medium||||79.6%| -|1306|Jump Game III|[Go]({{< relref "/ChapterFour/1300~1399/1306.Jump-Game-III.md" >}})|Medium||||62.8%| -|1319|Number of Operations to Make Network Connected|[Go]({{< relref "/ChapterFour/1300~1399/1319.Number-of-Operations-to-Make-Network-Connected.md" >}})|Medium||||57.8%| -|1600|Throne Inheritance|[Go]({{< relref "/ChapterFour/1600~1699/1600.Throne-Inheritance.md" >}})|Medium||||63.2%| -|1631|Path With Minimum Effort|[Go]({{< relref "/ChapterFour/1600~1699/1631.Path-With-Minimum-Effort.md" >}})|Medium||||55.0%| +|1123|Lowest Common Ancestor of Deepest Leaves|[Go]({{< relref "/ChapterFour/1100~1199/1123.Lowest-Common-Ancestor-of-Deepest-Leaves.md" >}})|Medium||||70.9%| +|1145|Binary Tree Coloring Game|[Go]({{< relref "/ChapterFour/1100~1199/1145.Binary-Tree-Coloring-Game.md" >}})|Medium||||51.7%| +|1202|Smallest String With Swaps|[Go]({{< relref "/ChapterFour/1200~1299/1202.Smallest-String-With-Swaps.md" >}})|Medium||||57.7%| +|1203|Sort Items by Groups Respecting Dependencies|[Go]({{< relref "/ChapterFour/1200~1299/1203.Sort-Items-by-Groups-Respecting-Dependencies.md" >}})|Hard||||51.2%| +|1254|Number of Closed Islands|[Go]({{< relref "/ChapterFour/1200~1299/1254.Number-of-Closed-Islands.md" >}})|Medium||||66.9%| +|1302|Deepest Leaves Sum|[Go]({{< relref "/ChapterFour/1300~1399/1302.Deepest-Leaves-Sum.md" >}})|Medium||||86.6%| +|1305|All Elements in Two Binary Search Trees|[Go]({{< relref "/ChapterFour/1300~1399/1305.All-Elements-in-Two-Binary-Search-Trees.md" >}})|Medium||||79.8%| +|1306|Jump Game III|[Go]({{< relref "/ChapterFour/1300~1399/1306.Jump-Game-III.md" >}})|Medium||||63.5%| +|1319|Number of Operations to Make Network Connected|[Go]({{< relref "/ChapterFour/1300~1399/1319.Number-of-Operations-to-Make-Network-Connected.md" >}})|Medium||||62.1%| +|1600|Throne Inheritance|[Go]({{< relref "/ChapterFour/1600~1699/1600.Throne-Inheritance.md" >}})|Medium||||63.6%| +|1631|Path With Minimum Effort|[Go]({{< relref "/ChapterFour/1600~1699/1631.Path-With-Minimum-Effort.md" >}})|Medium||||55.7%| +|2096|Step-By-Step Directions From a Binary Tree Node to Another|[Go]({{< relref "/ChapterFour/2000~2099/2096.Step-By-Step-Directions-From-a-Binary-Tree-Node-to-Another.md" >}})|Medium||||48.5%| |------------|-------------------------------------------------------|-------| ----------------| ---------------|-------------|-------------|-------------| diff --git a/website/content/ChapterTwo/Dynamic_Programming.md b/website/content/ChapterTwo/Dynamic_Programming.md index 06ba4b13a..79c094207 100644 --- a/website/content/ChapterTwo/Dynamic_Programming.md +++ b/website/content/ChapterTwo/Dynamic_Programming.md @@ -9,103 +9,104 @@ weight: 7 | No. | Title | Solution | Difficulty | TimeComplexity | SpaceComplexity |Favorite| Acceptance | |:--------:|:------- | :--------: | :----------: | :----: | :-----: | :-----: |:-----: | -|0005|Longest Palindromic Substring|[Go]({{< relref "/ChapterFour/0001~0099/0005.Longest-Palindromic-Substring.md" >}})|Medium||||31.8%| -|0022|Generate Parentheses|[Go]({{< relref "/ChapterFour/0001~0099/0022.Generate-Parentheses.md" >}})|Medium||||70.1%| -|0032|Longest Valid Parentheses|[Go]({{< relref "/ChapterFour/0001~0099/0032.Longest-Valid-Parentheses.md" >}})|Hard||||31.3%| -|0042|Trapping Rain Water|[Go]({{< relref "/ChapterFour/0001~0099/0042.Trapping-Rain-Water.md" >}})|Hard||||56.5%| -|0045|Jump Game II|[Go]({{< relref "/ChapterFour/0001~0099/0045.Jump-Game-II.md" >}})|Medium||||37.1%| -|0053|Maximum Subarray|[Go]({{< relref "/ChapterFour/0001~0099/0053.Maximum-Subarray.md" >}})|Easy| O(n)| O(n)||49.5%| -|0055|Jump Game|[Go]({{< relref "/ChapterFour/0001~0099/0055.Jump-Game.md" >}})|Medium||||37.8%| -|0062|Unique Paths|[Go]({{< relref "/ChapterFour/0001~0099/0062.Unique-Paths.md" >}})|Medium| O(n^2)| O(n^2)||60.0%| -|0063|Unique Paths II|[Go]({{< relref "/ChapterFour/0001~0099/0063.Unique-Paths-II.md" >}})|Medium| O(n^2)| O(n^2)||37.5%| -|0064|Minimum Path Sum|[Go]({{< relref "/ChapterFour/0001~0099/0064.Minimum-Path-Sum.md" >}})|Medium| O(n^2)| O(n^2)||59.4%| -|0070|Climbing Stairs|[Go]({{< relref "/ChapterFour/0001~0099/0070.Climbing-Stairs.md" >}})|Easy| O(n)| O(n)||51.0%| -|0091|Decode Ways|[Go]({{< relref "/ChapterFour/0001~0099/0091.Decode-Ways.md" >}})|Medium| O(n)| O(n)||30.3%| -|0095|Unique Binary Search Trees II|[Go]({{< relref "/ChapterFour/0001~0099/0095.Unique-Binary-Search-Trees-II.md" >}})|Medium||||49.5%| -|0096|Unique Binary Search Trees|[Go]({{< relref "/ChapterFour/0001~0099/0096.Unique-Binary-Search-Trees.md" >}})|Medium| O(n)| O(n)||58.3%| -|0097|Interleaving String|[Go]({{< relref "/ChapterFour/0001~0099/0097.Interleaving-String.md" >}})|Medium||||34.8%| -|0115|Distinct Subsequences|[Go]({{< relref "/ChapterFour/0100~0199/0115.Distinct-Subsequences.md" >}})|Hard||||42.3%| -|0118|Pascal's Triangle|[Go]({{< relref "/ChapterFour/0100~0199/0118.Pascals-Triangle.md" >}})|Easy||||64.6%| -|0119|Pascal's Triangle II|[Go]({{< relref "/ChapterFour/0100~0199/0119.Pascals-Triangle-II.md" >}})|Easy||||57.5%| -|0120|Triangle|[Go]({{< relref "/ChapterFour/0100~0199/0120.Triangle.md" >}})|Medium| O(n^2)| O(n)||50.8%| -|0121|Best Time to Buy and Sell Stock|[Go]({{< relref "/ChapterFour/0100~0199/0121.Best-Time-to-Buy-and-Sell-Stock.md" >}})|Easy| O(n)| O(1)||54.1%| -|0122|Best Time to Buy and Sell Stock II|[Go]({{< relref "/ChapterFour/0100~0199/0122.Best-Time-to-Buy-and-Sell-Stock-II.md" >}})|Medium||||62.0%| -|0124|Binary Tree Maximum Path Sum|[Go]({{< relref "/ChapterFour/0100~0199/0124.Binary-Tree-Maximum-Path-Sum.md" >}})|Hard||||37.7%| -|0131|Palindrome Partitioning|[Go]({{< relref "/ChapterFour/0100~0199/0131.Palindrome-Partitioning.md" >}})|Medium||||59.5%| -|0152|Maximum Product Subarray|[Go]({{< relref "/ChapterFour/0100~0199/0152.Maximum-Product-Subarray.md" >}})|Medium| O(n)| O(1)||34.6%| -|0174|Dungeon Game|[Go]({{< relref "/ChapterFour/0100~0199/0174.Dungeon-Game.md" >}})|Hard||||36.5%| -|0198|House Robber|[Go]({{< relref "/ChapterFour/0100~0199/0198.House-Robber.md" >}})|Medium| O(n)| O(n)||47.2%| -|0213|House Robber II|[Go]({{< relref "/ChapterFour/0200~0299/0213.House-Robber-II.md" >}})|Medium| O(n)| O(n)||39.9%| -|0264|Ugly Number II|[Go]({{< relref "/ChapterFour/0200~0299/0264.Ugly-Number-II.md" >}})|Medium||||45.3%| -|0279|Perfect Squares|[Go]({{< relref "/ChapterFour/0200~0299/0279.Perfect-Squares.md" >}})|Medium||||51.9%| -|0300|Longest Increasing Subsequence|[Go]({{< relref "/ChapterFour/0300~0399/0300.Longest-Increasing-Subsequence.md" >}})|Medium| O(n log n)| O(n)||49.3%| -|0309|Best Time to Buy and Sell Stock with Cooldown|[Go]({{< relref "/ChapterFour/0300~0399/0309.Best-Time-to-Buy-and-Sell-Stock-with-Cooldown.md" >}})|Medium| O(n)| O(n)||52.5%| -|0322|Coin Change|[Go]({{< relref "/ChapterFour/0300~0399/0322.Coin-Change.md" >}})|Medium| O(n)| O(n)||40.1%| -|0329|Longest Increasing Path in a Matrix|[Go]({{< relref "/ChapterFour/0300~0399/0329.Longest-Increasing-Path-in-a-Matrix.md" >}})|Hard||||49.7%| -|0337|House Robber III|[Go]({{< relref "/ChapterFour/0300~0399/0337.House-Robber-III.md" >}})|Medium||||53.5%| -|0338|Counting Bits|[Go]({{< relref "/ChapterFour/0300~0399/0338.Counting-Bits.md" >}})|Easy| O(n)| O(n)||74.3%| -|0343|Integer Break|[Go]({{< relref "/ChapterFour/0300~0399/0343.Integer-Break.md" >}})|Medium| O(n^2)| O(n)||54.1%| -|0354|Russian Doll Envelopes|[Go]({{< relref "/ChapterFour/0300~0399/0354.Russian-Doll-Envelopes.md" >}})|Hard||||38.9%| -|0357|Count Numbers with Unique Digits|[Go]({{< relref "/ChapterFour/0300~0399/0357.Count-Numbers-with-Unique-Digits.md" >}})|Medium| O(1)| O(1)||50.6%| -|0368|Largest Divisible Subset|[Go]({{< relref "/ChapterFour/0300~0399/0368.Largest-Divisible-Subset.md" >}})|Medium||||40.6%| -|0376|Wiggle Subsequence|[Go]({{< relref "/ChapterFour/0300~0399/0376.Wiggle-Subsequence.md" >}})|Medium||||44.9%| -|0377|Combination Sum IV|[Go]({{< relref "/ChapterFour/0300~0399/0377.Combination-Sum-IV.md" >}})|Medium||||49.4%| -|0392|Is Subsequence|[Go]({{< relref "/ChapterFour/0300~0399/0392.Is-Subsequence.md" >}})|Easy| O(n)| O(1)||51.0%| -|0397|Integer Replacement|[Go]({{< relref "/ChapterFour/0300~0399/0397.Integer-Replacement.md" >}})|Medium||||34.7%| -|0410|Split Array Largest Sum|[Go]({{< relref "/ChapterFour/0400~0499/0410.Split-Array-Largest-Sum.md" >}})|Hard||||52.1%| -|0413|Arithmetic Slices|[Go]({{< relref "/ChapterFour/0400~0499/0413.Arithmetic-Slices.md" >}})|Medium||||64.5%| -|0416|Partition Equal Subset Sum|[Go]({{< relref "/ChapterFour/0400~0499/0416.Partition-Equal-Subset-Sum.md" >}})|Medium| O(n^2)| O(n)||46.4%| -|0435|Non-overlapping Intervals|[Go]({{< relref "/ChapterFour/0400~0499/0435.Non-overlapping-Intervals.md" >}})|Medium||||48.3%| -|0458|Poor Pigs|[Go]({{< relref "/ChapterFour/0400~0499/0458.Poor-Pigs.md" >}})|Hard||||55.6%| -|0473|Matchsticks to Square|[Go]({{< relref "/ChapterFour/0400~0499/0473.Matchsticks-to-Square.md" >}})|Medium||||40.3%| -|0474|Ones and Zeroes|[Go]({{< relref "/ChapterFour/0400~0499/0474.Ones-and-Zeroes.md" >}})|Medium||||44.6%| -|0488|Zuma Game|[Go]({{< relref "/ChapterFour/0400~0499/0488.Zuma-Game.md" >}})|Hard||||36.1%| -|0494|Target Sum|[Go]({{< relref "/ChapterFour/0400~0499/0494.Target-Sum.md" >}})|Medium||||45.4%| -|0509|Fibonacci Number|[Go]({{< relref "/ChapterFour/0500~0599/0509.Fibonacci-Number.md" >}})|Easy||||68.2%| -|0518|Coin Change 2|[Go]({{< relref "/ChapterFour/0500~0599/0518.Coin-Change-2.md" >}})|Medium||||57.5%| -|0526|Beautiful Arrangement|[Go]({{< relref "/ChapterFour/0500~0599/0526.Beautiful-Arrangement.md" >}})|Medium||||64.3%| -|0542|01 Matrix|[Go]({{< relref "/ChapterFour/0500~0599/0542.01-Matrix.md" >}})|Medium||||43.8%| -|0576|Out of Boundary Paths|[Go]({{< relref "/ChapterFour/0500~0599/0576.Out-of-Boundary-Paths.md" >}})|Medium||||40.1%| -|0583|Delete Operation for Two Strings|[Go]({{< relref "/ChapterFour/0500~0599/0583.Delete-Operation-for-Two-Strings.md" >}})|Medium||||55.8%| -|0638|Shopping Offers|[Go]({{< relref "/ChapterFour/0600~0699/0638.Shopping-Offers.md" >}})|Medium||||54.6%| -|0647|Palindromic Substrings|[Go]({{< relref "/ChapterFour/0600~0699/0647.Palindromic-Substrings.md" >}})|Medium||||64.6%| -|0714|Best Time to Buy and Sell Stock with Transaction Fee|[Go]({{< relref "/ChapterFour/0700~0799/0714.Best-Time-to-Buy-and-Sell-Stock-with-Transaction-Fee.md" >}})|Medium| O(n)| O(1)||62.2%| -|0718|Maximum Length of Repeated Subarray|[Go]({{< relref "/ChapterFour/0700~0799/0718.Maximum-Length-of-Repeated-Subarray.md" >}})|Medium||||51.4%| -|0746|Min Cost Climbing Stairs|[Go]({{< relref "/ChapterFour/0700~0799/0746.Min-Cost-Climbing-Stairs.md" >}})|Easy| O(n)| O(1)||58.8%| -|0823|Binary Trees With Factors|[Go]({{< relref "/ChapterFour/0800~0899/0823.Binary-Trees-With-Factors.md" >}})|Medium||||43.7%| -|0828|Count Unique Characters of All Substrings of a Given String|[Go]({{< relref "/ChapterFour/0800~0899/0828.Count-Unique-Characters-of-All-Substrings-of-a-Given-String.md" >}})|Hard||||49.9%| -|0834|Sum of Distances in Tree|[Go]({{< relref "/ChapterFour/0800~0899/0834.Sum-of-Distances-in-Tree.md" >}})|Hard||||53.0%| -|0838|Push Dominoes|[Go]({{< relref "/ChapterFour/0800~0899/0838.Push-Dominoes.md" >}})|Medium| O(n)| O(n)||52.3%| -|0845|Longest Mountain in Array|[Go]({{< relref "/ChapterFour/0800~0899/0845.Longest-Mountain-in-Array.md" >}})|Medium||||39.8%| -|0877|Stone Game|[Go]({{< relref "/ChapterFour/0800~0899/0877.Stone-Game.md" >}})|Medium||||69.2%| -|0887|Super Egg Drop|[Go]({{< relref "/ChapterFour/0800~0899/0887.Super-Egg-Drop.md" >}})|Hard||||27.2%| -|0898|Bitwise ORs of Subarrays|[Go]({{< relref "/ChapterFour/0800~0899/0898.Bitwise-ORs-of-Subarrays.md" >}})|Medium||||36.3%| -|0907|Sum of Subarray Minimums|[Go]({{< relref "/ChapterFour/0900~0999/0907.Sum-of-Subarray-Minimums.md" >}})|Medium||||33.9%| -|0918|Maximum Sum Circular Subarray|[Go]({{< relref "/ChapterFour/0900~0999/0918.Maximum-Sum-Circular-Subarray.md" >}})|Medium||||37.2%| -|0920|Number of Music Playlists|[Go]({{< relref "/ChapterFour/0900~0999/0920.Number-of-Music-Playlists.md" >}})|Hard||||49.9%| -|0968|Binary Tree Cameras|[Go]({{< relref "/ChapterFour/0900~0999/0968.Binary-Tree-Cameras.md" >}})|Hard||||41.9%| -|0978|Longest Turbulent Subarray|[Go]({{< relref "/ChapterFour/0900~0999/0978.Longest-Turbulent-Subarray.md" >}})|Medium||||47.5%| -|0996|Number of Squareful Arrays|[Go]({{< relref "/ChapterFour/0900~0999/0996.Number-of-Squareful-Arrays.md" >}})|Hard||||49.1%| -|1025|Divisor Game|[Go]({{< relref "/ChapterFour/1000~1099/1025.Divisor-Game.md" >}})|Easy| O(1)| O(1)||66.6%| -|1048|Longest String Chain|[Go]({{< relref "/ChapterFour/1000~1099/1048.Longest-String-Chain.md" >}})|Medium||||57.8%| -|1049|Last Stone Weight II|[Go]({{< relref "/ChapterFour/1000~1099/1049.Last-Stone-Weight-II.md" >}})|Medium||||51.1%| -|1105|Filling Bookcase Shelves|[Go]({{< relref "/ChapterFour/1100~1199/1105.Filling-Bookcase-Shelves.md" >}})|Medium||||58.1%| -|1137|N-th Tribonacci Number|[Go]({{< relref "/ChapterFour/1100~1199/1137.N-th-Tribonacci-Number.md" >}})|Easy||||62.9%| -|1143|Longest Common Subsequence|[Go]({{< relref "/ChapterFour/1100~1199/1143.Longest-Common-Subsequence.md" >}})|Medium||||58.9%| -|1235|Maximum Profit in Job Scheduling|[Go]({{< relref "/ChapterFour/1200~1299/1235.Maximum-Profit-in-Job-Scheduling.md" >}})|Hard||||50.9%| -|1463|Cherry Pickup II|[Go]({{< relref "/ChapterFour/1400~1499/1463.Cherry-Pickup-II.md" >}})|Hard||||70.7%| -|1641|Count Sorted Vowel Strings|[Go]({{< relref "/ChapterFour/1600~1699/1641.Count-Sorted-Vowel-Strings.md" >}})|Medium||||74.9%| -|1646|Get Maximum in Generated Array|[Go]({{< relref "/ChapterFour/1600~1699/1646.Get-Maximum-in-Generated-Array.md" >}})|Easy||||50.8%| -|1653|Minimum Deletions to Make String Balanced|[Go]({{< relref "/ChapterFour/1600~1699/1653.Minimum-Deletions-to-Make-String-Balanced.md" >}})|Medium||||56.6%| -|1654|Minimum Jumps to Reach Home|[Go]({{< relref "/ChapterFour/1600~1699/1654.Minimum-Jumps-to-Reach-Home.md" >}})|Medium||||27.2%| -|1655|Distribute Repeating Integers|[Go]({{< relref "/ChapterFour/1600~1699/1655.Distribute-Repeating-Integers.md" >}})|Hard||||40.3%| -|1659|Maximize Grid Happiness|[Go]({{< relref "/ChapterFour/1600~1699/1659.Maximize-Grid-Happiness.md" >}})|Hard||||37.7%| -|1664|Ways to Make a Fair Array|[Go]({{< relref "/ChapterFour/1600~1699/1664.Ways-to-Make-a-Fair-Array.md" >}})|Medium||||63.2%| -|1681|Minimum Incompatibility|[Go]({{< relref "/ChapterFour/1600~1699/1681.Minimum-Incompatibility.md" >}})|Hard||||37.1%| -|1690|Stone Game VII|[Go]({{< relref "/ChapterFour/1600~1699/1690.Stone-Game-VII.md" >}})|Medium||||58.7%| -|1691|Maximum Height by Stacking Cuboids|[Go]({{< relref "/ChapterFour/1600~1699/1691.Maximum-Height-by-Stacking-Cuboids.md" >}})|Hard||||53.6%| -|1696|Jump Game VI|[Go]({{< relref "/ChapterFour/1600~1699/1696.Jump-Game-VI.md" >}})|Medium||||42.8%| -|2167|Minimum Time to Remove All Cars Containing Illegal Goods|[Go]({{< relref "/ChapterFour/2100~2199/2167.Minimum-Time-to-Remove-All-Cars-Containing-Illegal-Goods.md" >}})|Hard||||39.1%| +|0005|Longest Palindromic Substring|[Go]({{< relref "/ChapterFour/0001~0099/0005.Longest-Palindromic-Substring.md" >}})|Medium||||32.4%| +|0022|Generate Parentheses|[Go]({{< relref "/ChapterFour/0001~0099/0022.Generate-Parentheses.md" >}})|Medium||||72.5%| +|0032|Longest Valid Parentheses|[Go]({{< relref "/ChapterFour/0001~0099/0032.Longest-Valid-Parentheses.md" >}})|Hard||||32.8%| +|0042|Trapping Rain Water|[Go]({{< relref "/ChapterFour/0001~0099/0042.Trapping-Rain-Water.md" >}})|Hard||||59.3%| +|0045|Jump Game II|[Go]({{< relref "/ChapterFour/0001~0099/0045.Jump-Game-II.md" >}})|Medium||||39.8%| +|0053|Maximum Subarray|[Go]({{< relref "/ChapterFour/0001~0099/0053.Maximum-Subarray.md" >}})|Medium| O(n)| O(n)||50.2%| +|0055|Jump Game|[Go]({{< relref "/ChapterFour/0001~0099/0055.Jump-Game.md" >}})|Medium||||38.9%| +|0062|Unique Paths|[Go]({{< relref "/ChapterFour/0001~0099/0062.Unique-Paths.md" >}})|Medium| O(n^2)| O(n^2)||62.7%| +|0063|Unique Paths II|[Go]({{< relref "/ChapterFour/0001~0099/0063.Unique-Paths-II.md" >}})|Medium| O(n^2)| O(n^2)||39.4%| +|0064|Minimum Path Sum|[Go]({{< relref "/ChapterFour/0001~0099/0064.Minimum-Path-Sum.md" >}})|Medium| O(n^2)| O(n^2)||62.0%| +|0070|Climbing Stairs|[Go]({{< relref "/ChapterFour/0001~0099/0070.Climbing-Stairs.md" >}})|Easy| O(n)| O(n)||52.2%| +|0091|Decode Ways|[Go]({{< relref "/ChapterFour/0001~0099/0091.Decode-Ways.md" >}})|Medium| O(n)| O(n)||32.7%| +|0095|Unique Binary Search Trees II|[Go]({{< relref "/ChapterFour/0001~0099/0095.Unique-Binary-Search-Trees-II.md" >}})|Medium||||52.4%| +|0096|Unique Binary Search Trees|[Go]({{< relref "/ChapterFour/0001~0099/0096.Unique-Binary-Search-Trees.md" >}})|Medium| O(n)| O(n)||59.7%| +|0097|Interleaving String|[Go]({{< relref "/ChapterFour/0001~0099/0097.Interleaving-String.md" >}})|Medium||||37.3%| +|0115|Distinct Subsequences|[Go]({{< relref "/ChapterFour/0100~0199/0115.Distinct-Subsequences.md" >}})|Hard||||44.5%| +|0118|Pascal's Triangle|[Go]({{< relref "/ChapterFour/0100~0199/0118.Pascals-Triangle.md" >}})|Easy||||70.8%| +|0119|Pascal's Triangle II|[Go]({{< relref "/ChapterFour/0100~0199/0119.Pascals-Triangle-II.md" >}})|Easy||||60.8%| +|0120|Triangle|[Go]({{< relref "/ChapterFour/0100~0199/0120.Triangle.md" >}})|Medium| O(n^2)| O(n)||54.5%| +|0121|Best Time to Buy and Sell Stock|[Go]({{< relref "/ChapterFour/0100~0199/0121.Best-Time-to-Buy-and-Sell-Stock.md" >}})|Easy| O(n)| O(1)||54.3%| +|0122|Best Time to Buy and Sell Stock II|[Go]({{< relref "/ChapterFour/0100~0199/0122.Best-Time-to-Buy-and-Sell-Stock-II.md" >}})|Medium||||63.9%| +|0124|Binary Tree Maximum Path Sum|[Go]({{< relref "/ChapterFour/0100~0199/0124.Binary-Tree-Maximum-Path-Sum.md" >}})|Hard||||39.2%| +|0131|Palindrome Partitioning|[Go]({{< relref "/ChapterFour/0100~0199/0131.Palindrome-Partitioning.md" >}})|Medium||||64.9%| +|0152|Maximum Product Subarray|[Go]({{< relref "/ChapterFour/0100~0199/0152.Maximum-Product-Subarray.md" >}})|Medium| O(n)| O(1)||34.9%| +|0174|Dungeon Game|[Go]({{< relref "/ChapterFour/0100~0199/0174.Dungeon-Game.md" >}})|Hard||||37.5%| +|0198|House Robber|[Go]({{< relref "/ChapterFour/0100~0199/0198.House-Robber.md" >}})|Medium| O(n)| O(n)||49.4%| +|0213|House Robber II|[Go]({{< relref "/ChapterFour/0200~0299/0213.House-Robber-II.md" >}})|Medium| O(n)| O(n)||41.0%| +|0264|Ugly Number II|[Go]({{< relref "/ChapterFour/0200~0299/0264.Ugly-Number-II.md" >}})|Medium||||46.2%| +|0279|Perfect Squares|[Go]({{< relref "/ChapterFour/0200~0299/0279.Perfect-Squares.md" >}})|Medium||||52.7%| +|0300|Longest Increasing Subsequence|[Go]({{< relref "/ChapterFour/0300~0399/0300.Longest-Increasing-Subsequence.md" >}})|Medium| O(n log n)| O(n)||52.2%| +|0309|Best Time to Buy and Sell Stock with Cooldown|[Go]({{< relref "/ChapterFour/0300~0399/0309.Best-Time-to-Buy-and-Sell-Stock-with-Cooldown.md" >}})|Medium| O(n)| O(n)||56.2%| +|0322|Coin Change|[Go]({{< relref "/ChapterFour/0300~0399/0322.Coin-Change.md" >}})|Medium| O(n)| O(n)||42.1%| +|0329|Longest Increasing Path in a Matrix|[Go]({{< relref "/ChapterFour/0300~0399/0329.Longest-Increasing-Path-in-a-Matrix.md" >}})|Hard||||52.4%| +|0337|House Robber III|[Go]({{< relref "/ChapterFour/0300~0399/0337.House-Robber-III.md" >}})|Medium||||53.9%| +|0338|Counting Bits|[Go]({{< relref "/ChapterFour/0300~0399/0338.Counting-Bits.md" >}})|Easy| O(n)| O(n)||75.8%| +|0343|Integer Break|[Go]({{< relref "/ChapterFour/0300~0399/0343.Integer-Break.md" >}})|Medium| O(n^2)| O(n)||56.1%| +|0354|Russian Doll Envelopes|[Go]({{< relref "/ChapterFour/0300~0399/0354.Russian-Doll-Envelopes.md" >}})|Hard||||37.9%| +|0357|Count Numbers with Unique Digits|[Go]({{< relref "/ChapterFour/0300~0399/0357.Count-Numbers-with-Unique-Digits.md" >}})|Medium| O(1)| O(1)||51.9%| +|0368|Largest Divisible Subset|[Go]({{< relref "/ChapterFour/0300~0399/0368.Largest-Divisible-Subset.md" >}})|Medium||||41.6%| +|0376|Wiggle Subsequence|[Go]({{< relref "/ChapterFour/0300~0399/0376.Wiggle-Subsequence.md" >}})|Medium||||48.3%| +|0377|Combination Sum IV|[Go]({{< relref "/ChapterFour/0300~0399/0377.Combination-Sum-IV.md" >}})|Medium||||52.2%| +|0392|Is Subsequence|[Go]({{< relref "/ChapterFour/0300~0399/0392.Is-Subsequence.md" >}})|Easy| O(n)| O(1)||47.5%| +|0396|Rotate Function|[Go]({{< relref "/ChapterFour/0300~0399/0396.Rotate-Function.md" >}})|Medium||||41.1%| +|0397|Integer Replacement|[Go]({{< relref "/ChapterFour/0300~0399/0397.Integer-Replacement.md" >}})|Medium||||35.2%| +|0410|Split Array Largest Sum|[Go]({{< relref "/ChapterFour/0400~0499/0410.Split-Array-Largest-Sum.md" >}})|Hard||||53.5%| +|0413|Arithmetic Slices|[Go]({{< relref "/ChapterFour/0400~0499/0413.Arithmetic-Slices.md" >}})|Medium||||65.1%| +|0416|Partition Equal Subset Sum|[Go]({{< relref "/ChapterFour/0400~0499/0416.Partition-Equal-Subset-Sum.md" >}})|Medium| O(n^2)| O(n)||46.3%| +|0435|Non-overlapping Intervals|[Go]({{< relref "/ChapterFour/0400~0499/0435.Non-overlapping-Intervals.md" >}})|Medium||||50.3%| +|0458|Poor Pigs|[Go]({{< relref "/ChapterFour/0400~0499/0458.Poor-Pigs.md" >}})|Hard||||62.8%| +|0473|Matchsticks to Square|[Go]({{< relref "/ChapterFour/0400~0499/0473.Matchsticks-to-Square.md" >}})|Medium||||40.2%| +|0474|Ones and Zeroes|[Go]({{< relref "/ChapterFour/0400~0499/0474.Ones-and-Zeroes.md" >}})|Medium||||46.8%| +|0488|Zuma Game|[Go]({{< relref "/ChapterFour/0400~0499/0488.Zuma-Game.md" >}})|Hard||||33.9%| +|0494|Target Sum|[Go]({{< relref "/ChapterFour/0400~0499/0494.Target-Sum.md" >}})|Medium||||45.7%| +|0509|Fibonacci Number|[Go]({{< relref "/ChapterFour/0500~0599/0509.Fibonacci-Number.md" >}})|Easy||||69.8%| +|0518|Coin Change II|[Go]({{< relref "/ChapterFour/0500~0599/0518.Coin-Change-II.md" >}})|Medium||||60.6%| +|0526|Beautiful Arrangement|[Go]({{< relref "/ChapterFour/0500~0599/0526.Beautiful-Arrangement.md" >}})|Medium||||64.4%| +|0542|01 Matrix|[Go]({{< relref "/ChapterFour/0500~0599/0542.01-Matrix.md" >}})|Medium||||44.8%| +|0576|Out of Boundary Paths|[Go]({{< relref "/ChapterFour/0500~0599/0576.Out-of-Boundary-Paths.md" >}})|Medium||||44.3%| +|0583|Delete Operation for Two Strings|[Go]({{< relref "/ChapterFour/0500~0599/0583.Delete-Operation-for-Two-Strings.md" >}})|Medium||||59.8%| +|0638|Shopping Offers|[Go]({{< relref "/ChapterFour/0600~0699/0638.Shopping-Offers.md" >}})|Medium||||53.3%| +|0647|Palindromic Substrings|[Go]({{< relref "/ChapterFour/0600~0699/0647.Palindromic-Substrings.md" >}})|Medium||||66.9%| +|0714|Best Time to Buy and Sell Stock with Transaction Fee|[Go]({{< relref "/ChapterFour/0700~0799/0714.Best-Time-to-Buy-and-Sell-Stock-with-Transaction-Fee.md" >}})|Medium| O(n)| O(1)||65.2%| +|0718|Maximum Length of Repeated Subarray|[Go]({{< relref "/ChapterFour/0700~0799/0718.Maximum-Length-of-Repeated-Subarray.md" >}})|Medium||||51.3%| +|0746|Min Cost Climbing Stairs|[Go]({{< relref "/ChapterFour/0700~0799/0746.Min-Cost-Climbing-Stairs.md" >}})|Easy| O(n)| O(1)||63.2%| +|0823|Binary Trees With Factors|[Go]({{< relref "/ChapterFour/0800~0899/0823.Binary-Trees-With-Factors.md" >}})|Medium||||49.7%| +|0828|Count Unique Characters of All Substrings of a Given String|[Go]({{< relref "/ChapterFour/0800~0899/0828.Count-Unique-Characters-of-All-Substrings-of-a-Given-String.md" >}})|Hard||||51.6%| +|0834|Sum of Distances in Tree|[Go]({{< relref "/ChapterFour/0800~0899/0834.Sum-of-Distances-in-Tree.md" >}})|Hard||||59.1%| +|0838|Push Dominoes|[Go]({{< relref "/ChapterFour/0800~0899/0838.Push-Dominoes.md" >}})|Medium| O(n)| O(n)||57.0%| +|0845|Longest Mountain in Array|[Go]({{< relref "/ChapterFour/0800~0899/0845.Longest-Mountain-in-Array.md" >}})|Medium||||40.2%| +|0877|Stone Game|[Go]({{< relref "/ChapterFour/0800~0899/0877.Stone-Game.md" >}})|Medium||||69.7%| +|0887|Super Egg Drop|[Go]({{< relref "/ChapterFour/0800~0899/0887.Super-Egg-Drop.md" >}})|Hard||||27.1%| +|0898|Bitwise ORs of Subarrays|[Go]({{< relref "/ChapterFour/0800~0899/0898.Bitwise-ORs-of-Subarrays.md" >}})|Medium||||37.2%| +|0907|Sum of Subarray Minimums|[Go]({{< relref "/ChapterFour/0900~0999/0907.Sum-of-Subarray-Minimums.md" >}})|Medium||||35.8%| +|0918|Maximum Sum Circular Subarray|[Go]({{< relref "/ChapterFour/0900~0999/0918.Maximum-Sum-Circular-Subarray.md" >}})|Medium||||43.0%| +|0920|Number of Music Playlists|[Go]({{< relref "/ChapterFour/0900~0999/0920.Number-of-Music-Playlists.md" >}})|Hard||||50.7%| +|0968|Binary Tree Cameras|[Go]({{< relref "/ChapterFour/0900~0999/0968.Binary-Tree-Cameras.md" >}})|Hard||||46.6%| +|0978|Longest Turbulent Subarray|[Go]({{< relref "/ChapterFour/0900~0999/0978.Longest-Turbulent-Subarray.md" >}})|Medium||||47.2%| +|0996|Number of Squareful Arrays|[Go]({{< relref "/ChapterFour/0900~0999/0996.Number-of-Squareful-Arrays.md" >}})|Hard||||49.2%| +|1025|Divisor Game|[Go]({{< relref "/ChapterFour/1000~1099/1025.Divisor-Game.md" >}})|Easy| O(1)| O(1)||67.6%| +|1048|Longest String Chain|[Go]({{< relref "/ChapterFour/1000~1099/1048.Longest-String-Chain.md" >}})|Medium||||59.3%| +|1049|Last Stone Weight II|[Go]({{< relref "/ChapterFour/1000~1099/1049.Last-Stone-Weight-II.md" >}})|Medium||||53.2%| +|1105|Filling Bookcase Shelves|[Go]({{< relref "/ChapterFour/1100~1199/1105.Filling-Bookcase-Shelves.md" >}})|Medium||||59.3%| +|1137|N-th Tribonacci Number|[Go]({{< relref "/ChapterFour/1100~1199/1137.N-th-Tribonacci-Number.md" >}})|Easy||||63.7%| +|1143|Longest Common Subsequence|[Go]({{< relref "/ChapterFour/1100~1199/1143.Longest-Common-Subsequence.md" >}})|Medium||||58.4%| +|1235|Maximum Profit in Job Scheduling|[Go]({{< relref "/ChapterFour/1200~1299/1235.Maximum-Profit-in-Job-Scheduling.md" >}})|Hard||||53.4%| +|1463|Cherry Pickup II|[Go]({{< relref "/ChapterFour/1400~1499/1463.Cherry-Pickup-II.md" >}})|Hard||||69.5%| +|1641|Count Sorted Vowel Strings|[Go]({{< relref "/ChapterFour/1600~1699/1641.Count-Sorted-Vowel-Strings.md" >}})|Medium||||77.4%| +|1646|Get Maximum in Generated Array|[Go]({{< relref "/ChapterFour/1600~1699/1646.Get-Maximum-in-Generated-Array.md" >}})|Easy||||50.2%| +|1653|Minimum Deletions to Make String Balanced|[Go]({{< relref "/ChapterFour/1600~1699/1653.Minimum-Deletions-to-Make-String-Balanced.md" >}})|Medium||||58.9%| +|1654|Minimum Jumps to Reach Home|[Go]({{< relref "/ChapterFour/1600~1699/1654.Minimum-Jumps-to-Reach-Home.md" >}})|Medium||||29.1%| +|1655|Distribute Repeating Integers|[Go]({{< relref "/ChapterFour/1600~1699/1655.Distribute-Repeating-Integers.md" >}})|Hard||||39.3%| +|1659|Maximize Grid Happiness|[Go]({{< relref "/ChapterFour/1600~1699/1659.Maximize-Grid-Happiness.md" >}})|Hard||||38.8%| +|1664|Ways to Make a Fair Array|[Go]({{< relref "/ChapterFour/1600~1699/1664.Ways-to-Make-a-Fair-Array.md" >}})|Medium||||63.3%| +|1681|Minimum Incompatibility|[Go]({{< relref "/ChapterFour/1600~1699/1681.Minimum-Incompatibility.md" >}})|Hard||||37.8%| +|1690|Stone Game VII|[Go]({{< relref "/ChapterFour/1600~1699/1690.Stone-Game-VII.md" >}})|Medium||||58.1%| +|1691|Maximum Height by Stacking Cuboids|[Go]({{< relref "/ChapterFour/1600~1699/1691.Maximum-Height-by-Stacking-Cuboids.md" >}})|Hard||||54.6%| +|1696|Jump Game VI|[Go]({{< relref "/ChapterFour/1600~1699/1696.Jump-Game-VI.md" >}})|Medium||||46.1%| +|2167|Minimum Time to Remove All Cars Containing Illegal Goods|[Go]({{< relref "/ChapterFour/2100~2199/2167.Minimum-Time-to-Remove-All-Cars-Containing-Illegal-Goods.md" >}})|Hard||||40.8%| |------------|-------------------------------------------------------|-------| ----------------| ---------------|-------------|-------------|-------------| diff --git a/website/content/ChapterTwo/Hash_Table.md b/website/content/ChapterTwo/Hash_Table.md index 84dad2d06..d0dc53572 100644 --- a/website/content/ChapterTwo/Hash_Table.md +++ b/website/content/ChapterTwo/Hash_Table.md @@ -9,161 +9,167 @@ weight: 13 | No. | Title | Solution | Difficulty | TimeComplexity | SpaceComplexity |Favorite| Acceptance | |:--------:|:------- | :--------: | :----------: | :----: | :-----: | :-----: |:-----: | -|0001|Two Sum|[Go]({{< relref "/ChapterFour/0001~0099/0001.Two-Sum.md" >}})|Easy| O(n)| O(n)||48.6%| -|0003|Longest Substring Without Repeating Characters|[Go]({{< relref "/ChapterFour/0001~0099/0003.Longest-Substring-Without-Repeating-Characters.md" >}})|Medium| O(n)| O(1)|❤️|33.1%| -|0012|Integer to Roman|[Go]({{< relref "/ChapterFour/0001~0099/0012.Integer-to-Roman.md" >}})|Medium||||59.4%| -|0013|Roman to Integer|[Go]({{< relref "/ChapterFour/0001~0099/0013.Roman-to-Integer.md" >}})|Easy||||57.9%| -|0017|Letter Combinations of a Phone Number|[Go]({{< relref "/ChapterFour/0001~0099/0017.Letter-Combinations-of-a-Phone-Number.md" >}})|Medium||||53.6%| -|0030|Substring with Concatenation of All Words|[Go]({{< relref "/ChapterFour/0001~0099/0030.Substring-with-Concatenation-of-All-Words.md" >}})|Hard| O(n)| O(n)|❤️|28.1%| -|0036|Valid Sudoku|[Go]({{< relref "/ChapterFour/0001~0099/0036.Valid-Sudoku.md" >}})|Medium| O(n^2)| O(n^2)||55.1%| -|0041|First Missing Positive|[Go]({{< relref "/ChapterFour/0001~0099/0041.First-Missing-Positive.md" >}})|Hard||||36.0%| -|0049|Group Anagrams|[Go]({{< relref "/ChapterFour/0001~0099/0049.Group-Anagrams.md" >}})|Medium| O(n log n)| O(n)||64.2%| -|0073|Set Matrix Zeroes|[Go]({{< relref "/ChapterFour/0001~0099/0073.Set-Matrix-Zeroes.md" >}})|Medium||||48.3%| -|0076|Minimum Window Substring|[Go]({{< relref "/ChapterFour/0001~0099/0076.Minimum-Window-Substring.md" >}})|Hard| O(n)| O(n)|❤️|39.0%| -|0105|Construct Binary Tree from Preorder and Inorder Traversal|[Go]({{< relref "/ChapterFour/0100~0199/0105.Construct-Binary-Tree-from-Preorder-and-Inorder-Traversal.md" >}})|Medium||||57.7%| -|0106|Construct Binary Tree from Inorder and Postorder Traversal|[Go]({{< relref "/ChapterFour/0100~0199/0106.Construct-Binary-Tree-from-Inorder-and-Postorder-Traversal.md" >}})|Medium||||55.4%| -|0126|Word Ladder II|[Go]({{< relref "/ChapterFour/0100~0199/0126.Word-Ladder-II.md" >}})|Hard||||27.0%| -|0127|Word Ladder|[Go]({{< relref "/ChapterFour/0100~0199/0127.Word-Ladder.md" >}})|Hard||||35.5%| -|0128|Longest Consecutive Sequence|[Go]({{< relref "/ChapterFour/0100~0199/0128.Longest-Consecutive-Sequence.md" >}})|Medium||||48.7%| -|0138|Copy List with Random Pointer|[Go]({{< relref "/ChapterFour/0100~0199/0138.Copy-List-with-Random-Pointer.md" >}})|Medium| O(n)| O(1)||48.2%| -|0141|Linked List Cycle|[Go]({{< relref "/ChapterFour/0100~0199/0141.Linked-List-Cycle.md" >}})|Easy||||45.9%| -|0142|Linked List Cycle II|[Go]({{< relref "/ChapterFour/0100~0199/0142.Linked-List-Cycle-II.md" >}})|Medium||||44.2%| -|0146|LRU Cache|[Go]({{< relref "/ChapterFour/0100~0199/0146.LRU-Cache.md" >}})|Medium||||39.9%| -|0160|Intersection of Two Linked Lists|[Go]({{< relref "/ChapterFour/0100~0199/0160.Intersection-of-Two-Linked-Lists.md" >}})|Easy||||49.9%| -|0169|Majority Element|[Go]({{< relref "/ChapterFour/0100~0199/0169.Majority-Element.md" >}})|Easy||||62.9%| -|0187|Repeated DNA Sequences|[Go]({{< relref "/ChapterFour/0100~0199/0187.Repeated-DNA-Sequences.md" >}})|Medium||||44.7%| -|0202|Happy Number|[Go]({{< relref "/ChapterFour/0200~0299/0202.Happy-Number.md" >}})|Easy| O(log n)| O(1)||53.2%| -|0205|Isomorphic Strings|[Go]({{< relref "/ChapterFour/0200~0299/0205.Isomorphic-Strings.md" >}})|Easy| O(log n)| O(n)||42.1%| -|0208|Implement Trie (Prefix Tree)|[Go]({{< relref "/ChapterFour/0200~0299/0208.Implement-Trie-Prefix-Tree.md" >}})|Medium||||58.2%| -|0217|Contains Duplicate|[Go]({{< relref "/ChapterFour/0200~0299/0217.Contains-Duplicate.md" >}})|Easy| O(n)| O(n)||60.8%| -|0219|Contains Duplicate II|[Go]({{< relref "/ChapterFour/0200~0299/0219.Contains-Duplicate-II.md" >}})|Easy| O(n)| O(n)||40.7%| -|0229|Majority Element II|[Go]({{< relref "/ChapterFour/0200~0299/0229.Majority-Element-II.md" >}})|Medium||||42.4%| -|0242|Valid Anagram|[Go]({{< relref "/ChapterFour/0200~0299/0242.Valid-Anagram.md" >}})|Easy| O(n)| O(n) ||61.4%| -|0264|Ugly Number II|[Go]({{< relref "/ChapterFour/0200~0299/0264.Ugly-Number-II.md" >}})|Medium||||45.3%| -|0268|Missing Number|[Go]({{< relref "/ChapterFour/0200~0299/0268.Missing-Number.md" >}})|Easy||||59.4%| -|0290|Word Pattern|[Go]({{< relref "/ChapterFour/0200~0299/0290.Word-Pattern.md" >}})|Easy| O(n)| O(n) ||40.2%| -|0299|Bulls and Cows|[Go]({{< relref "/ChapterFour/0200~0299/0299.Bulls-and-Cows.md" >}})|Medium||||47.2%| -|0347|Top K Frequent Elements|[Go]({{< relref "/ChapterFour/0300~0399/0347.Top-K-Frequent-Elements.md" >}})|Medium| O(n)| O(n) ||65.1%| -|0349|Intersection of Two Arrays|[Go]({{< relref "/ChapterFour/0300~0399/0349.Intersection-of-Two-Arrays.md" >}})|Easy| O(n)| O(n) ||69.1%| -|0350|Intersection of Two Arrays II|[Go]({{< relref "/ChapterFour/0300~0399/0350.Intersection-of-Two-Arrays-II.md" >}})|Easy| O(n)| O(n) ||54.9%| -|0383|Ransom Note|[Go]({{< relref "/ChapterFour/0300~0399/0383.Ransom-Note.md" >}})|Easy||||55.8%| -|0387|First Unique Character in a String|[Go]({{< relref "/ChapterFour/0300~0399/0387.First-Unique-Character-in-a-String.md" >}})|Easy||||57.1%| -|0389|Find the Difference|[Go]({{< relref "/ChapterFour/0300~0399/0389.Find-the-Difference.md" >}})|Easy||||60.5%| -|0395|Longest Substring with At Least K Repeating Characters|[Go]({{< relref "/ChapterFour/0300~0399/0395.Longest-Substring-with-At-Least-K-Repeating-Characters.md" >}})|Medium||||44.6%| -|0409|Longest Palindrome|[Go]({{< relref "/ChapterFour/0400~0499/0409.Longest-Palindrome.md" >}})|Easy||||53.6%| -|0421|Maximum XOR of Two Numbers in an Array|[Go]({{< relref "/ChapterFour/0400~0499/0421.Maximum-XOR-of-Two-Numbers-in-an-Array.md" >}})|Medium||||54.3%| +|0001|Two Sum|[Go]({{< relref "/ChapterFour/0001~0099/0001.Two-Sum.md" >}})|Easy| O(n)| O(n)||49.7%| +|0003|Longest Substring Without Repeating Characters|[Go]({{< relref "/ChapterFour/0001~0099/0003.Longest-Substring-Without-Repeating-Characters.md" >}})|Medium| O(n)| O(1)|❤️|33.8%| +|0012|Integer to Roman|[Go]({{< relref "/ChapterFour/0001~0099/0012.Integer-to-Roman.md" >}})|Medium||||62.0%| +|0013|Roman to Integer|[Go]({{< relref "/ChapterFour/0001~0099/0013.Roman-to-Integer.md" >}})|Easy||||58.6%| +|0017|Letter Combinations of a Phone Number|[Go]({{< relref "/ChapterFour/0001~0099/0017.Letter-Combinations-of-a-Phone-Number.md" >}})|Medium||||56.6%| +|0030|Substring with Concatenation of All Words|[Go]({{< relref "/ChapterFour/0001~0099/0030.Substring-with-Concatenation-of-All-Words.md" >}})|Hard| O(n)| O(n)|❤️|31.2%| +|0036|Valid Sudoku|[Go]({{< relref "/ChapterFour/0001~0099/0036.Valid-Sudoku.md" >}})|Medium| O(n^2)| O(n^2)||58.1%| +|0037|Sudoku Solver|[Go]({{< relref "/ChapterFour/0001~0099/0037.Sudoku-Solver.md" >}})|Hard| O(n^2)| O(n^2)|❤️|57.7%| +|0041|First Missing Positive|[Go]({{< relref "/ChapterFour/0001~0099/0041.First-Missing-Positive.md" >}})|Hard||||36.7%| +|0049|Group Anagrams|[Go]({{< relref "/ChapterFour/0001~0099/0049.Group-Anagrams.md" >}})|Medium| O(n log n)| O(n)||66.8%| +|0073|Set Matrix Zeroes|[Go]({{< relref "/ChapterFour/0001~0099/0073.Set-Matrix-Zeroes.md" >}})|Medium||||51.3%| +|0076|Minimum Window Substring|[Go]({{< relref "/ChapterFour/0001~0099/0076.Minimum-Window-Substring.md" >}})|Hard| O(n)| O(n)|❤️|40.9%| +|0105|Construct Binary Tree from Preorder and Inorder Traversal|[Go]({{< relref "/ChapterFour/0100~0199/0105.Construct-Binary-Tree-from-Preorder-and-Inorder-Traversal.md" >}})|Medium||||61.6%| +|0106|Construct Binary Tree from Inorder and Postorder Traversal|[Go]({{< relref "/ChapterFour/0100~0199/0106.Construct-Binary-Tree-from-Inorder-and-Postorder-Traversal.md" >}})|Medium||||60.0%| +|0126|Word Ladder II|[Go]({{< relref "/ChapterFour/0100~0199/0126.Word-Ladder-II.md" >}})|Hard||||27.5%| +|0127|Word Ladder|[Go]({{< relref "/ChapterFour/0100~0199/0127.Word-Ladder.md" >}})|Hard||||37.2%| +|0128|Longest Consecutive Sequence|[Go]({{< relref "/ChapterFour/0100~0199/0128.Longest-Consecutive-Sequence.md" >}})|Medium||||48.5%| +|0138|Copy List with Random Pointer|[Go]({{< relref "/ChapterFour/0100~0199/0138.Copy-List-with-Random-Pointer.md" >}})|Medium| O(n)| O(1)||51.4%| +|0141|Linked List Cycle|[Go]({{< relref "/ChapterFour/0100~0199/0141.Linked-List-Cycle.md" >}})|Easy||||47.5%| +|0142|Linked List Cycle II|[Go]({{< relref "/ChapterFour/0100~0199/0142.Linked-List-Cycle-II.md" >}})|Medium||||48.8%| +|0146|LRU Cache|[Go]({{< relref "/ChapterFour/0100~0199/0146.LRU-Cache.md" >}})|Medium||||40.7%| +|0160|Intersection of Two Linked Lists|[Go]({{< relref "/ChapterFour/0100~0199/0160.Intersection-of-Two-Linked-Lists.md" >}})|Easy||||54.4%| +|0169|Majority Element|[Go]({{< relref "/ChapterFour/0100~0199/0169.Majority-Element.md" >}})|Easy||||63.9%| +|0187|Repeated DNA Sequences|[Go]({{< relref "/ChapterFour/0100~0199/0187.Repeated-DNA-Sequences.md" >}})|Medium||||47.0%| +|0202|Happy Number|[Go]({{< relref "/ChapterFour/0200~0299/0202.Happy-Number.md" >}})|Easy| O(log n)| O(1)||54.8%| +|0205|Isomorphic Strings|[Go]({{< relref "/ChapterFour/0200~0299/0205.Isomorphic-Strings.md" >}})|Easy| O(log n)| O(n)||42.9%| +|0208|Implement Trie (Prefix Tree)|[Go]({{< relref "/ChapterFour/0200~0299/0208.Implement-Trie-Prefix-Tree.md" >}})|Medium||||62.8%| +|0217|Contains Duplicate|[Go]({{< relref "/ChapterFour/0200~0299/0217.Contains-Duplicate.md" >}})|Easy| O(n)| O(n)||61.4%| +|0219|Contains Duplicate II|[Go]({{< relref "/ChapterFour/0200~0299/0219.Contains-Duplicate-II.md" >}})|Easy| O(n)| O(n)||42.6%| +|0229|Majority Element II|[Go]({{< relref "/ChapterFour/0200~0299/0229.Majority-Element-II.md" >}})|Medium||||45.1%| +|0242|Valid Anagram|[Go]({{< relref "/ChapterFour/0200~0299/0242.Valid-Anagram.md" >}})|Easy| O(n)| O(n) ||63.1%| +|0264|Ugly Number II|[Go]({{< relref "/ChapterFour/0200~0299/0264.Ugly-Number-II.md" >}})|Medium||||46.2%| +|0268|Missing Number|[Go]({{< relref "/ChapterFour/0200~0299/0268.Missing-Number.md" >}})|Easy||||62.6%| +|0290|Word Pattern|[Go]({{< relref "/ChapterFour/0200~0299/0290.Word-Pattern.md" >}})|Easy| O(n)| O(n) ||41.7%| +|0299|Bulls and Cows|[Go]({{< relref "/ChapterFour/0200~0299/0299.Bulls-and-Cows.md" >}})|Medium||||49.4%| +|0347|Top K Frequent Elements|[Go]({{< relref "/ChapterFour/0300~0399/0347.Top-K-Frequent-Elements.md" >}})|Medium| O(n)| O(n) ||64.2%| +|0349|Intersection of Two Arrays|[Go]({{< relref "/ChapterFour/0300~0399/0349.Intersection-of-Two-Arrays.md" >}})|Easy| O(n)| O(n) ||70.9%| +|0350|Intersection of Two Arrays II|[Go]({{< relref "/ChapterFour/0300~0399/0350.Intersection-of-Two-Arrays-II.md" >}})|Easy| O(n)| O(n) ||56.0%| +|0383|Ransom Note|[Go]({{< relref "/ChapterFour/0300~0399/0383.Ransom-Note.md" >}})|Easy||||58.3%| +|0387|First Unique Character in a String|[Go]({{< relref "/ChapterFour/0300~0399/0387.First-Unique-Character-in-a-String.md" >}})|Easy||||59.6%| +|0389|Find the Difference|[Go]({{< relref "/ChapterFour/0300~0399/0389.Find-the-Difference.md" >}})|Easy||||59.9%| +|0395|Longest Substring with At Least K Repeating Characters|[Go]({{< relref "/ChapterFour/0300~0399/0395.Longest-Substring-with-At-Least-K-Repeating-Characters.md" >}})|Medium||||44.8%| +|0409|Longest Palindrome|[Go]({{< relref "/ChapterFour/0400~0499/0409.Longest-Palindrome.md" >}})|Easy||||54.2%| +|0421|Maximum XOR of Two Numbers in an Array|[Go]({{< relref "/ChapterFour/0400~0499/0421.Maximum-XOR-of-Two-Numbers-in-an-Array.md" >}})|Medium||||54.0%| |0423|Reconstruct Original Digits from English|[Go]({{< relref "/ChapterFour/0400~0499/0423.Reconstruct-Original-Digits-from-English.md" >}})|Medium||||51.2%| -|0424|Longest Repeating Character Replacement|[Go]({{< relref "/ChapterFour/0400~0499/0424.Longest-Repeating-Character-Replacement.md" >}})|Medium||||50.8%| -|0433|Minimum Genetic Mutation|[Go]({{< relref "/ChapterFour/0400~0499/0433.Minimum-Genetic-Mutation.md" >}})|Medium||||46.8%| -|0438|Find All Anagrams in a String|[Go]({{< relref "/ChapterFour/0400~0499/0438.Find-All-Anagrams-in-a-String.md" >}})|Medium| O(n)| O(1) ||48.3%| -|0447|Number of Boomerangs|[Go]({{< relref "/ChapterFour/0400~0499/0447.Number-of-Boomerangs.md" >}})|Medium| O(n)| O(1) ||54.2%| -|0448|Find All Numbers Disappeared in an Array|[Go]({{< relref "/ChapterFour/0400~0499/0448.Find-All-Numbers-Disappeared-in-an-Array.md" >}})|Easy||||59.1%| -|0451|Sort Characters By Frequency|[Go]({{< relref "/ChapterFour/0400~0499/0451.Sort-Characters-By-Frequency.md" >}})|Medium| O(n log n)| O(1) ||67.8%| -|0454|4Sum II|[Go]({{< relref "/ChapterFour/0400~0499/0454.4Sum-II.md" >}})|Medium| O(n^2)| O(n) ||57.0%| -|0457|Circular Array Loop|[Go]({{< relref "/ChapterFour/0400~0499/0457.Circular-Array-Loop.md" >}})|Medium||||31.7%| -|0460|LFU Cache|[Go]({{< relref "/ChapterFour/0400~0499/0460.LFU-Cache.md" >}})|Hard||||39.4%| -|0480|Sliding Window Median|[Go]({{< relref "/ChapterFour/0400~0499/0480.Sliding-Window-Median.md" >}})|Hard||||40.9%| -|0491|Increasing Subsequences|[Go]({{< relref "/ChapterFour/0400~0499/0491.Increasing-Subsequences.md" >}})|Medium||||50.9%| -|0496|Next Greater Element I|[Go]({{< relref "/ChapterFour/0400~0499/0496.Next-Greater-Element-I.md" >}})|Easy||||70.1%| -|0500|Keyboard Row|[Go]({{< relref "/ChapterFour/0500~0599/0500.Keyboard-Row.md" >}})|Easy||||68.0%| -|0508|Most Frequent Subtree Sum|[Go]({{< relref "/ChapterFour/0500~0599/0508.Most-Frequent-Subtree-Sum.md" >}})|Medium||||62.8%| -|0519|Random Flip Matrix|[Go]({{< relref "/ChapterFour/0500~0599/0519.Random-Flip-Matrix.md" >}})|Medium||||39.2%| -|0523|Continuous Subarray Sum|[Go]({{< relref "/ChapterFour/0500~0599/0523.Continuous-Subarray-Sum.md" >}})|Medium||||27.3%| -|0525|Contiguous Array|[Go]({{< relref "/ChapterFour/0500~0599/0525.Contiguous-Array.md" >}})|Medium||||46.3%| -|0532|K-diff Pairs in an Array|[Go]({{< relref "/ChapterFour/0500~0599/0532.K-diff-Pairs-in-an-Array.md" >}})|Medium||||40.1%| -|0535|Encode and Decode TinyURL|[Go]({{< relref "/ChapterFour/0500~0599/0535.Encode-and-Decode-TinyURL.md" >}})|Medium||||85.4%| -|0554|Brick Wall|[Go]({{< relref "/ChapterFour/0500~0599/0554.Brick-Wall.md" >}})|Medium||||52.6%| -|0560|Subarray Sum Equals K|[Go]({{< relref "/ChapterFour/0500~0599/0560.Subarray-Sum-Equals-K.md" >}})|Medium||||44.2%| -|0567|Permutation in String|[Go]({{< relref "/ChapterFour/0500~0599/0567.Permutation-in-String.md" >}})|Medium||||44.7%| -|0575|Distribute Candies|[Go]({{< relref "/ChapterFour/0500~0599/0575.Distribute-Candies.md" >}})|Easy||||65.7%| -|0594|Longest Harmonious Subsequence|[Go]({{< relref "/ChapterFour/0500~0599/0594.Longest-Harmonious-Subsequence.md" >}})|Easy||||52.7%| -|0599|Minimum Index Sum of Two Lists|[Go]({{< relref "/ChapterFour/0500~0599/0599.Minimum-Index-Sum-of-Two-Lists.md" >}})|Easy||||52.8%| -|0609|Find Duplicate File in System|[Go]({{< relref "/ChapterFour/0600~0699/0609.Find-Duplicate-File-in-System.md" >}})|Medium||||63.8%| -|0632|Smallest Range Covering Elements from K Lists|[Go]({{< relref "/ChapterFour/0600~0699/0632.Smallest-Range-Covering-Elements-from-K-Lists.md" >}})|Hard||||58.6%| -|0645|Set Mismatch|[Go]({{< relref "/ChapterFour/0600~0699/0645.Set-Mismatch.md" >}})|Easy||||41.3%| -|0648|Replace Words|[Go]({{< relref "/ChapterFour/0600~0699/0648.Replace-Words.md" >}})|Medium| O(n)| O(n) ||62.0%| -|0653|Two Sum IV - Input is a BST|[Go]({{< relref "/ChapterFour/0600~0699/0653.Two-Sum-IV-Input-is-a-BST.md" >}})|Easy||||58.8%| -|0676|Implement Magic Dictionary|[Go]({{< relref "/ChapterFour/0600~0699/0676.Implement-Magic-Dictionary.md" >}})|Medium| O(n)| O(n) ||56.6%| -|0677|Map Sum Pairs|[Go]({{< relref "/ChapterFour/0600~0699/0677.Map-Sum-Pairs.md" >}})|Medium||||57.0%| -|0690|Employee Importance|[Go]({{< relref "/ChapterFour/0600~0699/0690.Employee-Importance.md" >}})|Medium||||64.0%| -|0692|Top K Frequent Words|[Go]({{< relref "/ChapterFour/0600~0699/0692.Top-K-Frequent-Words.md" >}})|Medium||||54.4%| -|0697|Degree of an Array|[Go]({{< relref "/ChapterFour/0600~0699/0697.Degree-of-an-Array.md" >}})|Easy||||55.6%| -|0705|Design HashSet|[Go]({{< relref "/ChapterFour/0700~0799/0705.Design-HashSet.md" >}})|Easy||||66.5%| -|0706|Design HashMap|[Go]({{< relref "/ChapterFour/0700~0799/0706.Design-HashMap.md" >}})|Easy||||65.3%| -|0710|Random Pick with Blacklist|[Go]({{< relref "/ChapterFour/0700~0799/0710.Random-Pick-with-Blacklist.md" >}})|Hard| O(n)| O(n) ||33.2%| -|0720|Longest Word in Dictionary|[Go]({{< relref "/ChapterFour/0700~0799/0720.Longest-Word-in-Dictionary.md" >}})|Medium| O(n)| O(n) ||51.0%| -|0726|Number of Atoms|[Go]({{< relref "/ChapterFour/0700~0799/0726.Number-of-Atoms.md" >}})|Hard| O(n)| O(n) |❤️|51.7%| -|0748|Shortest Completing Word|[Go]({{< relref "/ChapterFour/0700~0799/0748.Shortest-Completing-Word.md" >}})|Easy||||58.9%| -|0752|Open the Lock|[Go]({{< relref "/ChapterFour/0700~0799/0752.Open-the-Lock.md" >}})|Medium||||55.3%| -|0763|Partition Labels|[Go]({{< relref "/ChapterFour/0700~0799/0763.Partition-Labels.md" >}})|Medium||||79.6%| -|0767|Reorganize String|[Go]({{< relref "/ChapterFour/0700~0799/0767.Reorganize-String.md" >}})|Medium||||52.1%| -|0771|Jewels and Stones|[Go]({{< relref "/ChapterFour/0700~0799/0771.Jewels-and-Stones.md" >}})|Easy||||87.7%| -|0781|Rabbits in Forest|[Go]({{< relref "/ChapterFour/0700~0799/0781.Rabbits-in-Forest.md" >}})|Medium||||55.7%| -|0791|Custom Sort String|[Go]({{< relref "/ChapterFour/0700~0799/0791.Custom-Sort-String.md" >}})|Medium||||69.2%| -|0792|Number of Matching Subsequences|[Go]({{< relref "/ChapterFour/0700~0799/0792.Number-of-Matching-Subsequences.md" >}})|Medium||||50.5%| -|0811|Subdomain Visit Count|[Go]({{< relref "/ChapterFour/0800~0899/0811.Subdomain-Visit-Count.md" >}})|Medium||||74.2%| -|0815|Bus Routes|[Go]({{< relref "/ChapterFour/0800~0899/0815.Bus-Routes.md" >}})|Hard||||45.3%| -|0817|Linked List Components|[Go]({{< relref "/ChapterFour/0800~0899/0817.Linked-List-Components.md" >}})|Medium||||58.1%| -|0819|Most Common Word|[Go]({{< relref "/ChapterFour/0800~0899/0819.Most-Common-Word.md" >}})|Easy||||45.2%| -|0820|Short Encoding of Words|[Go]({{< relref "/ChapterFour/0800~0899/0820.Short-Encoding-of-Words.md" >}})|Medium||||55.3%| -|0823|Binary Trees With Factors|[Go]({{< relref "/ChapterFour/0800~0899/0823.Binary-Trees-With-Factors.md" >}})|Medium||||43.7%| +|0424|Longest Repeating Character Replacement|[Go]({{< relref "/ChapterFour/0400~0499/0424.Longest-Repeating-Character-Replacement.md" >}})|Medium||||52.0%| +|0433|Minimum Genetic Mutation|[Go]({{< relref "/ChapterFour/0400~0499/0433.Minimum-Genetic-Mutation.md" >}})|Medium||||52.4%| +|0438|Find All Anagrams in a String|[Go]({{< relref "/ChapterFour/0400~0499/0438.Find-All-Anagrams-in-a-String.md" >}})|Medium| O(n)| O(1) ||50.2%| +|0447|Number of Boomerangs|[Go]({{< relref "/ChapterFour/0400~0499/0447.Number-of-Boomerangs.md" >}})|Medium| O(n)| O(1) ||54.9%| +|0448|Find All Numbers Disappeared in an Array|[Go]({{< relref "/ChapterFour/0400~0499/0448.Find-All-Numbers-Disappeared-in-an-Array.md" >}})|Easy||||59.9%| +|0451|Sort Characters By Frequency|[Go]({{< relref "/ChapterFour/0400~0499/0451.Sort-Characters-By-Frequency.md" >}})|Medium| O(n log n)| O(1) ||70.1%| +|0454|4Sum II|[Go]({{< relref "/ChapterFour/0400~0499/0454.4Sum-II.md" >}})|Medium| O(n^2)| O(n) ||57.2%| +|0457|Circular Array Loop|[Go]({{< relref "/ChapterFour/0400~0499/0457.Circular-Array-Loop.md" >}})|Medium||||32.6%| +|0460|LFU Cache|[Go]({{< relref "/ChapterFour/0400~0499/0460.LFU-Cache.md" >}})|Hard||||43.0%| +|0480|Sliding Window Median|[Go]({{< relref "/ChapterFour/0400~0499/0480.Sliding-Window-Median.md" >}})|Hard||||41.1%| +|0491|Non-decreasing Subsequences|[Go]({{< relref "/ChapterFour/0400~0499/0491.Non-decreasing-Subsequences.md" >}})|Medium||||60.2%| +|0496|Next Greater Element I|[Go]({{< relref "/ChapterFour/0400~0499/0496.Next-Greater-Element-I.md" >}})|Easy||||71.4%| +|0500|Keyboard Row|[Go]({{< relref "/ChapterFour/0500~0599/0500.Keyboard-Row.md" >}})|Easy||||69.6%| +|0508|Most Frequent Subtree Sum|[Go]({{< relref "/ChapterFour/0500~0599/0508.Most-Frequent-Subtree-Sum.md" >}})|Medium||||64.9%| +|0519|Random Flip Matrix|[Go]({{< relref "/ChapterFour/0500~0599/0519.Random-Flip-Matrix.md" >}})|Medium||||40.0%| +|0523|Continuous Subarray Sum|[Go]({{< relref "/ChapterFour/0500~0599/0523.Continuous-Subarray-Sum.md" >}})|Medium||||28.5%| +|0525|Contiguous Array|[Go]({{< relref "/ChapterFour/0500~0599/0525.Contiguous-Array.md" >}})|Medium||||46.8%| +|0532|K-diff Pairs in an Array|[Go]({{< relref "/ChapterFour/0500~0599/0532.K-diff-Pairs-in-an-Array.md" >}})|Medium||||41.2%| +|0535|Encode and Decode TinyURL|[Go]({{< relref "/ChapterFour/0500~0599/0535.Encode-and-Decode-TinyURL.md" >}})|Medium||||86.0%| +|0554|Brick Wall|[Go]({{< relref "/ChapterFour/0500~0599/0554.Brick-Wall.md" >}})|Medium||||53.6%| +|0560|Subarray Sum Equals K|[Go]({{< relref "/ChapterFour/0500~0599/0560.Subarray-Sum-Equals-K.md" >}})|Medium||||43.7%| +|0567|Permutation in String|[Go]({{< relref "/ChapterFour/0500~0599/0567.Permutation-in-String.md" >}})|Medium||||44.3%| +|0575|Distribute Candies|[Go]({{< relref "/ChapterFour/0500~0599/0575.Distribute-Candies.md" >}})|Easy||||66.5%| +|0594|Longest Harmonious Subsequence|[Go]({{< relref "/ChapterFour/0500~0599/0594.Longest-Harmonious-Subsequence.md" >}})|Easy||||53.5%| +|0599|Minimum Index Sum of Two Lists|[Go]({{< relref "/ChapterFour/0500~0599/0599.Minimum-Index-Sum-of-Two-Lists.md" >}})|Easy||||53.4%| +|0609|Find Duplicate File in System|[Go]({{< relref "/ChapterFour/0600~0699/0609.Find-Duplicate-File-in-System.md" >}})|Medium||||67.7%| +|0632|Smallest Range Covering Elements from K Lists|[Go]({{< relref "/ChapterFour/0600~0699/0632.Smallest-Range-Covering-Elements-from-K-Lists.md" >}})|Hard||||61.0%| +|0645|Set Mismatch|[Go]({{< relref "/ChapterFour/0600~0699/0645.Set-Mismatch.md" >}})|Easy||||42.7%| +|0648|Replace Words|[Go]({{< relref "/ChapterFour/0600~0699/0648.Replace-Words.md" >}})|Medium| O(n)| O(n) ||62.7%| +|0653|Two Sum IV - Input is a BST|[Go]({{< relref "/ChapterFour/0600~0699/0653.Two-Sum-IV-Input-is-a-BST.md" >}})|Easy||||61.0%| +|0676|Implement Magic Dictionary|[Go]({{< relref "/ChapterFour/0600~0699/0676.Implement-Magic-Dictionary.md" >}})|Medium| O(n)| O(n) ||56.9%| +|0677|Map Sum Pairs|[Go]({{< relref "/ChapterFour/0600~0699/0677.Map-Sum-Pairs.md" >}})|Medium||||56.8%| +|0690|Employee Importance|[Go]({{< relref "/ChapterFour/0600~0699/0690.Employee-Importance.md" >}})|Medium||||65.6%| +|0692|Top K Frequent Words|[Go]({{< relref "/ChapterFour/0600~0699/0692.Top-K-Frequent-Words.md" >}})|Medium||||57.2%| +|0697|Degree of an Array|[Go]({{< relref "/ChapterFour/0600~0699/0697.Degree-of-an-Array.md" >}})|Easy||||56.0%| +|0705|Design HashSet|[Go]({{< relref "/ChapterFour/0700~0799/0705.Design-HashSet.md" >}})|Easy||||65.6%| +|0706|Design HashMap|[Go]({{< relref "/ChapterFour/0700~0799/0706.Design-HashMap.md" >}})|Easy||||64.7%| +|0710|Random Pick with Blacklist|[Go]({{< relref "/ChapterFour/0700~0799/0710.Random-Pick-with-Blacklist.md" >}})|Hard| O(n)| O(n) ||33.5%| +|0720|Longest Word in Dictionary|[Go]({{< relref "/ChapterFour/0700~0799/0720.Longest-Word-in-Dictionary.md" >}})|Medium| O(n)| O(n) ||52.0%| +|0726|Number of Atoms|[Go]({{< relref "/ChapterFour/0700~0799/0726.Number-of-Atoms.md" >}})|Hard| O(n)| O(n) |❤️|52.2%| +|0745|Prefix and Suffix Search|[Go]({{< relref "/ChapterFour/0700~0799/0745.Prefix-and-Suffix-Search.md" >}})|Hard||||41.2%| +|0748|Shortest Completing Word|[Go]({{< relref "/ChapterFour/0700~0799/0748.Shortest-Completing-Word.md" >}})|Easy||||59.3%| +|0752|Open the Lock|[Go]({{< relref "/ChapterFour/0700~0799/0752.Open-the-Lock.md" >}})|Medium||||55.6%| +|0763|Partition Labels|[Go]({{< relref "/ChapterFour/0700~0799/0763.Partition-Labels.md" >}})|Medium||||79.7%| +|0767|Reorganize String|[Go]({{< relref "/ChapterFour/0700~0799/0767.Reorganize-String.md" >}})|Medium||||52.9%| +|0771|Jewels and Stones|[Go]({{< relref "/ChapterFour/0700~0799/0771.Jewels-and-Stones.md" >}})|Easy||||88.2%| +|0781|Rabbits in Forest|[Go]({{< relref "/ChapterFour/0700~0799/0781.Rabbits-in-Forest.md" >}})|Medium||||54.7%| +|0791|Custom Sort String|[Go]({{< relref "/ChapterFour/0700~0799/0791.Custom-Sort-String.md" >}})|Medium||||69.1%| +|0792|Number of Matching Subsequences|[Go]({{< relref "/ChapterFour/0700~0799/0792.Number-of-Matching-Subsequences.md" >}})|Medium||||51.6%| +|0811|Subdomain Visit Count|[Go]({{< relref "/ChapterFour/0800~0899/0811.Subdomain-Visit-Count.md" >}})|Medium||||75.5%| +|0815|Bus Routes|[Go]({{< relref "/ChapterFour/0800~0899/0815.Bus-Routes.md" >}})|Hard||||45.6%| +|0817|Linked List Components|[Go]({{< relref "/ChapterFour/0800~0899/0817.Linked-List-Components.md" >}})|Medium||||57.7%| +|0819|Most Common Word|[Go]({{< relref "/ChapterFour/0800~0899/0819.Most-Common-Word.md" >}})|Easy||||44.7%| +|0820|Short Encoding of Words|[Go]({{< relref "/ChapterFour/0800~0899/0820.Short-Encoding-of-Words.md" >}})|Medium||||60.6%| +|0823|Binary Trees With Factors|[Go]({{< relref "/ChapterFour/0800~0899/0823.Binary-Trees-With-Factors.md" >}})|Medium||||49.7%| +|0828|Count Unique Characters of All Substrings of a Given String|[Go]({{< relref "/ChapterFour/0800~0899/0828.Count-Unique-Characters-of-All-Substrings-of-a-Given-String.md" >}})|Hard||||51.6%| |0846|Hand of Straights|[Go]({{< relref "/ChapterFour/0800~0899/0846.Hand-of-Straights.md" >}})|Medium||||56.2%| -|0859|Buddy Strings|[Go]({{< relref "/ChapterFour/0800~0899/0859.Buddy-Strings.md" >}})|Easy||||28.8%| -|0884|Uncommon Words from Two Sentences|[Go]({{< relref "/ChapterFour/0800~0899/0884.Uncommon-Words-from-Two-Sentences.md" >}})|Easy||||65.6%| -|0888|Fair Candy Swap|[Go]({{< relref "/ChapterFour/0800~0899/0888.Fair-Candy-Swap.md" >}})|Easy||||60.4%| -|0890|Find and Replace Pattern|[Go]({{< relref "/ChapterFour/0800~0899/0890.Find-and-Replace-Pattern.md" >}})|Medium||||75.6%| -|0895|Maximum Frequency Stack|[Go]({{< relref "/ChapterFour/0800~0899/0895.Maximum-Frequency-Stack.md" >}})|Hard| O(n)| O(n) ||66.4%| -|0904|Fruit Into Baskets|[Go]({{< relref "/ChapterFour/0900~0999/0904.Fruit-Into-Baskets.md" >}})|Medium||||42.8%| -|0911|Online Election|[Go]({{< relref "/ChapterFour/0900~0999/0911.Online-Election.md" >}})|Medium||||51.6%| -|0914|X of a Kind in a Deck of Cards|[Go]({{< relref "/ChapterFour/0900~0999/0914.X-of-a-Kind-in-a-Deck-of-Cards.md" >}})|Easy||||32.9%| -|0916|Word Subsets|[Go]({{< relref "/ChapterFour/0900~0999/0916.Word-Subsets.md" >}})|Medium||||52.6%| -|0923|3Sum With Multiplicity|[Go]({{< relref "/ChapterFour/0900~0999/0923.3Sum-With-Multiplicity.md" >}})|Medium||||45.4%| -|0930|Binary Subarrays With Sum|[Go]({{< relref "/ChapterFour/0900~0999/0930.Binary-Subarrays-With-Sum.md" >}})|Medium| O(n)| O(n) |❤️|48.9%| -|0953|Verifying an Alien Dictionary|[Go]({{< relref "/ChapterFour/0900~0999/0953.Verifying-an-Alien-Dictionary.md" >}})|Easy||||52.5%| -|0961|N-Repeated Element in Size 2N Array|[Go]({{< relref "/ChapterFour/0900~0999/0961.N-Repeated-Element-in-Size-2N-Array.md" >}})|Easy||||75.5%| -|0966|Vowel Spellchecker|[Go]({{< relref "/ChapterFour/0900~0999/0966.Vowel-Spellchecker.md" >}})|Medium||||51.6%| +|0859|Buddy Strings|[Go]({{< relref "/ChapterFour/0800~0899/0859.Buddy-Strings.md" >}})|Easy||||29.2%| +|0884|Uncommon Words from Two Sentences|[Go]({{< relref "/ChapterFour/0800~0899/0884.Uncommon-Words-from-Two-Sentences.md" >}})|Easy||||66.4%| +|0888|Fair Candy Swap|[Go]({{< relref "/ChapterFour/0800~0899/0888.Fair-Candy-Swap.md" >}})|Easy||||60.7%| +|0890|Find and Replace Pattern|[Go]({{< relref "/ChapterFour/0800~0899/0890.Find-and-Replace-Pattern.md" >}})|Medium||||77.6%| +|0895|Maximum Frequency Stack|[Go]({{< relref "/ChapterFour/0800~0899/0895.Maximum-Frequency-Stack.md" >}})|Hard| O(n)| O(n) ||66.6%| +|0904|Fruit Into Baskets|[Go]({{< relref "/ChapterFour/0900~0999/0904.Fruit-Into-Baskets.md" >}})|Medium||||43.7%| +|0911|Online Election|[Go]({{< relref "/ChapterFour/0900~0999/0911.Online-Election.md" >}})|Medium||||52.2%| +|0914|X of a Kind in a Deck of Cards|[Go]({{< relref "/ChapterFour/0900~0999/0914.X-of-a-Kind-in-a-Deck-of-Cards.md" >}})|Easy||||31.2%| +|0916|Word Subsets|[Go]({{< relref "/ChapterFour/0900~0999/0916.Word-Subsets.md" >}})|Medium||||53.7%| +|0923|3Sum With Multiplicity|[Go]({{< relref "/ChapterFour/0900~0999/0923.3Sum-With-Multiplicity.md" >}})|Medium||||45.3%| +|0930|Binary Subarrays With Sum|[Go]({{< relref "/ChapterFour/0900~0999/0930.Binary-Subarrays-With-Sum.md" >}})|Medium| O(n)| O(n) |❤️|52.2%| +|0953|Verifying an Alien Dictionary|[Go]({{< relref "/ChapterFour/0900~0999/0953.Verifying-an-Alien-Dictionary.md" >}})|Easy||||54.5%| +|0961|N-Repeated Element in Size 2N Array|[Go]({{< relref "/ChapterFour/0900~0999/0961.N-Repeated-Element-in-Size-2N-Array.md" >}})|Easy||||76.1%| +|0966|Vowel Spellchecker|[Go]({{< relref "/ChapterFour/0900~0999/0966.Vowel-Spellchecker.md" >}})|Medium||||51.4%| |0970|Powerful Integers|[Go]({{< relref "/ChapterFour/0900~0999/0970.Powerful-Integers.md" >}})|Medium||||43.6%| -|0981|Time Based Key-Value Store|[Go]({{< relref "/ChapterFour/0900~0999/0981.Time-Based-Key-Value-Store.md" >}})|Medium||||52.7%| -|0987|Vertical Order Traversal of a Binary Tree|[Go]({{< relref "/ChapterFour/0900~0999/0987.Vertical-Order-Traversal-of-a-Binary-Tree.md" >}})|Hard||||41.6%| -|0992|Subarrays with K Different Integers|[Go]({{< relref "/ChapterFour/0900~0999/0992.Subarrays-with-K-Different-Integers.md" >}})|Hard| O(n)| O(n) |❤️|53.4%| -|0997|Find the Town Judge|[Go]({{< relref "/ChapterFour/0900~0999/0997.Find-the-Town-Judge.md" >}})|Easy||||49.8%| -|1002|Find Common Characters|[Go]({{< relref "/ChapterFour/1000~1099/1002.Find-Common-Characters.md" >}})|Easy||||68.4%| -|1010|Pairs of Songs With Total Durations Divisible by 60|[Go]({{< relref "/ChapterFour/1000~1099/1010.Pairs-of-Songs-With-Total-Durations-Divisible-by-60.md" >}})|Medium||||53.6%| -|1048|Longest String Chain|[Go]({{< relref "/ChapterFour/1000~1099/1048.Longest-String-Chain.md" >}})|Medium||||57.8%| -|1054|Distant Barcodes|[Go]({{< relref "/ChapterFour/1000~1099/1054.Distant-Barcodes.md" >}})|Medium||||45.2%| -|1074|Number of Submatrices That Sum to Target|[Go]({{< relref "/ChapterFour/1000~1099/1074.Number-of-Submatrices-That-Sum-to-Target.md" >}})|Hard||||66.3%| -|1122|Relative Sort Array|[Go]({{< relref "/ChapterFour/1100~1199/1122.Relative-Sort-Array.md" >}})|Easy||||68.2%| -|1123|Lowest Common Ancestor of Deepest Leaves|[Go]({{< relref "/ChapterFour/1100~1199/1123.Lowest-Common-Ancestor-of-Deepest-Leaves.md" >}})|Medium||||70.2%| -|1128|Number of Equivalent Domino Pairs|[Go]({{< relref "/ChapterFour/1100~1199/1128.Number-of-Equivalent-Domino-Pairs.md" >}})|Easy||||46.3%| -|1160|Find Words That Can Be Formed by Characters|[Go]({{< relref "/ChapterFour/1100~1199/1160.Find-Words-That-Can-Be-Formed-by-Characters.md" >}})|Easy||||67.7%| -|1170|Compare Strings by Frequency of the Smallest Character|[Go]({{< relref "/ChapterFour/1100~1199/1170.Compare-Strings-by-Frequency-of-the-Smallest-Character.md" >}})|Medium||||61.1%| -|1171|Remove Zero Sum Consecutive Nodes from Linked List|[Go]({{< relref "/ChapterFour/1100~1199/1171.Remove-Zero-Sum-Consecutive-Nodes-from-Linked-List.md" >}})|Medium||||42.6%| -|1178|Number of Valid Words for Each Puzzle|[Go]({{< relref "/ChapterFour/1100~1199/1178.Number-of-Valid-Words-for-Each-Puzzle.md" >}})|Hard||||46.8%| -|1189|Maximum Number of Balloons|[Go]({{< relref "/ChapterFour/1100~1199/1189.Maximum-Number-of-Balloons.md" >}})|Easy||||62.5%| -|1202|Smallest String With Swaps|[Go]({{< relref "/ChapterFour/1200~1299/1202.Smallest-String-With-Swaps.md" >}})|Medium||||57.1%| -|1207|Unique Number of Occurrences|[Go]({{< relref "/ChapterFour/1200~1299/1207.Unique-Number-of-Occurrences.md" >}})|Easy||||71.9%| -|1275|Find Winner on a Tic Tac Toe Game|[Go]({{< relref "/ChapterFour/1200~1299/1275.Find-Winner-on-a-Tic-Tac-Toe-Game.md" >}})|Easy||||54.8%| +|0981|Time Based Key-Value Store|[Go]({{< relref "/ChapterFour/0900~0999/0981.Time-Based-Key-Value-Store.md" >}})|Medium||||52.2%| +|0987|Vertical Order Traversal of a Binary Tree|[Go]({{< relref "/ChapterFour/0900~0999/0987.Vertical-Order-Traversal-of-a-Binary-Tree.md" >}})|Hard||||45.1%| +|0992|Subarrays with K Different Integers|[Go]({{< relref "/ChapterFour/0900~0999/0992.Subarrays-with-K-Different-Integers.md" >}})|Hard| O(n)| O(n) |❤️|54.6%| +|0997|Find the Town Judge|[Go]({{< relref "/ChapterFour/0900~0999/0997.Find-the-Town-Judge.md" >}})|Easy||||49.5%| +|1002|Find Common Characters|[Go]({{< relref "/ChapterFour/1000~1099/1002.Find-Common-Characters.md" >}})|Easy||||68.5%| +|1010|Pairs of Songs With Total Durations Divisible by 60|[Go]({{< relref "/ChapterFour/1000~1099/1010.Pairs-of-Songs-With-Total-Durations-Divisible-by-60.md" >}})|Medium||||52.8%| +|1048|Longest String Chain|[Go]({{< relref "/ChapterFour/1000~1099/1048.Longest-String-Chain.md" >}})|Medium||||59.3%| +|1054|Distant Barcodes|[Go]({{< relref "/ChapterFour/1000~1099/1054.Distant-Barcodes.md" >}})|Medium||||45.9%| +|1074|Number of Submatrices That Sum to Target|[Go]({{< relref "/ChapterFour/1000~1099/1074.Number-of-Submatrices-That-Sum-to-Target.md" >}})|Hard||||69.5%| +|1079|Letter Tile Possibilities|[Go]({{< relref "/ChapterFour/1000~1099/1079.Letter-Tile-Possibilities.md" >}})|Medium||||76.0%| +|1122|Relative Sort Array|[Go]({{< relref "/ChapterFour/1100~1199/1122.Relative-Sort-Array.md" >}})|Easy||||68.6%| +|1123|Lowest Common Ancestor of Deepest Leaves|[Go]({{< relref "/ChapterFour/1100~1199/1123.Lowest-Common-Ancestor-of-Deepest-Leaves.md" >}})|Medium||||70.9%| +|1128|Number of Equivalent Domino Pairs|[Go]({{< relref "/ChapterFour/1100~1199/1128.Number-of-Equivalent-Domino-Pairs.md" >}})|Easy||||47.1%| +|1160|Find Words That Can Be Formed by Characters|[Go]({{< relref "/ChapterFour/1100~1199/1160.Find-Words-That-Can-Be-Formed-by-Characters.md" >}})|Easy||||67.5%| +|1170|Compare Strings by Frequency of the Smallest Character|[Go]({{< relref "/ChapterFour/1100~1199/1170.Compare-Strings-by-Frequency-of-the-Smallest-Character.md" >}})|Medium||||61.5%| +|1171|Remove Zero Sum Consecutive Nodes from Linked List|[Go]({{< relref "/ChapterFour/1100~1199/1171.Remove-Zero-Sum-Consecutive-Nodes-from-Linked-List.md" >}})|Medium||||43.2%| +|1178|Number of Valid Words for Each Puzzle|[Go]({{< relref "/ChapterFour/1100~1199/1178.Number-of-Valid-Words-for-Each-Puzzle.md" >}})|Hard||||46.3%| +|1189|Maximum Number of Balloons|[Go]({{< relref "/ChapterFour/1100~1199/1189.Maximum-Number-of-Balloons.md" >}})|Easy||||61.0%| +|1202|Smallest String With Swaps|[Go]({{< relref "/ChapterFour/1200~1299/1202.Smallest-String-With-Swaps.md" >}})|Medium||||57.7%| +|1207|Unique Number of Occurrences|[Go]({{< relref "/ChapterFour/1200~1299/1207.Unique-Number-of-Occurrences.md" >}})|Easy||||73.5%| +|1275|Find Winner on a Tic Tac Toe Game|[Go]({{< relref "/ChapterFour/1200~1299/1275.Find-Winner-on-a-Tic-Tac-Toe-Game.md" >}})|Easy||||54.2%| |1296|Divide Array in Sets of K Consecutive Numbers|[Go]({{< relref "/ChapterFour/1200~1299/1296.Divide-Array-in-Sets-of-K-Consecutive-Numbers.md" >}})|Medium||||56.5%| -|1396|Design Underground System|[Go]({{< relref "/ChapterFour/1300~1399/1396.Design-Underground-System.md" >}})|Medium||||73.5%| -|1442|Count Triplets That Can Form Two Arrays of Equal XOR|[Go]({{< relref "/ChapterFour/1400~1499/1442.Count-Triplets-That-Can-Form-Two-Arrays-of-Equal-XOR.md" >}})|Medium||||74.8%| -|1461|Check If a String Contains All Binary Codes of Size K|[Go]({{< relref "/ChapterFour/1400~1499/1461.Check-If-a-String-Contains-All-Binary-Codes-of-Size-K.md" >}})|Medium||||54.5%| -|1512|Number of Good Pairs|[Go]({{< relref "/ChapterFour/1500~1599/1512.Number-of-Good-Pairs.md" >}})|Easy||||88.0%| -|1600|Throne Inheritance|[Go]({{< relref "/ChapterFour/1600~1699/1600.Throne-Inheritance.md" >}})|Medium||||63.2%| -|1624|Largest Substring Between Two Equal Characters|[Go]({{< relref "/ChapterFour/1600~1699/1624.Largest-Substring-Between-Two-Equal-Characters.md" >}})|Easy||||59.3%| -|1636|Sort Array by Increasing Frequency|[Go]({{< relref "/ChapterFour/1600~1699/1636.Sort-Array-by-Increasing-Frequency.md" >}})|Easy||||68.4%| -|1640|Check Array Formation Through Concatenation|[Go]({{< relref "/ChapterFour/1600~1699/1640.Check-Array-Formation-Through-Concatenation.md" >}})|Easy||||55.8%| -|1656|Design an Ordered Stream|[Go]({{< relref "/ChapterFour/1600~1699/1656.Design-an-Ordered-Stream.md" >}})|Easy||||83.8%| -|1657|Determine if Two Strings Are Close|[Go]({{< relref "/ChapterFour/1600~1699/1657.Determine-if-Two-Strings-Are-Close.md" >}})|Medium||||54.5%| -|1658|Minimum Operations to Reduce X to Zero|[Go]({{< relref "/ChapterFour/1600~1699/1658.Minimum-Operations-to-Reduce-X-to-Zero.md" >}})|Medium||||33.6%| -|1674|Minimum Moves to Make Array Complementary|[Go]({{< relref "/ChapterFour/1600~1699/1674.Minimum-Moves-to-Make-Array-Complementary.md" >}})|Medium||||37.3%| -|1679|Max Number of K-Sum Pairs|[Go]({{< relref "/ChapterFour/1600~1699/1679.Max-Number-of-K-Sum-Pairs.md" >}})|Medium||||57.7%| -|1684|Count the Number of Consistent Strings|[Go]({{< relref "/ChapterFour/1600~1699/1684.Count-the-Number-of-Consistent-Strings.md" >}})|Easy||||81.8%| -|1695|Maximum Erasure Value|[Go]({{< relref "/ChapterFour/1600~1699/1695.Maximum-Erasure-Value.md" >}})|Medium||||52.4%| -|1742|Maximum Number of Balls in a Box|[Go]({{< relref "/ChapterFour/1700~1799/1742.Maximum-Number-of-Balls-in-a-Box.md" >}})|Easy||||73.7%| -|1748|Sum of Unique Elements|[Go]({{< relref "/ChapterFour/1700~1799/1748.Sum-of-Unique-Elements.md" >}})|Easy||||75.6%| -|1763|Longest Nice Substring|[Go]({{< relref "/ChapterFour/1700~1799/1763.Longest-Nice-Substring.md" >}})|Easy||||61.8%| -|2166|Design Bitset|[Go]({{< relref "/ChapterFour/2100~2199/2166.Design-Bitset.md" >}})|Medium||||29.7%| -|2170|Minimum Operations to Make the Array Alternating|[Go]({{< relref "/ChapterFour/2100~2199/2170.Minimum-Operations-to-Make-the-Array-Alternating.md" >}})|Medium||||32.8%| +|1396|Design Underground System|[Go]({{< relref "/ChapterFour/1300~1399/1396.Design-Underground-System.md" >}})|Medium||||73.6%| +|1442|Count Triplets That Can Form Two Arrays of Equal XOR|[Go]({{< relref "/ChapterFour/1400~1499/1442.Count-Triplets-That-Can-Form-Two-Arrays-of-Equal-XOR.md" >}})|Medium||||76.1%| +|1461|Check If a String Contains All Binary Codes of Size K|[Go]({{< relref "/ChapterFour/1400~1499/1461.Check-If-a-String-Contains-All-Binary-Codes-of-Size-K.md" >}})|Medium||||56.6%| +|1512|Number of Good Pairs|[Go]({{< relref "/ChapterFour/1500~1599/1512.Number-of-Good-Pairs.md" >}})|Easy||||88.2%| +|1600|Throne Inheritance|[Go]({{< relref "/ChapterFour/1600~1699/1600.Throne-Inheritance.md" >}})|Medium||||63.6%| +|1624|Largest Substring Between Two Equal Characters|[Go]({{< relref "/ChapterFour/1600~1699/1624.Largest-Substring-Between-Two-Equal-Characters.md" >}})|Easy||||59.1%| +|1636|Sort Array by Increasing Frequency|[Go]({{< relref "/ChapterFour/1600~1699/1636.Sort-Array-by-Increasing-Frequency.md" >}})|Easy||||69.5%| +|1640|Check Array Formation Through Concatenation|[Go]({{< relref "/ChapterFour/1600~1699/1640.Check-Array-Formation-Through-Concatenation.md" >}})|Easy||||56.2%| +|1647|Minimum Deletions to Make Character Frequencies Unique|[Go]({{< relref "/ChapterFour/1600~1699/1647.Minimum-Deletions-to-Make-Character-Frequencies-Unique.md" >}})|Medium||||59.1%| +|1656|Design an Ordered Stream|[Go]({{< relref "/ChapterFour/1600~1699/1656.Design-an-Ordered-Stream.md" >}})|Easy||||85.2%| +|1657|Determine if Two Strings Are Close|[Go]({{< relref "/ChapterFour/1600~1699/1657.Determine-if-Two-Strings-Are-Close.md" >}})|Medium||||56.3%| +|1658|Minimum Operations to Reduce X to Zero|[Go]({{< relref "/ChapterFour/1600~1699/1658.Minimum-Operations-to-Reduce-X-to-Zero.md" >}})|Medium||||37.6%| +|1674|Minimum Moves to Make Array Complementary|[Go]({{< relref "/ChapterFour/1600~1699/1674.Minimum-Moves-to-Make-Array-Complementary.md" >}})|Medium||||38.7%| +|1679|Max Number of K-Sum Pairs|[Go]({{< relref "/ChapterFour/1600~1699/1679.Max-Number-of-K-Sum-Pairs.md" >}})|Medium||||57.3%| +|1684|Count the Number of Consistent Strings|[Go]({{< relref "/ChapterFour/1600~1699/1684.Count-the-Number-of-Consistent-Strings.md" >}})|Easy||||82.3%| +|1695|Maximum Erasure Value|[Go]({{< relref "/ChapterFour/1600~1699/1695.Maximum-Erasure-Value.md" >}})|Medium||||57.6%| +|1742|Maximum Number of Balls in a Box|[Go]({{< relref "/ChapterFour/1700~1799/1742.Maximum-Number-of-Balls-in-a-Box.md" >}})|Easy||||73.6%| +|1748|Sum of Unique Elements|[Go]({{< relref "/ChapterFour/1700~1799/1748.Sum-of-Unique-Elements.md" >}})|Easy||||76.3%| +|1763|Longest Nice Substring|[Go]({{< relref "/ChapterFour/1700~1799/1763.Longest-Nice-Substring.md" >}})|Easy||||61.5%| +|2043|Simple Bank System|[Go]({{< relref "/ChapterFour/2000~2099/2043.Simple-Bank-System.md" >}})|Medium||||65.2%| +|2166|Design Bitset|[Go]({{< relref "/ChapterFour/2100~2199/2166.Design-Bitset.md" >}})|Medium||||31.8%| +|2170|Minimum Operations to Make the Array Alternating|[Go]({{< relref "/ChapterFour/2100~2199/2170.Minimum-Operations-to-Make-the-Array-Alternating.md" >}})|Medium||||33.2%| |------------|-------------------------------------------------------|-------| ----------------| ---------------|-------------|-------------|-------------| diff --git a/website/content/ChapterTwo/Linked_List.md b/website/content/ChapterTwo/Linked_List.md index e65bd382c..aa72c67ec 100644 --- a/website/content/ChapterTwo/Linked_List.md +++ b/website/content/ChapterTwo/Linked_List.md @@ -23,50 +23,50 @@ weight: 4 | No. | Title | Solution | Difficulty | TimeComplexity | SpaceComplexity |Favorite| Acceptance | |:--------:|:------- | :--------: | :----------: | :----: | :-----: | :-----: |:-----: | -|0002|Add Two Numbers|[Go]({{< relref "/ChapterFour/0001~0099/0002.Add-Two-Numbers.md" >}})|Medium| O(n)| O(1)||38.6%| -|0019|Remove Nth Node From End of List|[Go]({{< relref "/ChapterFour/0001~0099/0019.Remove-Nth-Node-From-End-of-List.md" >}})|Medium| O(n)| O(1)||38.3%| -|0021|Merge Two Sorted Lists|[Go]({{< relref "/ChapterFour/0001~0099/0021.Merge-Two-Sorted-Lists.md" >}})|Easy| O(log n)| O(1)||60.3%| -|0023|Merge k Sorted Lists|[Go]({{< relref "/ChapterFour/0001~0099/0023.Merge-k-Sorted-Lists.md" >}})|Hard| O(log n)| O(1)|❤️|47.1%| -|0024|Swap Nodes in Pairs|[Go]({{< relref "/ChapterFour/0001~0099/0024.Swap-Nodes-in-Pairs.md" >}})|Medium| O(n)| O(1)||58.8%| -|0025|Reverse Nodes in k-Group|[Go]({{< relref "/ChapterFour/0001~0099/0025.Reverse-Nodes-in-k-Group.md" >}})|Hard| O(log n)| O(1)|❤️|51.1%| -|0061|Rotate List|[Go]({{< relref "/ChapterFour/0001~0099/0061.Rotate-List.md" >}})|Medium| O(n)| O(1)||34.9%| -|0082|Remove Duplicates from Sorted List II|[Go]({{< relref "/ChapterFour/0001~0099/0082.Remove-Duplicates-from-Sorted-List-II.md" >}})|Medium| O(n)| O(1)||44.3%| -|0083|Remove Duplicates from Sorted List|[Go]({{< relref "/ChapterFour/0001~0099/0083.Remove-Duplicates-from-Sorted-List.md" >}})|Easy| O(n)| O(1)||49.0%| -|0086|Partition List|[Go]({{< relref "/ChapterFour/0001~0099/0086.Partition-List.md" >}})|Medium| O(n)| O(1)|❤️|47.9%| -|0092|Reverse Linked List II|[Go]({{< relref "/ChapterFour/0001~0099/0092.Reverse-Linked-List-II.md" >}})|Medium| O(n)| O(1)|❤️|43.4%| -|0109|Convert Sorted List to Binary Search Tree|[Go]({{< relref "/ChapterFour/0100~0199/0109.Convert-Sorted-List-to-Binary-Search-Tree.md" >}})|Medium| O(log n)| O(n)||55.6%| -|0114|Flatten Binary Tree to Linked List|[Go]({{< relref "/ChapterFour/0100~0199/0114.Flatten-Binary-Tree-to-Linked-List.md" >}})|Medium||||57.8%| -|0116|Populating Next Right Pointers in Each Node|[Go]({{< relref "/ChapterFour/0100~0199/0116.Populating-Next-Right-Pointers-in-Each-Node.md" >}})|Medium||||57.0%| -|0138|Copy List with Random Pointer|[Go]({{< relref "/ChapterFour/0100~0199/0138.Copy-List-with-Random-Pointer.md" >}})|Medium||||48.2%| -|0141|Linked List Cycle|[Go]({{< relref "/ChapterFour/0100~0199/0141.Linked-List-Cycle.md" >}})|Easy| O(n)| O(1)|❤️|45.9%| -|0142|Linked List Cycle II|[Go]({{< relref "/ChapterFour/0100~0199/0142.Linked-List-Cycle-II.md" >}})|Medium| O(n)| O(1)|❤️|44.2%| -|0143|Reorder List|[Go]({{< relref "/ChapterFour/0100~0199/0143.Reorder-List.md" >}})|Medium| O(n)| O(1)|❤️|47.9%| -|0146|LRU Cache|[Go]({{< relref "/ChapterFour/0100~0199/0146.LRU-Cache.md" >}})|Medium||||39.9%| -|0147|Insertion Sort List|[Go]({{< relref "/ChapterFour/0100~0199/0147.Insertion-Sort-List.md" >}})|Medium| O(n)| O(1)|❤️|48.9%| -|0148|Sort List|[Go]({{< relref "/ChapterFour/0100~0199/0148.Sort-List.md" >}})|Medium| O(n log n)| O(n)|❤️|52.1%| -|0160|Intersection of Two Linked Lists|[Go]({{< relref "/ChapterFour/0100~0199/0160.Intersection-of-Two-Linked-Lists.md" >}})|Easy| O(n)| O(1)|❤️|49.9%| -|0203|Remove Linked List Elements|[Go]({{< relref "/ChapterFour/0200~0299/0203.Remove-Linked-List-Elements.md" >}})|Easy| O(n)| O(1)||43.5%| -|0206|Reverse Linked List|[Go]({{< relref "/ChapterFour/0200~0299/0206.Reverse-Linked-List.md" >}})|Easy| O(n)| O(1)||70.3%| -|0234|Palindrome Linked List|[Go]({{< relref "/ChapterFour/0200~0299/0234.Palindrome-Linked-List.md" >}})|Easy| O(n)| O(1)||46.6%| -|0237|Delete Node in a Linked List|[Go]({{< relref "/ChapterFour/0200~0299/0237.Delete-Node-in-a-Linked-List.md" >}})|Easy| O(n)| O(1)||71.9%| -|0328|Odd Even Linked List|[Go]({{< relref "/ChapterFour/0300~0399/0328.Odd-Even-Linked-List.md" >}})|Medium| O(n)| O(1)||59.5%| -|0382|Linked List Random Node|[Go]({{< relref "/ChapterFour/0300~0399/0382.Linked-List-Random-Node.md" >}})|Medium||||59.0%| -|0445|Add Two Numbers II|[Go]({{< relref "/ChapterFour/0400~0499/0445.Add-Two-Numbers-II.md" >}})|Medium| O(n)| O(n)||58.6%| -|0460|LFU Cache|[Go]({{< relref "/ChapterFour/0400~0499/0460.LFU-Cache.md" >}})|Hard||||39.4%| -|0622|Design Circular Queue|[Go]({{< relref "/ChapterFour/0600~0699/0622.Design-Circular-Queue.md" >}})|Medium||||48.7%| -|0705|Design HashSet|[Go]({{< relref "/ChapterFour/0700~0799/0705.Design-HashSet.md" >}})|Easy||||66.5%| -|0706|Design HashMap|[Go]({{< relref "/ChapterFour/0700~0799/0706.Design-HashMap.md" >}})|Easy||||65.3%| -|0707|Design Linked List|[Go]({{< relref "/ChapterFour/0700~0799/0707.Design-Linked-List.md" >}})|Medium| O(n)| O(1)||27.0%| -|0725|Split Linked List in Parts|[Go]({{< relref "/ChapterFour/0700~0799/0725.Split-Linked-List-in-Parts.md" >}})|Medium| O(n)| O(1)||56.9%| -|0817|Linked List Components|[Go]({{< relref "/ChapterFour/0800~0899/0817.Linked-List-Components.md" >}})|Medium| O(n)| O(1)||58.1%| -|0876|Middle of the Linked List|[Go]({{< relref "/ChapterFour/0800~0899/0876.Middle-of-the-Linked-List.md" >}})|Easy| O(n)| O(1)|❤️|72.6%| -|1019|Next Greater Node In Linked List|[Go]({{< relref "/ChapterFour/1000~1099/1019.Next-Greater-Node-In-Linked-List.md" >}})|Medium| O(n)| O(1)||59.6%| -|1171|Remove Zero Sum Consecutive Nodes from Linked List|[Go]({{< relref "/ChapterFour/1100~1199/1171.Remove-Zero-Sum-Consecutive-Nodes-from-Linked-List.md" >}})|Medium||||42.6%| -|1290|Convert Binary Number in a Linked List to Integer|[Go]({{< relref "/ChapterFour/1200~1299/1290.Convert-Binary-Number-in-a-Linked-List-to-Integer.md" >}})|Easy||||82.7%| -|1669|Merge In Between Linked Lists|[Go]({{< relref "/ChapterFour/1600~1699/1669.Merge-In-Between-Linked-Lists.md" >}})|Medium||||74.5%| -|1670|Design Front Middle Back Queue|[Go]({{< relref "/ChapterFour/1600~1699/1670.Design-Front-Middle-Back-Queue.md" >}})|Medium||||55.6%| -|1721|Swapping Nodes in a Linked List|[Go]({{< relref "/ChapterFour/1700~1799/1721.Swapping-Nodes-in-a-Linked-List.md" >}})|Medium||||68.4%| -|2181|Merge Nodes in Between Zeros|[Go]({{< relref "/ChapterFour/2100~2199/2181.Merge-Nodes-in-Between-Zeros.md" >}})|Medium||||87.1%| +|0002|Add Two Numbers|[Go]({{< relref "/ChapterFour/0001~0099/0002.Add-Two-Numbers.md" >}})|Medium| O(n)| O(1)||40.4%| +|0019|Remove Nth Node From End of List|[Go]({{< relref "/ChapterFour/0001~0099/0019.Remove-Nth-Node-From-End-of-List.md" >}})|Medium| O(n)| O(1)||41.1%| +|0021|Merge Two Sorted Lists|[Go]({{< relref "/ChapterFour/0001~0099/0021.Merge-Two-Sorted-Lists.md" >}})|Easy| O(log n)| O(1)||62.5%| +|0023|Merge k Sorted Lists|[Go]({{< relref "/ChapterFour/0001~0099/0023.Merge-k-Sorted-Lists.md" >}})|Hard| O(log n)| O(1)|❤️|49.8%| +|0024|Swap Nodes in Pairs|[Go]({{< relref "/ChapterFour/0001~0099/0024.Swap-Nodes-in-Pairs.md" >}})|Medium| O(n)| O(1)||61.3%| +|0025|Reverse Nodes in k-Group|[Go]({{< relref "/ChapterFour/0001~0099/0025.Reverse-Nodes-in-k-Group.md" >}})|Hard| O(log n)| O(1)|❤️|54.7%| +|0061|Rotate List|[Go]({{< relref "/ChapterFour/0001~0099/0061.Rotate-List.md" >}})|Medium| O(n)| O(1)||36.1%| +|0082|Remove Duplicates from Sorted List II|[Go]({{< relref "/ChapterFour/0001~0099/0082.Remove-Duplicates-from-Sorted-List-II.md" >}})|Medium| O(n)| O(1)||45.9%| +|0083|Remove Duplicates from Sorted List|[Go]({{< relref "/ChapterFour/0001~0099/0083.Remove-Duplicates-from-Sorted-List.md" >}})|Easy| O(n)| O(1)||50.6%| +|0086|Partition List|[Go]({{< relref "/ChapterFour/0001~0099/0086.Partition-List.md" >}})|Medium| O(n)| O(1)|❤️|52.0%| +|0092|Reverse Linked List II|[Go]({{< relref "/ChapterFour/0001~0099/0092.Reverse-Linked-List-II.md" >}})|Medium| O(n)| O(1)|❤️|45.4%| +|0109|Convert Sorted List to Binary Search Tree|[Go]({{< relref "/ChapterFour/0100~0199/0109.Convert-Sorted-List-to-Binary-Search-Tree.md" >}})|Medium| O(log n)| O(n)||60.2%| +|0114|Flatten Binary Tree to Linked List|[Go]({{< relref "/ChapterFour/0100~0199/0114.Flatten-Binary-Tree-to-Linked-List.md" >}})|Medium||||61.8%| +|0116|Populating Next Right Pointers in Each Node|[Go]({{< relref "/ChapterFour/0100~0199/0116.Populating-Next-Right-Pointers-in-Each-Node.md" >}})|Medium||||60.4%| +|0138|Copy List with Random Pointer|[Go]({{< relref "/ChapterFour/0100~0199/0138.Copy-List-with-Random-Pointer.md" >}})|Medium||||51.4%| +|0141|Linked List Cycle|[Go]({{< relref "/ChapterFour/0100~0199/0141.Linked-List-Cycle.md" >}})|Easy| O(n)| O(1)|❤️|47.5%| +|0142|Linked List Cycle II|[Go]({{< relref "/ChapterFour/0100~0199/0142.Linked-List-Cycle-II.md" >}})|Medium| O(n)| O(1)|❤️|48.8%| +|0143|Reorder List|[Go]({{< relref "/ChapterFour/0100~0199/0143.Reorder-List.md" >}})|Medium| O(n)| O(1)|❤️|52.6%| +|0146|LRU Cache|[Go]({{< relref "/ChapterFour/0100~0199/0146.LRU-Cache.md" >}})|Medium||||40.7%| +|0147|Insertion Sort List|[Go]({{< relref "/ChapterFour/0100~0199/0147.Insertion-Sort-List.md" >}})|Medium| O(n)| O(1)|❤️|51.1%| +|0148|Sort List|[Go]({{< relref "/ChapterFour/0100~0199/0148.Sort-List.md" >}})|Medium| O(n log n)| O(n)|❤️|55.1%| +|0160|Intersection of Two Linked Lists|[Go]({{< relref "/ChapterFour/0100~0199/0160.Intersection-of-Two-Linked-Lists.md" >}})|Easy| O(n)| O(1)|❤️|54.4%| +|0203|Remove Linked List Elements|[Go]({{< relref "/ChapterFour/0200~0299/0203.Remove-Linked-List-Elements.md" >}})|Easy| O(n)| O(1)||46.0%| +|0206|Reverse Linked List|[Go]({{< relref "/ChapterFour/0200~0299/0206.Reverse-Linked-List.md" >}})|Easy| O(n)| O(1)||73.6%| +|0234|Palindrome Linked List|[Go]({{< relref "/ChapterFour/0200~0299/0234.Palindrome-Linked-List.md" >}})|Easy| O(n)| O(1)||50.2%| +|0237|Delete Node in a Linked List|[Go]({{< relref "/ChapterFour/0200~0299/0237.Delete-Node-in-a-Linked-List.md" >}})|Medium| O(n)| O(1)||76.0%| +|0328|Odd Even Linked List|[Go]({{< relref "/ChapterFour/0300~0399/0328.Odd-Even-Linked-List.md" >}})|Medium| O(n)| O(1)||61.3%| +|0382|Linked List Random Node|[Go]({{< relref "/ChapterFour/0300~0399/0382.Linked-List-Random-Node.md" >}})|Medium||||62.8%| +|0445|Add Two Numbers II|[Go]({{< relref "/ChapterFour/0400~0499/0445.Add-Two-Numbers-II.md" >}})|Medium| O(n)| O(n)||59.6%| +|0460|LFU Cache|[Go]({{< relref "/ChapterFour/0400~0499/0460.LFU-Cache.md" >}})|Hard||||43.0%| +|0622|Design Circular Queue|[Go]({{< relref "/ChapterFour/0600~0699/0622.Design-Circular-Queue.md" >}})|Medium||||51.5%| +|0705|Design HashSet|[Go]({{< relref "/ChapterFour/0700~0799/0705.Design-HashSet.md" >}})|Easy||||65.6%| +|0706|Design HashMap|[Go]({{< relref "/ChapterFour/0700~0799/0706.Design-HashMap.md" >}})|Easy||||64.7%| +|0707|Design Linked List|[Go]({{< relref "/ChapterFour/0700~0799/0707.Design-Linked-List.md" >}})|Medium| O(n)| O(1)||27.7%| +|0725|Split Linked List in Parts|[Go]({{< relref "/ChapterFour/0700~0799/0725.Split-Linked-List-in-Parts.md" >}})|Medium| O(n)| O(1)||57.2%| +|0817|Linked List Components|[Go]({{< relref "/ChapterFour/0800~0899/0817.Linked-List-Components.md" >}})|Medium| O(n)| O(1)||57.7%| +|0876|Middle of the Linked List|[Go]({{< relref "/ChapterFour/0800~0899/0876.Middle-of-the-Linked-List.md" >}})|Easy| O(n)| O(1)|❤️|75.7%| +|1019|Next Greater Node In Linked List|[Go]({{< relref "/ChapterFour/1000~1099/1019.Next-Greater-Node-In-Linked-List.md" >}})|Medium| O(n)| O(1)||59.9%| +|1171|Remove Zero Sum Consecutive Nodes from Linked List|[Go]({{< relref "/ChapterFour/1100~1199/1171.Remove-Zero-Sum-Consecutive-Nodes-from-Linked-List.md" >}})|Medium||||43.2%| +|1290|Convert Binary Number in a Linked List to Integer|[Go]({{< relref "/ChapterFour/1200~1299/1290.Convert-Binary-Number-in-a-Linked-List-to-Integer.md" >}})|Easy||||82.1%| +|1669|Merge In Between Linked Lists|[Go]({{< relref "/ChapterFour/1600~1699/1669.Merge-In-Between-Linked-Lists.md" >}})|Medium||||73.7%| +|1670|Design Front Middle Back Queue|[Go]({{< relref "/ChapterFour/1600~1699/1670.Design-Front-Middle-Back-Queue.md" >}})|Medium||||57.2%| +|1721|Swapping Nodes in a Linked List|[Go]({{< relref "/ChapterFour/1700~1799/1721.Swapping-Nodes-in-a-Linked-List.md" >}})|Medium||||67.1%| +|2181|Merge Nodes in Between Zeros|[Go]({{< relref "/ChapterFour/2100~2199/2181.Merge-Nodes-in-Between-Zeros.md" >}})|Medium||||86.3%| |------------|-------------------------------------------------------|-------| ----------------| ---------------|-------------|-------------|-------------| diff --git a/website/content/ChapterTwo/Math.md b/website/content/ChapterTwo/Math.md index 201ef98b3..20e6ba342 100644 --- a/website/content/ChapterTwo/Math.md +++ b/website/content/ChapterTwo/Math.md @@ -9,142 +9,147 @@ weight: 12 | No. | Title | Solution | Difficulty | TimeComplexity | SpaceComplexity |Favorite| Acceptance | |:--------:|:------- | :--------: | :----------: | :----: | :-----: | :-----: |:-----: | -|0002|Add Two Numbers|[Go]({{< relref "/ChapterFour/0001~0099/0002.Add-Two-Numbers.md" >}})|Medium| O(n)| O(1)||38.6%| -|0007|Reverse Integer|[Go]({{< relref "/ChapterFour/0001~0099/0007.Reverse-Integer.md" >}})|Medium||||26.7%| -|0009|Palindrome Number|[Go]({{< relref "/ChapterFour/0001~0099/0009.Palindrome-Number.md" >}})|Easy||||52.4%| -|0012|Integer to Roman|[Go]({{< relref "/ChapterFour/0001~0099/0012.Integer-to-Roman.md" >}})|Medium||||59.4%| -|0013|Roman to Integer|[Go]({{< relref "/ChapterFour/0001~0099/0013.Roman-to-Integer.md" >}})|Easy||||57.9%| -|0029|Divide Two Integers|[Go]({{< relref "/ChapterFour/0001~0099/0029.Divide-Two-Integers.md" >}})|Medium||||17.0%| -|0043|Multiply Strings|[Go]({{< relref "/ChapterFour/0001~0099/0043.Multiply-Strings.md" >}})|Medium||||37.7%| -|0048|Rotate Image|[Go]({{< relref "/ChapterFour/0001~0099/0048.Rotate-Image.md" >}})|Medium||||66.6%| -|0050|Pow(x, n)|[Go]({{< relref "/ChapterFour/0001~0099/0050.Powx-n.md" >}})|Medium| O(log n)| O(1)||32.4%| -|0060|Permutation Sequence|[Go]({{< relref "/ChapterFour/0001~0099/0060.Permutation-Sequence.md" >}})|Hard| O(n log n)| O(1)||42.1%| -|0062|Unique Paths|[Go]({{< relref "/ChapterFour/0001~0099/0062.Unique-Paths.md" >}})|Medium||||60.0%| -|0066|Plus One|[Go]({{< relref "/ChapterFour/0001~0099/0066.Plus-One.md" >}})|Easy||||42.8%| -|0067|Add Binary|[Go]({{< relref "/ChapterFour/0001~0099/0067.Add-Binary.md" >}})|Easy||||50.5%| -|0069|Sqrt(x)|[Go]({{< relref "/ChapterFour/0001~0099/0069.Sqrtx.md" >}})|Easy| O(log n)| O(1)||36.5%| -|0070|Climbing Stairs|[Go]({{< relref "/ChapterFour/0001~0099/0070.Climbing-Stairs.md" >}})|Easy||||51.0%| -|0089|Gray Code|[Go]({{< relref "/ChapterFour/0001~0099/0089.Gray-Code.md" >}})|Medium||||55.3%| -|0096|Unique Binary Search Trees|[Go]({{< relref "/ChapterFour/0001~0099/0096.Unique-Binary-Search-Trees.md" >}})|Medium||||58.3%| -|0150|Evaluate Reverse Polish Notation|[Go]({{< relref "/ChapterFour/0100~0199/0150.Evaluate-Reverse-Polish-Notation.md" >}})|Medium||||42.6%| -|0168|Excel Sheet Column Title|[Go]({{< relref "/ChapterFour/0100~0199/0168.Excel-Sheet-Column-Title.md" >}})|Easy||||33.9%| -|0171|Excel Sheet Column Number|[Go]({{< relref "/ChapterFour/0100~0199/0171.Excel-Sheet-Column-Number.md" >}})|Easy||||60.6%| -|0172|Factorial Trailing Zeroes|[Go]({{< relref "/ChapterFour/0100~0199/0172.Factorial-Trailing-Zeroes.md" >}})|Medium||||40.8%| -|0189|Rotate Array|[Go]({{< relref "/ChapterFour/0100~0199/0189.Rotate-Array.md" >}})|Medium||||38.6%| -|0202|Happy Number|[Go]({{< relref "/ChapterFour/0200~0299/0202.Happy-Number.md" >}})|Easy| O(log n)| O(1)||53.2%| -|0204|Count Primes|[Go]({{< relref "/ChapterFour/0200~0299/0204.Count-Primes.md" >}})|Medium||||33.0%| -|0223|Rectangle Area|[Go]({{< relref "/ChapterFour/0200~0299/0223.Rectangle-Area.md" >}})|Medium||||40.1%| -|0224|Basic Calculator|[Go]({{< relref "/ChapterFour/0200~0299/0224.Basic-Calculator.md" >}})|Hard| O(n)| O(n)||40.5%| -|0227|Basic Calculator II|[Go]({{< relref "/ChapterFour/0200~0299/0227.Basic-Calculator-II.md" >}})|Medium||||41.6%| -|0231|Power of Two|[Go]({{< relref "/ChapterFour/0200~0299/0231.Power-of-Two.md" >}})|Easy| O(1)| O(1)||45.0%| -|0258|Add Digits|[Go]({{< relref "/ChapterFour/0200~0299/0258.Add-Digits.md" >}})|Easy||||62.5%| -|0263|Ugly Number|[Go]({{< relref "/ChapterFour/0200~0299/0263.Ugly-Number.md" >}})|Easy| O(log n)| O(1)||41.8%| -|0264|Ugly Number II|[Go]({{< relref "/ChapterFour/0200~0299/0264.Ugly-Number-II.md" >}})|Medium||||45.3%| -|0268|Missing Number|[Go]({{< relref "/ChapterFour/0200~0299/0268.Missing-Number.md" >}})|Easy||||59.4%| -|0279|Perfect Squares|[Go]({{< relref "/ChapterFour/0200~0299/0279.Perfect-Squares.md" >}})|Medium||||51.9%| -|0319|Bulb Switcher|[Go]({{< relref "/ChapterFour/0300~0399/0319.Bulb-Switcher.md" >}})|Medium||||47.3%| -|0326|Power of Three|[Go]({{< relref "/ChapterFour/0300~0399/0326.Power-of-Three.md" >}})|Easy| O(1)| O(1)||43.5%| -|0342|Power of Four|[Go]({{< relref "/ChapterFour/0300~0399/0342.Power-of-Four.md" >}})|Easy||||44.0%| -|0343|Integer Break|[Go]({{< relref "/ChapterFour/0300~0399/0343.Integer-Break.md" >}})|Medium| O(n^2)| O(n)||54.1%| -|0357|Count Numbers with Unique Digits|[Go]({{< relref "/ChapterFour/0300~0399/0357.Count-Numbers-with-Unique-Digits.md" >}})|Medium| O(1)| O(1)||50.6%| -|0367|Valid Perfect Square|[Go]({{< relref "/ChapterFour/0300~0399/0367.Valid-Perfect-Square.md" >}})|Easy||||43.0%| -|0368|Largest Divisible Subset|[Go]({{< relref "/ChapterFour/0300~0399/0368.Largest-Divisible-Subset.md" >}})|Medium||||40.6%| -|0371|Sum of Two Integers|[Go]({{< relref "/ChapterFour/0300~0399/0371.Sum-of-Two-Integers.md" >}})|Medium||||50.6%| -|0372|Super Pow|[Go]({{< relref "/ChapterFour/0300~0399/0372.Super-Pow.md" >}})|Medium||||37.6%| -|0382|Linked List Random Node|[Go]({{< relref "/ChapterFour/0300~0399/0382.Linked-List-Random-Node.md" >}})|Medium||||59.0%| -|0384|Shuffle an Array|[Go]({{< relref "/ChapterFour/0300~0399/0384.Shuffle-an-Array.md" >}})|Medium||||57.0%| -|0390|Elimination Game|[Go]({{< relref "/ChapterFour/0300~0399/0390.Elimination-Game.md" >}})|Medium||||46.4%| -|0400|Nth Digit|[Go]({{< relref "/ChapterFour/0400~0499/0400.Nth-Digit.md" >}})|Medium||||33.5%| -|0405|Convert a Number to Hexadecimal|[Go]({{< relref "/ChapterFour/0400~0499/0405.Convert-a-Number-to-Hexadecimal.md" >}})|Easy||||45.8%| -|0412|Fizz Buzz|[Go]({{< relref "/ChapterFour/0400~0499/0412.Fizz-Buzz.md" >}})|Easy||||66.7%| +|0002|Add Two Numbers|[Go]({{< relref "/ChapterFour/0001~0099/0002.Add-Two-Numbers.md" >}})|Medium| O(n)| O(1)||40.4%| +|0007|Reverse Integer|[Go]({{< relref "/ChapterFour/0001~0099/0007.Reverse-Integer.md" >}})|Medium||||27.5%| +|0009|Palindrome Number|[Go]({{< relref "/ChapterFour/0001~0099/0009.Palindrome-Number.md" >}})|Easy||||53.5%| +|0012|Integer to Roman|[Go]({{< relref "/ChapterFour/0001~0099/0012.Integer-to-Roman.md" >}})|Medium||||62.0%| +|0013|Roman to Integer|[Go]({{< relref "/ChapterFour/0001~0099/0013.Roman-to-Integer.md" >}})|Easy||||58.6%| +|0029|Divide Two Integers|[Go]({{< relref "/ChapterFour/0001~0099/0029.Divide-Two-Integers.md" >}})|Medium||||17.2%| +|0043|Multiply Strings|[Go]({{< relref "/ChapterFour/0001~0099/0043.Multiply-Strings.md" >}})|Medium||||39.2%| +|0048|Rotate Image|[Go]({{< relref "/ChapterFour/0001~0099/0048.Rotate-Image.md" >}})|Medium||||71.0%| +|0050|Pow(x, n)|[Go]({{< relref "/ChapterFour/0001~0099/0050.Powx-n.md" >}})|Medium| O(log n)| O(1)||33.0%| +|0060|Permutation Sequence|[Go]({{< relref "/ChapterFour/0001~0099/0060.Permutation-Sequence.md" >}})|Hard| O(n log n)| O(1)||44.4%| +|0062|Unique Paths|[Go]({{< relref "/ChapterFour/0001~0099/0062.Unique-Paths.md" >}})|Medium||||62.7%| +|0066|Plus One|[Go]({{< relref "/ChapterFour/0001~0099/0066.Plus-One.md" >}})|Easy||||43.7%| +|0067|Add Binary|[Go]({{< relref "/ChapterFour/0001~0099/0067.Add-Binary.md" >}})|Easy||||52.4%| +|0069|Sqrt(x)|[Go]({{< relref "/ChapterFour/0001~0099/0069.Sqrtx.md" >}})|Easy| O(log n)| O(1)||37.4%| +|0070|Climbing Stairs|[Go]({{< relref "/ChapterFour/0001~0099/0070.Climbing-Stairs.md" >}})|Easy||||52.2%| +|0089|Gray Code|[Go]({{< relref "/ChapterFour/0001~0099/0089.Gray-Code.md" >}})|Medium||||57.2%| +|0096|Unique Binary Search Trees|[Go]({{< relref "/ChapterFour/0001~0099/0096.Unique-Binary-Search-Trees.md" >}})|Medium||||59.7%| +|0150|Evaluate Reverse Polish Notation|[Go]({{< relref "/ChapterFour/0100~0199/0150.Evaluate-Reverse-Polish-Notation.md" >}})|Medium||||45.8%| +|0168|Excel Sheet Column Title|[Go]({{< relref "/ChapterFour/0100~0199/0168.Excel-Sheet-Column-Title.md" >}})|Easy||||35.5%| +|0171|Excel Sheet Column Number|[Go]({{< relref "/ChapterFour/0100~0199/0171.Excel-Sheet-Column-Number.md" >}})|Easy||||62.1%| +|0172|Factorial Trailing Zeroes|[Go]({{< relref "/ChapterFour/0100~0199/0172.Factorial-Trailing-Zeroes.md" >}})|Medium||||42.2%| +|0189|Rotate Array|[Go]({{< relref "/ChapterFour/0100~0199/0189.Rotate-Array.md" >}})|Medium||||39.4%| +|0202|Happy Number|[Go]({{< relref "/ChapterFour/0200~0299/0202.Happy-Number.md" >}})|Easy| O(log n)| O(1)||54.8%| +|0204|Count Primes|[Go]({{< relref "/ChapterFour/0200~0299/0204.Count-Primes.md" >}})|Medium||||33.1%| +|0223|Rectangle Area|[Go]({{< relref "/ChapterFour/0200~0299/0223.Rectangle-Area.md" >}})|Medium||||45.1%| +|0224|Basic Calculator|[Go]({{< relref "/ChapterFour/0200~0299/0224.Basic-Calculator.md" >}})|Hard| O(n)| O(n)||42.4%| +|0227|Basic Calculator II|[Go]({{< relref "/ChapterFour/0200~0299/0227.Basic-Calculator-II.md" >}})|Medium||||42.4%| +|0231|Power of Two|[Go]({{< relref "/ChapterFour/0200~0299/0231.Power-of-Two.md" >}})|Easy| O(1)| O(1)||46.0%| +|0258|Add Digits|[Go]({{< relref "/ChapterFour/0200~0299/0258.Add-Digits.md" >}})|Easy||||64.0%| +|0263|Ugly Number|[Go]({{< relref "/ChapterFour/0200~0299/0263.Ugly-Number.md" >}})|Easy| O(log n)| O(1)||42.3%| +|0264|Ugly Number II|[Go]({{< relref "/ChapterFour/0200~0299/0264.Ugly-Number-II.md" >}})|Medium||||46.2%| +|0268|Missing Number|[Go]({{< relref "/ChapterFour/0200~0299/0268.Missing-Number.md" >}})|Easy||||62.6%| +|0279|Perfect Squares|[Go]({{< relref "/ChapterFour/0200~0299/0279.Perfect-Squares.md" >}})|Medium||||52.7%| +|0319|Bulb Switcher|[Go]({{< relref "/ChapterFour/0300~0399/0319.Bulb-Switcher.md" >}})|Medium||||48.3%| +|0326|Power of Three|[Go]({{< relref "/ChapterFour/0300~0399/0326.Power-of-Three.md" >}})|Easy| O(1)| O(1)||45.5%| +|0342|Power of Four|[Go]({{< relref "/ChapterFour/0300~0399/0342.Power-of-Four.md" >}})|Easy||||46.2%| +|0343|Integer Break|[Go]({{< relref "/ChapterFour/0300~0399/0343.Integer-Break.md" >}})|Medium| O(n^2)| O(n)||56.1%| +|0357|Count Numbers with Unique Digits|[Go]({{< relref "/ChapterFour/0300~0399/0357.Count-Numbers-with-Unique-Digits.md" >}})|Medium| O(1)| O(1)||51.9%| +|0367|Valid Perfect Square|[Go]({{< relref "/ChapterFour/0300~0399/0367.Valid-Perfect-Square.md" >}})|Easy||||43.3%| +|0368|Largest Divisible Subset|[Go]({{< relref "/ChapterFour/0300~0399/0368.Largest-Divisible-Subset.md" >}})|Medium||||41.6%| +|0371|Sum of Two Integers|[Go]({{< relref "/ChapterFour/0300~0399/0371.Sum-of-Two-Integers.md" >}})|Medium||||50.7%| +|0372|Super Pow|[Go]({{< relref "/ChapterFour/0300~0399/0372.Super-Pow.md" >}})|Medium||||36.3%| +|0382|Linked List Random Node|[Go]({{< relref "/ChapterFour/0300~0399/0382.Linked-List-Random-Node.md" >}})|Medium||||62.8%| +|0384|Shuffle an Array|[Go]({{< relref "/ChapterFour/0300~0399/0384.Shuffle-an-Array.md" >}})|Medium||||57.8%| +|0390|Elimination Game|[Go]({{< relref "/ChapterFour/0300~0399/0390.Elimination-Game.md" >}})|Medium||||46.1%| +|0396|Rotate Function|[Go]({{< relref "/ChapterFour/0300~0399/0396.Rotate-Function.md" >}})|Medium||||41.1%| +|0400|Nth Digit|[Go]({{< relref "/ChapterFour/0400~0499/0400.Nth-Digit.md" >}})|Medium||||34.1%| +|0405|Convert a Number to Hexadecimal|[Go]({{< relref "/ChapterFour/0400~0499/0405.Convert-a-Number-to-Hexadecimal.md" >}})|Easy||||46.8%| +|0412|Fizz Buzz|[Go]({{< relref "/ChapterFour/0400~0499/0412.Fizz-Buzz.md" >}})|Easy||||70.0%| |0423|Reconstruct Original Digits from English|[Go]({{< relref "/ChapterFour/0400~0499/0423.Reconstruct-Original-Digits-from-English.md" >}})|Medium||||51.2%| -|0441|Arranging Coins|[Go]({{< relref "/ChapterFour/0400~0499/0441.Arranging-Coins.md" >}})|Easy||||45.4%| -|0445|Add Two Numbers II|[Go]({{< relref "/ChapterFour/0400~0499/0445.Add-Two-Numbers-II.md" >}})|Medium||||58.6%| -|0447|Number of Boomerangs|[Go]({{< relref "/ChapterFour/0400~0499/0447.Number-of-Boomerangs.md" >}})|Medium||||54.2%| -|0453|Minimum Moves to Equal Array Elements|[Go]({{< relref "/ChapterFour/0400~0499/0453.Minimum-Moves-to-Equal-Array-Elements.md" >}})|Medium||||54.1%| -|0458|Poor Pigs|[Go]({{< relref "/ChapterFour/0400~0499/0458.Poor-Pigs.md" >}})|Hard||||55.6%| -|0462|Minimum Moves to Equal Array Elements II|[Go]({{< relref "/ChapterFour/0400~0499/0462.Minimum-Moves-to-Equal-Array-Elements-II.md" >}})|Medium||||57.0%| -|0470|Implement Rand10() Using Rand7()|[Go]({{< relref "/ChapterFour/0400~0499/0470.Implement-Rand10-Using-Rand7.md" >}})|Medium||||46.7%| -|0477|Total Hamming Distance|[Go]({{< relref "/ChapterFour/0400~0499/0477.Total-Hamming-Distance.md" >}})|Medium||||52.0%| -|0478|Generate Random Point in a Circle|[Go]({{< relref "/ChapterFour/0400~0499/0478.Generate-Random-Point-in-a-Circle.md" >}})|Medium||||39.3%| -|0483|Smallest Good Base|[Go]({{< relref "/ChapterFour/0400~0499/0483.Smallest-Good-Base.md" >}})|Hard||||37.8%| -|0492|Construct the Rectangle|[Go]({{< relref "/ChapterFour/0400~0499/0492.Construct-the-Rectangle.md" >}})|Easy||||52.7%| -|0497|Random Point in Non-overlapping Rectangles|[Go]({{< relref "/ChapterFour/0400~0499/0497.Random-Point-in-Non-overlapping-Rectangles.md" >}})|Medium||||39.1%| -|0507|Perfect Number|[Go]({{< relref "/ChapterFour/0500~0599/0507.Perfect-Number.md" >}})|Easy||||37.6%| -|0509|Fibonacci Number|[Go]({{< relref "/ChapterFour/0500~0599/0509.Fibonacci-Number.md" >}})|Easy||||68.2%| -|0519|Random Flip Matrix|[Go]({{< relref "/ChapterFour/0500~0599/0519.Random-Flip-Matrix.md" >}})|Medium||||39.2%| -|0523|Continuous Subarray Sum|[Go]({{< relref "/ChapterFour/0500~0599/0523.Continuous-Subarray-Sum.md" >}})|Medium||||27.3%| +|0441|Arranging Coins|[Go]({{< relref "/ChapterFour/0400~0499/0441.Arranging-Coins.md" >}})|Easy||||46.2%| +|0445|Add Two Numbers II|[Go]({{< relref "/ChapterFour/0400~0499/0445.Add-Two-Numbers-II.md" >}})|Medium||||59.6%| +|0447|Number of Boomerangs|[Go]({{< relref "/ChapterFour/0400~0499/0447.Number-of-Boomerangs.md" >}})|Medium||||54.9%| +|0453|Minimum Moves to Equal Array Elements|[Go]({{< relref "/ChapterFour/0400~0499/0453.Minimum-Moves-to-Equal-Array-Elements.md" >}})|Medium||||56.0%| +|0458|Poor Pigs|[Go]({{< relref "/ChapterFour/0400~0499/0458.Poor-Pigs.md" >}})|Hard||||62.8%| +|0462|Minimum Moves to Equal Array Elements II|[Go]({{< relref "/ChapterFour/0400~0499/0462.Minimum-Moves-to-Equal-Array-Elements-II.md" >}})|Medium||||60.0%| +|0470|Implement Rand10() Using Rand7()|[Go]({{< relref "/ChapterFour/0400~0499/0470.Implement-Rand10-Using-Rand7.md" >}})|Medium||||46.4%| +|0477|Total Hamming Distance|[Go]({{< relref "/ChapterFour/0400~0499/0477.Total-Hamming-Distance.md" >}})|Medium||||52.2%| +|0478|Generate Random Point in a Circle|[Go]({{< relref "/ChapterFour/0400~0499/0478.Generate-Random-Point-in-a-Circle.md" >}})|Medium||||39.6%| +|0483|Smallest Good Base|[Go]({{< relref "/ChapterFour/0400~0499/0483.Smallest-Good-Base.md" >}})|Hard||||38.8%| +|0492|Construct the Rectangle|[Go]({{< relref "/ChapterFour/0400~0499/0492.Construct-the-Rectangle.md" >}})|Easy||||54.8%| +|0497|Random Point in Non-overlapping Rectangles|[Go]({{< relref "/ChapterFour/0400~0499/0497.Random-Point-in-Non-overlapping-Rectangles.md" >}})|Medium||||39.4%| +|0504|Base 7|[Go]({{< relref "/ChapterFour/0500~0599/0504.Base-7.md" >}})|Easy||||48.5%| +|0507|Perfect Number|[Go]({{< relref "/ChapterFour/0500~0599/0507.Perfect-Number.md" >}})|Easy||||37.7%| +|0509|Fibonacci Number|[Go]({{< relref "/ChapterFour/0500~0599/0509.Fibonacci-Number.md" >}})|Easy||||69.8%| +|0519|Random Flip Matrix|[Go]({{< relref "/ChapterFour/0500~0599/0519.Random-Flip-Matrix.md" >}})|Medium||||40.0%| +|0523|Continuous Subarray Sum|[Go]({{< relref "/ChapterFour/0500~0599/0523.Continuous-Subarray-Sum.md" >}})|Medium||||28.5%| |0528|Random Pick with Weight|[Go]({{< relref "/ChapterFour/0500~0599/0528.Random-Pick-with-Weight.md" >}})|Medium||||46.1%| -|0537|Complex Number Multiplication|[Go]({{< relref "/ChapterFour/0500~0599/0537.Complex-Number-Multiplication.md" >}})|Medium||||71.1%| -|0598|Range Addition II|[Go]({{< relref "/ChapterFour/0500~0599/0598.Range-Addition-II.md" >}})|Easy||||54.7%| -|0628|Maximum Product of Three Numbers|[Go]({{< relref "/ChapterFour/0600~0699/0628.Maximum-Product-of-Three-Numbers.md" >}})|Easy| O(n)| O(1)||46.7%| -|0633|Sum of Square Numbers|[Go]({{< relref "/ChapterFour/0600~0699/0633.Sum-of-Square-Numbers.md" >}})|Medium||||34.7%| -|0667|Beautiful Arrangement II|[Go]({{< relref "/ChapterFour/0600~0699/0667.Beautiful-Arrangement-II.md" >}})|Medium||||59.4%| -|0710|Random Pick with Blacklist|[Go]({{< relref "/ChapterFour/0700~0799/0710.Random-Pick-with-Blacklist.md" >}})|Hard||||33.2%| -|0762|Prime Number of Set Bits in Binary Representation|[Go]({{< relref "/ChapterFour/0700~0799/0762.Prime-Number-of-Set-Bits-in-Binary-Representation.md" >}})|Easy||||66.8%| -|0775|Global and Local Inversions|[Go]({{< relref "/ChapterFour/0700~0799/0775.Global-and-Local-Inversions.md" >}})|Medium||||45.1%| -|0781|Rabbits in Forest|[Go]({{< relref "/ChapterFour/0700~0799/0781.Rabbits-in-Forest.md" >}})|Medium||||55.7%| -|0793|Preimage Size of Factorial Zeroes Function|[Go]({{< relref "/ChapterFour/0700~0799/0793.Preimage-Size-of-Factorial-Zeroes-Function.md" >}})|Hard||||41.8%| -|0810|Chalkboard XOR Game|[Go]({{< relref "/ChapterFour/0800~0899/0810.Chalkboard-XOR-Game.md" >}})|Hard||||53.4%| -|0812|Largest Triangle Area|[Go]({{< relref "/ChapterFour/0800~0899/0812.Largest-Triangle-Area.md" >}})|Easy||||59.6%| -|0836|Rectangle Overlap|[Go]({{< relref "/ChapterFour/0800~0899/0836.Rectangle-Overlap.md" >}})|Easy||||43.2%| -|0869|Reordered Power of 2|[Go]({{< relref "/ChapterFour/0800~0899/0869.Reordered-Power-of-2.md" >}})|Medium||||61.3%| -|0877|Stone Game|[Go]({{< relref "/ChapterFour/0800~0899/0877.Stone-Game.md" >}})|Medium||||69.2%| -|0878|Nth Magical Number|[Go]({{< relref "/ChapterFour/0800~0899/0878.Nth-Magical-Number.md" >}})|Hard||||35.8%| -|0887|Super Egg Drop|[Go]({{< relref "/ChapterFour/0800~0899/0887.Super-Egg-Drop.md" >}})|Hard||||27.2%| -|0891|Sum of Subsequence Widths|[Go]({{< relref "/ChapterFour/0800~0899/0891.Sum-of-Subsequence-Widths.md" >}})|Hard| O(n log n)| O(1)||35.6%| -|0892|Surface Area of 3D Shapes|[Go]({{< relref "/ChapterFour/0800~0899/0892.Surface-Area-of-3D-Shapes.md" >}})|Easy||||61.9%| -|0910|Smallest Range II|[Go]({{< relref "/ChapterFour/0900~0999/0910.Smallest-Range-II.md" >}})|Medium||||32.8%| -|0914|X of a Kind in a Deck of Cards|[Go]({{< relref "/ChapterFour/0900~0999/0914.X-of-a-Kind-in-a-Deck-of-Cards.md" >}})|Easy||||32.9%| -|0920|Number of Music Playlists|[Go]({{< relref "/ChapterFour/0900~0999/0920.Number-of-Music-Playlists.md" >}})|Hard||||49.9%| -|0927|Three Equal Parts|[Go]({{< relref "/ChapterFour/0900~0999/0927.Three-Equal-Parts.md" >}})|Hard||||39.4%| -|0942|DI String Match|[Go]({{< relref "/ChapterFour/0900~0999/0942.DI-String-Match.md" >}})|Easy| O(n)| O(1)||75.9%| -|0952|Largest Component Size by Common Factor|[Go]({{< relref "/ChapterFour/0900~0999/0952.Largest-Component-Size-by-Common-Factor.md" >}})|Hard||||40.2%| +|0537|Complex Number Multiplication|[Go]({{< relref "/ChapterFour/0500~0599/0537.Complex-Number-Multiplication.md" >}})|Medium||||71.4%| +|0598|Range Addition II|[Go]({{< relref "/ChapterFour/0500~0599/0598.Range-Addition-II.md" >}})|Easy||||55.3%| +|0628|Maximum Product of Three Numbers|[Go]({{< relref "/ChapterFour/0600~0699/0628.Maximum-Product-of-Three-Numbers.md" >}})|Easy| O(n)| O(1)||45.9%| +|0633|Sum of Square Numbers|[Go]({{< relref "/ChapterFour/0600~0699/0633.Sum-of-Square-Numbers.md" >}})|Medium||||34.4%| +|0667|Beautiful Arrangement II|[Go]({{< relref "/ChapterFour/0600~0699/0667.Beautiful-Arrangement-II.md" >}})|Medium||||59.8%| +|0668|Kth Smallest Number in Multiplication Table|[Go]({{< relref "/ChapterFour/0600~0699/0668.Kth-Smallest-Number-in-Multiplication-Table.md" >}})|Hard||||51.4%| +|0710|Random Pick with Blacklist|[Go]({{< relref "/ChapterFour/0700~0799/0710.Random-Pick-with-Blacklist.md" >}})|Hard||||33.5%| +|0728|Self Dividing Numbers|[Go]({{< relref "/ChapterFour/0700~0799/0728.Self-Dividing-Numbers.md" >}})|Easy||||77.9%| +|0762|Prime Number of Set Bits in Binary Representation|[Go]({{< relref "/ChapterFour/0700~0799/0762.Prime-Number-of-Set-Bits-in-Binary-Representation.md" >}})|Easy||||68.0%| +|0775|Global and Local Inversions|[Go]({{< relref "/ChapterFour/0700~0799/0775.Global-and-Local-Inversions.md" >}})|Medium||||43.3%| +|0781|Rabbits in Forest|[Go]({{< relref "/ChapterFour/0700~0799/0781.Rabbits-in-Forest.md" >}})|Medium||||54.7%| +|0793|Preimage Size of Factorial Zeroes Function|[Go]({{< relref "/ChapterFour/0700~0799/0793.Preimage-Size-of-Factorial-Zeroes-Function.md" >}})|Hard||||43.2%| +|0810|Chalkboard XOR Game|[Go]({{< relref "/ChapterFour/0800~0899/0810.Chalkboard-XOR-Game.md" >}})|Hard||||55.8%| +|0812|Largest Triangle Area|[Go]({{< relref "/ChapterFour/0800~0899/0812.Largest-Triangle-Area.md" >}})|Easy||||59.9%| +|0836|Rectangle Overlap|[Go]({{< relref "/ChapterFour/0800~0899/0836.Rectangle-Overlap.md" >}})|Easy||||43.9%| +|0869|Reordered Power of 2|[Go]({{< relref "/ChapterFour/0800~0899/0869.Reordered-Power-of-2.md" >}})|Medium||||63.5%| +|0877|Stone Game|[Go]({{< relref "/ChapterFour/0800~0899/0877.Stone-Game.md" >}})|Medium||||69.7%| +|0878|Nth Magical Number|[Go]({{< relref "/ChapterFour/0800~0899/0878.Nth-Magical-Number.md" >}})|Hard||||35.4%| +|0887|Super Egg Drop|[Go]({{< relref "/ChapterFour/0800~0899/0887.Super-Egg-Drop.md" >}})|Hard||||27.1%| +|0891|Sum of Subsequence Widths|[Go]({{< relref "/ChapterFour/0800~0899/0891.Sum-of-Subsequence-Widths.md" >}})|Hard| O(n log n)| O(1)||36.7%| +|0892|Surface Area of 3D Shapes|[Go]({{< relref "/ChapterFour/0800~0899/0892.Surface-Area-of-3D-Shapes.md" >}})|Easy||||64.0%| +|0910|Smallest Range II|[Go]({{< relref "/ChapterFour/0900~0999/0910.Smallest-Range-II.md" >}})|Medium||||35.2%| +|0914|X of a Kind in a Deck of Cards|[Go]({{< relref "/ChapterFour/0900~0999/0914.X-of-a-Kind-in-a-Deck-of-Cards.md" >}})|Easy||||31.2%| +|0920|Number of Music Playlists|[Go]({{< relref "/ChapterFour/0900~0999/0920.Number-of-Music-Playlists.md" >}})|Hard||||50.7%| +|0927|Three Equal Parts|[Go]({{< relref "/ChapterFour/0900~0999/0927.Three-Equal-Parts.md" >}})|Hard||||39.6%| +|0952|Largest Component Size by Common Factor|[Go]({{< relref "/ChapterFour/0900~0999/0952.Largest-Component-Size-by-Common-Factor.md" >}})|Hard||||40.0%| |0970|Powerful Integers|[Go]({{< relref "/ChapterFour/0900~0999/0970.Powerful-Integers.md" >}})|Medium||||43.6%| -|0973|K Closest Points to Origin|[Go]({{< relref "/ChapterFour/0900~0999/0973.K-Closest-Points-to-Origin.md" >}})|Medium||||66.0%| -|0976|Largest Perimeter Triangle|[Go]({{< relref "/ChapterFour/0900~0999/0976.Largest-Perimeter-Triangle.md" >}})|Easy| O(n log n)| O(log n) ||55.5%| -|0989|Add to Array-Form of Integer|[Go]({{< relref "/ChapterFour/0900~0999/0989.Add-to-Array-Form-of-Integer.md" >}})|Easy||||45.5%| -|0991|Broken Calculator|[Go]({{< relref "/ChapterFour/0900~0999/0991.Broken-Calculator.md" >}})|Medium||||54.2%| -|0996|Number of Squareful Arrays|[Go]({{< relref "/ChapterFour/0900~0999/0996.Number-of-Squareful-Arrays.md" >}})|Hard| O(n log n)| O(n) ||49.1%| -|1006|Clumsy Factorial|[Go]({{< relref "/ChapterFour/1000~1099/1006.Clumsy-Factorial.md" >}})|Medium||||54.7%| -|1017|Convert to Base -2|[Go]({{< relref "/ChapterFour/1000~1099/1017.Convert-to-Base-2.md" >}})|Medium||||60.3%| -|1025|Divisor Game|[Go]({{< relref "/ChapterFour/1000~1099/1025.Divisor-Game.md" >}})|Easy| O(1)| O(1)||66.6%| -|1030|Matrix Cells in Distance Order|[Go]({{< relref "/ChapterFour/1000~1099/1030.Matrix-Cells-in-Distance-Order.md" >}})|Easy||||69.1%| -|1037|Valid Boomerang|[Go]({{< relref "/ChapterFour/1000~1099/1037.Valid-Boomerang.md" >}})|Easy||||37.5%| -|1040|Moving Stones Until Consecutive II|[Go]({{< relref "/ChapterFour/1000~1099/1040.Moving-Stones-Until-Consecutive-II.md" >}})|Medium||||55.6%| -|1073|Adding Two Negabinary Numbers|[Go]({{< relref "/ChapterFour/1000~1099/1073.Adding-Two-Negabinary-Numbers.md" >}})|Medium||||35.9%| -|1093|Statistics from a Large Sample|[Go]({{< relref "/ChapterFour/1000~1099/1093.Statistics-from-a-Large-Sample.md" >}})|Medium||||45.8%| -|1104|Path In Zigzag Labelled Binary Tree|[Go]({{< relref "/ChapterFour/1100~1199/1104.Path-In-Zigzag-Labelled-Binary-Tree.md" >}})|Medium||||74.6%| -|1137|N-th Tribonacci Number|[Go]({{< relref "/ChapterFour/1100~1199/1137.N-th-Tribonacci-Number.md" >}})|Easy||||62.9%| -|1154|Day of the Year|[Go]({{< relref "/ChapterFour/1100~1199/1154.Day-of-the-Year.md" >}})|Easy||||50.9%| -|1175|Prime Arrangements|[Go]({{< relref "/ChapterFour/1100~1199/1175.Prime-Arrangements.md" >}})|Easy||||52.9%| -|1185|Day of the Week|[Go]({{< relref "/ChapterFour/1100~1199/1185.Day-of-the-Week.md" >}})|Easy||||58.4%| -|1201|Ugly Number III|[Go]({{< relref "/ChapterFour/1200~1299/1201.Ugly-Number-III.md" >}})|Medium||||28.1%| -|1217|Minimum Cost to Move Chips to The Same Position|[Go]({{< relref "/ChapterFour/1200~1299/1217.Minimum-Cost-to-Move-Chips-to-The-Same-Position.md" >}})|Easy||||72.7%| -|1232|Check If It Is a Straight Line|[Go]({{< relref "/ChapterFour/1200~1299/1232.Check-If-It-Is-a-Straight-Line.md" >}})|Easy||||41.9%| +|0973|K Closest Points to Origin|[Go]({{< relref "/ChapterFour/0900~0999/0973.K-Closest-Points-to-Origin.md" >}})|Medium||||65.7%| +|0976|Largest Perimeter Triangle|[Go]({{< relref "/ChapterFour/0900~0999/0976.Largest-Perimeter-Triangle.md" >}})|Easy| O(n log n)| O(log n) ||54.7%| +|0989|Add to Array-Form of Integer|[Go]({{< relref "/ChapterFour/0900~0999/0989.Add-to-Array-Form-of-Integer.md" >}})|Easy||||47.1%| +|0991|Broken Calculator|[Go]({{< relref "/ChapterFour/0900~0999/0991.Broken-Calculator.md" >}})|Medium||||54.1%| +|0996|Number of Squareful Arrays|[Go]({{< relref "/ChapterFour/0900~0999/0996.Number-of-Squareful-Arrays.md" >}})|Hard| O(n log n)| O(n) ||49.2%| +|1006|Clumsy Factorial|[Go]({{< relref "/ChapterFour/1000~1099/1006.Clumsy-Factorial.md" >}})|Medium||||55.5%| +|1017|Convert to Base -2|[Go]({{< relref "/ChapterFour/1000~1099/1017.Convert-to-Base-2.md" >}})|Medium||||60.9%| +|1025|Divisor Game|[Go]({{< relref "/ChapterFour/1000~1099/1025.Divisor-Game.md" >}})|Easy| O(1)| O(1)||67.6%| +|1030|Matrix Cells in Distance Order|[Go]({{< relref "/ChapterFour/1000~1099/1030.Matrix-Cells-in-Distance-Order.md" >}})|Easy||||69.7%| +|1037|Valid Boomerang|[Go]({{< relref "/ChapterFour/1000~1099/1037.Valid-Boomerang.md" >}})|Easy||||37.0%| +|1040|Moving Stones Until Consecutive II|[Go]({{< relref "/ChapterFour/1000~1099/1040.Moving-Stones-Until-Consecutive-II.md" >}})|Medium||||55.9%| +|1073|Adding Two Negabinary Numbers|[Go]({{< relref "/ChapterFour/1000~1099/1073.Adding-Two-Negabinary-Numbers.md" >}})|Medium||||36.5%| +|1093|Statistics from a Large Sample|[Go]({{< relref "/ChapterFour/1000~1099/1093.Statistics-from-a-Large-Sample.md" >}})|Medium||||43.5%| +|1104|Path In Zigzag Labelled Binary Tree|[Go]({{< relref "/ChapterFour/1100~1199/1104.Path-In-Zigzag-Labelled-Binary-Tree.md" >}})|Medium||||75.1%| +|1137|N-th Tribonacci Number|[Go]({{< relref "/ChapterFour/1100~1199/1137.N-th-Tribonacci-Number.md" >}})|Easy||||63.7%| +|1154|Day of the Year|[Go]({{< relref "/ChapterFour/1100~1199/1154.Day-of-the-Year.md" >}})|Easy||||49.6%| +|1175|Prime Arrangements|[Go]({{< relref "/ChapterFour/1100~1199/1175.Prime-Arrangements.md" >}})|Easy||||54.7%| +|1185|Day of the Week|[Go]({{< relref "/ChapterFour/1100~1199/1185.Day-of-the-Week.md" >}})|Easy||||57.4%| +|1201|Ugly Number III|[Go]({{< relref "/ChapterFour/1200~1299/1201.Ugly-Number-III.md" >}})|Medium||||28.9%| +|1217|Minimum Cost to Move Chips to The Same Position|[Go]({{< relref "/ChapterFour/1200~1299/1217.Minimum-Cost-to-Move-Chips-to-The-Same-Position.md" >}})|Easy||||71.9%| +|1232|Check If It Is a Straight Line|[Go]({{< relref "/ChapterFour/1200~1299/1232.Check-If-It-Is-a-Straight-Line.md" >}})|Easy||||40.3%| |1252|Cells with Odd Values in a Matrix|[Go]({{< relref "/ChapterFour/1200~1299/1252.Cells-with-Odd-Values-in-a-Matrix.md" >}})|Easy||||78.5%| |1266|Minimum Time Visiting All Points|[Go]({{< relref "/ChapterFour/1200~1299/1266.Minimum-Time-Visiting-All-Points.md" >}})|Easy||||79.1%| -|1281|Subtract the Product and Sum of Digits of an Integer|[Go]({{< relref "/ChapterFour/1200~1299/1281.Subtract-the-Product-and-Sum-of-Digits-of-an-Integer.md" >}})|Easy||||86.4%| -|1290|Convert Binary Number in a Linked List to Integer|[Go]({{< relref "/ChapterFour/1200~1299/1290.Convert-Binary-Number-in-a-Linked-List-to-Integer.md" >}})|Easy||||82.7%| -|1304|Find N Unique Integers Sum up to Zero|[Go]({{< relref "/ChapterFour/1300~1399/1304.Find-N-Unique-Integers-Sum-up-to-Zero.md" >}})|Easy||||77.0%| -|1317|Convert Integer to the Sum of Two No-Zero Integers|[Go]({{< relref "/ChapterFour/1300~1399/1317.Convert-Integer-to-the-Sum-of-Two-No-Zero-Integers.md" >}})|Easy||||56.9%| -|1442|Count Triplets That Can Form Two Arrays of Equal XOR|[Go]({{< relref "/ChapterFour/1400~1499/1442.Count-Triplets-That-Can-Form-Two-Arrays-of-Equal-XOR.md" >}})|Medium||||74.8%| -|1486|XOR Operation in an Array|[Go]({{< relref "/ChapterFour/1400~1499/1486.XOR-Operation-in-an-Array.md" >}})|Easy||||84.2%| -|1512|Number of Good Pairs|[Go]({{< relref "/ChapterFour/1500~1599/1512.Number-of-Good-Pairs.md" >}})|Easy||||88.0%| -|1518|Water Bottles|[Go]({{< relref "/ChapterFour/1500~1599/1518.Water-Bottles.md" >}})|Easy||||60.3%| -|1551|Minimum Operations to Make Array Equal|[Go]({{< relref "/ChapterFour/1500~1599/1551.Minimum-Operations-to-Make-Array-Equal.md" >}})|Medium||||80.8%| -|1573|Number of Ways to Split a String|[Go]({{< relref "/ChapterFour/1500~1599/1573.Number-of-Ways-to-Split-a-String.md" >}})|Medium||||32.1%| -|1648|Sell Diminishing-Valued Colored Balls|[Go]({{< relref "/ChapterFour/1600~1699/1648.Sell-Diminishing-Valued-Colored-Balls.md" >}})|Medium||||30.8%| -|1680|Concatenation of Consecutive Binary Numbers|[Go]({{< relref "/ChapterFour/1600~1699/1680.Concatenation-of-Consecutive-Binary-Numbers.md" >}})|Medium||||52.6%| -|1685|Sum of Absolute Differences in a Sorted Array|[Go]({{< relref "/ChapterFour/1600~1699/1685.Sum-of-Absolute-Differences-in-a-Sorted-Array.md" >}})|Medium||||65.7%| -|1688|Count of Matches in Tournament|[Go]({{< relref "/ChapterFour/1600~1699/1688.Count-of-Matches-in-Tournament.md" >}})|Easy||||82.7%| -|1690|Stone Game VII|[Go]({{< relref "/ChapterFour/1600~1699/1690.Stone-Game-VII.md" >}})|Medium||||58.7%| -|1716|Calculate Money in Leetcode Bank|[Go]({{< relref "/ChapterFour/1700~1799/1716.Calculate-Money-in-Leetcode-Bank.md" >}})|Easy||||64.9%| -|1742|Maximum Number of Balls in a Box|[Go]({{< relref "/ChapterFour/1700~1799/1742.Maximum-Number-of-Balls-in-a-Box.md" >}})|Easy||||73.7%| -|2165|Smallest Value of the Rearranged Number|[Go]({{< relref "/ChapterFour/2100~2199/2165.Smallest-Value-of-the-Rearranged-Number.md" >}})|Medium||||50.7%| -|2169|Count Operations to Obtain Zero|[Go]({{< relref "/ChapterFour/2100~2199/2169.Count-Operations-to-Obtain-Zero.md" >}})|Easy||||75.3%| -|2180|Count Integers With Even Digit Sum|[Go]({{< relref "/ChapterFour/2100~2199/2180.Count-Integers-With-Even-Digit-Sum.md" >}})|Easy||||64.5%| -|2183|Count Array Pairs Divisible by K|[Go]({{< relref "/ChapterFour/2100~2199/2183.Count-Array-Pairs-Divisible-by-K.md" >}})|Hard||||26.9%| +|1281|Subtract the Product and Sum of Digits of an Integer|[Go]({{< relref "/ChapterFour/1200~1299/1281.Subtract-the-Product-and-Sum-of-Digits-of-an-Integer.md" >}})|Easy||||86.6%| +|1290|Convert Binary Number in a Linked List to Integer|[Go]({{< relref "/ChapterFour/1200~1299/1290.Convert-Binary-Number-in-a-Linked-List-to-Integer.md" >}})|Easy||||82.1%| +|1304|Find N Unique Integers Sum up to Zero|[Go]({{< relref "/ChapterFour/1300~1399/1304.Find-N-Unique-Integers-Sum-up-to-Zero.md" >}})|Easy||||76.9%| +|1317|Convert Integer to the Sum of Two No-Zero Integers|[Go]({{< relref "/ChapterFour/1300~1399/1317.Convert-Integer-to-the-Sum-of-Two-No-Zero-Integers.md" >}})|Easy||||55.4%| +|1442|Count Triplets That Can Form Two Arrays of Equal XOR|[Go]({{< relref "/ChapterFour/1400~1499/1442.Count-Triplets-That-Can-Form-Two-Arrays-of-Equal-XOR.md" >}})|Medium||||76.1%| +|1486|XOR Operation in an Array|[Go]({{< relref "/ChapterFour/1400~1499/1486.XOR-Operation-in-an-Array.md" >}})|Easy||||84.6%| +|1512|Number of Good Pairs|[Go]({{< relref "/ChapterFour/1500~1599/1512.Number-of-Good-Pairs.md" >}})|Easy||||88.2%| +|1518|Water Bottles|[Go]({{< relref "/ChapterFour/1500~1599/1518.Water-Bottles.md" >}})|Easy||||60.5%| +|1551|Minimum Operations to Make Array Equal|[Go]({{< relref "/ChapterFour/1500~1599/1551.Minimum-Operations-to-Make-Array-Equal.md" >}})|Medium||||81.5%| +|1573|Number of Ways to Split a String|[Go]({{< relref "/ChapterFour/1500~1599/1573.Number-of-Ways-to-Split-a-String.md" >}})|Medium||||32.5%| +|1641|Count Sorted Vowel Strings|[Go]({{< relref "/ChapterFour/1600~1699/1641.Count-Sorted-Vowel-Strings.md" >}})|Medium||||77.4%| +|1648|Sell Diminishing-Valued Colored Balls|[Go]({{< relref "/ChapterFour/1600~1699/1648.Sell-Diminishing-Valued-Colored-Balls.md" >}})|Medium||||30.4%| +|1680|Concatenation of Consecutive Binary Numbers|[Go]({{< relref "/ChapterFour/1600~1699/1680.Concatenation-of-Consecutive-Binary-Numbers.md" >}})|Medium||||57.0%| +|1685|Sum of Absolute Differences in a Sorted Array|[Go]({{< relref "/ChapterFour/1600~1699/1685.Sum-of-Absolute-Differences-in-a-Sorted-Array.md" >}})|Medium||||63.5%| +|1688|Count of Matches in Tournament|[Go]({{< relref "/ChapterFour/1600~1699/1688.Count-of-Matches-in-Tournament.md" >}})|Easy||||83.1%| +|1690|Stone Game VII|[Go]({{< relref "/ChapterFour/1600~1699/1690.Stone-Game-VII.md" >}})|Medium||||58.1%| +|1716|Calculate Money in Leetcode Bank|[Go]({{< relref "/ChapterFour/1700~1799/1716.Calculate-Money-in-Leetcode-Bank.md" >}})|Easy||||66.1%| +|1742|Maximum Number of Balls in a Box|[Go]({{< relref "/ChapterFour/1700~1799/1742.Maximum-Number-of-Balls-in-a-Box.md" >}})|Easy||||73.6%| +|2038|Remove Colored Pieces if Both Neighbors are the Same Color|[Go]({{< relref "/ChapterFour/2000~2099/2038.Remove-Colored-Pieces-if-Both-Neighbors-are-the-Same-Color.md" >}})|Medium||||57.9%| +|2165|Smallest Value of the Rearranged Number|[Go]({{< relref "/ChapterFour/2100~2199/2165.Smallest-Value-of-the-Rearranged-Number.md" >}})|Medium||||51.4%| +|2169|Count Operations to Obtain Zero|[Go]({{< relref "/ChapterFour/2100~2199/2169.Count-Operations-to-Obtain-Zero.md" >}})|Easy||||75.2%| +|2180|Count Integers With Even Digit Sum|[Go]({{< relref "/ChapterFour/2100~2199/2180.Count-Integers-With-Even-Digit-Sum.md" >}})|Easy||||65.5%| +|2183|Count Array Pairs Divisible by K|[Go]({{< relref "/ChapterFour/2100~2199/2183.Count-Array-Pairs-Divisible-by-K.md" >}})|Hard||||28.3%| |------------|-------------------------------------------------------|-------| ----------------| ---------------|-------------|-------------|-------------| diff --git a/website/content/ChapterTwo/Segment_Tree.md b/website/content/ChapterTwo/Segment_Tree.md index 6118460ea..85d41ea58 100644 --- a/website/content/ChapterTwo/Segment_Tree.md +++ b/website/content/ChapterTwo/Segment_Tree.md @@ -37,18 +37,18 @@ weight: 18 | No. | Title | Solution | Difficulty | TimeComplexity | SpaceComplexity |Favorite| Acceptance | |:--------:|:------- | :--------: | :----------: | :----: | :-----: | :-----: |:-----: | -|0218|The Skyline Problem|[Go]({{< relref "/ChapterFour/0200~0299/0218.The-Skyline-Problem.md" >}})|Hard| O(n log n)| O(n)|❤️|38.7%| -|0307|Range Sum Query - Mutable|[Go]({{< relref "/ChapterFour/0300~0399/0307.Range-Sum-Query-Mutable.md" >}})|Medium| O(1)| O(n)||38.7%| -|0315|Count of Smaller Numbers After Self|[Go]({{< relref "/ChapterFour/0300~0399/0315.Count-of-Smaller-Numbers-After-Self.md" >}})|Hard| O(n log n)| O(n)||42.0%| -|0327|Count of Range Sum|[Go]({{< relref "/ChapterFour/0300~0399/0327.Count-of-Range-Sum.md" >}})|Hard| O(n log n)| O(n)|❤️|36.0%| -|0493|Reverse Pairs|[Go]({{< relref "/ChapterFour/0400~0499/0493.Reverse-Pairs.md" >}})|Hard| O(n log n)| O(n)||29.9%| -|0699|Falling Squares|[Go]({{< relref "/ChapterFour/0600~0699/0699.Falling-Squares.md" >}})|Hard| O(n log n)| O(n)|❤️|43.8%| -|0715|Range Module|[Go]({{< relref "/ChapterFour/0700~0799/0715.Range-Module.md" >}})|Hard| O(log n)| O(n)|❤️|43.6%| -|0729|My Calendar I|[Go]({{< relref "/ChapterFour/0700~0799/0729.My-Calendar-I.md" >}})|Medium||||55.2%| -|0732|My Calendar III|[Go]({{< relref "/ChapterFour/0700~0799/0732.My-Calendar-III.md" >}})|Hard| O(log n)| O(n)|❤️|66.5%| -|0850|Rectangle Area II|[Go]({{< relref "/ChapterFour/0800~0899/0850.Rectangle-Area-II.md" >}})|Hard| O(n log n)| O(n)|❤️|53.3%| -|1157|Online Majority Element In Subarray|[Go]({{< relref "/ChapterFour/1100~1199/1157.Online-Majority-Element-In-Subarray.md" >}})|Hard| O(log n)| O(n)|❤️|42.1%| -|1649|Create Sorted Array through Instructions|[Go]({{< relref "/ChapterFour/1600~1699/1649.Create-Sorted-Array-through-Instructions.md" >}})|Hard||||37.2%| +|0218|The Skyline Problem|[Go]({{< relref "/ChapterFour/0200~0299/0218.The-Skyline-Problem.md" >}})|Hard| O(n log n)| O(n)|❤️|41.9%| +|0307|Range Sum Query - Mutable|[Go]({{< relref "/ChapterFour/0300~0399/0307.Range-Sum-Query-Mutable.md" >}})|Medium| O(1)| O(n)||40.7%| +|0315|Count of Smaller Numbers After Self|[Go]({{< relref "/ChapterFour/0300~0399/0315.Count-of-Smaller-Numbers-After-Self.md" >}})|Hard| O(n log n)| O(n)||42.6%| +|0327|Count of Range Sum|[Go]({{< relref "/ChapterFour/0300~0399/0327.Count-of-Range-Sum.md" >}})|Hard| O(n log n)| O(n)|❤️|35.8%| +|0493|Reverse Pairs|[Go]({{< relref "/ChapterFour/0400~0499/0493.Reverse-Pairs.md" >}})|Hard| O(n log n)| O(n)||30.9%| +|0699|Falling Squares|[Go]({{< relref "/ChapterFour/0600~0699/0699.Falling-Squares.md" >}})|Hard| O(n log n)| O(n)|❤️|44.7%| +|0715|Range Module|[Go]({{< relref "/ChapterFour/0700~0799/0715.Range-Module.md" >}})|Hard| O(log n)| O(n)|❤️|44.6%| +|0729|My Calendar I|[Go]({{< relref "/ChapterFour/0700~0799/0729.My-Calendar-I.md" >}})|Medium||||56.8%| +|0732|My Calendar III|[Go]({{< relref "/ChapterFour/0700~0799/0732.My-Calendar-III.md" >}})|Hard| O(log n)| O(n)|❤️|71.5%| +|0850|Rectangle Area II|[Go]({{< relref "/ChapterFour/0800~0899/0850.Rectangle-Area-II.md" >}})|Hard| O(n log n)| O(n)|❤️|53.9%| +|1157|Online Majority Element In Subarray|[Go]({{< relref "/ChapterFour/1100~1199/1157.Online-Majority-Element-In-Subarray.md" >}})|Hard| O(log n)| O(n)|❤️|41.8%| +|1649|Create Sorted Array through Instructions|[Go]({{< relref "/ChapterFour/1600~1699/1649.Create-Sorted-Array-through-Instructions.md" >}})|Hard||||37.5%| |------------|-------------------------------------------------------|-------| ----------------| ---------------|-------------|-------------|-------------| diff --git a/website/content/ChapterTwo/Sliding_Window.md b/website/content/ChapterTwo/Sliding_Window.md index 93352fa77..f0e75b163 100644 --- a/website/content/ChapterTwo/Sliding_Window.md +++ b/website/content/ChapterTwo/Sliding_Window.md @@ -29,40 +29,41 @@ weight: 17 | No. | Title | Solution | Difficulty | TimeComplexity | SpaceComplexity |Favorite| Acceptance | |:--------:|:------- | :--------: | :----------: | :----: | :-----: | :-----: |:-----: | -|0003|Longest Substring Without Repeating Characters|[Go]({{< relref "/ChapterFour/0001~0099/0003.Longest-Substring-Without-Repeating-Characters.md" >}})|Medium| O(n)| O(1)|❤️|33.1%| -|0030|Substring with Concatenation of All Words|[Go]({{< relref "/ChapterFour/0001~0099/0030.Substring-with-Concatenation-of-All-Words.md" >}})|Hard||||28.1%| -|0076|Minimum Window Substring|[Go]({{< relref "/ChapterFour/0001~0099/0076.Minimum-Window-Substring.md" >}})|Hard| O(n)| O(n)|❤️|39.0%| -|0187|Repeated DNA Sequences|[Go]({{< relref "/ChapterFour/0100~0199/0187.Repeated-DNA-Sequences.md" >}})|Medium||||44.7%| -|0209|Minimum Size Subarray Sum|[Go]({{< relref "/ChapterFour/0200~0299/0209.Minimum-Size-Subarray-Sum.md" >}})|Medium||||43.3%| -|0219|Contains Duplicate II|[Go]({{< relref "/ChapterFour/0200~0299/0219.Contains-Duplicate-II.md" >}})|Easy||||40.7%| -|0220|Contains Duplicate III|[Go]({{< relref "/ChapterFour/0200~0299/0220.Contains-Duplicate-III.md" >}})|Medium||||21.7%| -|0239|Sliding Window Maximum|[Go]({{< relref "/ChapterFour/0200~0299/0239.Sliding-Window-Maximum.md" >}})|Hard| O(n * k)| O(n)|❤️|46.2%| -|0395|Longest Substring with At Least K Repeating Characters|[Go]({{< relref "/ChapterFour/0300~0399/0395.Longest-Substring-with-At-Least-K-Repeating-Characters.md" >}})|Medium||||44.6%| -|0424|Longest Repeating Character Replacement|[Go]({{< relref "/ChapterFour/0400~0499/0424.Longest-Repeating-Character-Replacement.md" >}})|Medium| O(n)| O(1) ||50.8%| -|0438|Find All Anagrams in a String|[Go]({{< relref "/ChapterFour/0400~0499/0438.Find-All-Anagrams-in-a-String.md" >}})|Medium||||48.3%| -|0480|Sliding Window Median|[Go]({{< relref "/ChapterFour/0400~0499/0480.Sliding-Window-Median.md" >}})|Hard| O(n * log k)| O(k)|❤️|40.9%| -|0567|Permutation in String|[Go]({{< relref "/ChapterFour/0500~0599/0567.Permutation-in-String.md" >}})|Medium| O(n)| O(1)|❤️|44.7%| -|0632|Smallest Range Covering Elements from K Lists|[Go]({{< relref "/ChapterFour/0600~0699/0632.Smallest-Range-Covering-Elements-from-K-Lists.md" >}})|Hard||||58.6%| -|0643|Maximum Average Subarray I|[Go]({{< relref "/ChapterFour/0600~0699/0643.Maximum-Average-Subarray-I.md" >}})|Easy||||43.5%| -|0713|Subarray Product Less Than K|[Go]({{< relref "/ChapterFour/0700~0799/0713.Subarray-Product-Less-Than-K.md" >}})|Medium||||43.8%| -|0718|Maximum Length of Repeated Subarray|[Go]({{< relref "/ChapterFour/0700~0799/0718.Maximum-Length-of-Repeated-Subarray.md" >}})|Medium||||51.4%| -|0862|Shortest Subarray with Sum at Least K|[Go]({{< relref "/ChapterFour/0800~0899/0862.Shortest-Subarray-with-Sum-at-Least-K.md" >}})|Hard||||26.2%| -|0904|Fruit Into Baskets|[Go]({{< relref "/ChapterFour/0900~0999/0904.Fruit-Into-Baskets.md" >}})|Medium||||42.8%| -|0930|Binary Subarrays With Sum|[Go]({{< relref "/ChapterFour/0900~0999/0930.Binary-Subarrays-With-Sum.md" >}})|Medium||||48.9%| -|0978|Longest Turbulent Subarray|[Go]({{< relref "/ChapterFour/0900~0999/0978.Longest-Turbulent-Subarray.md" >}})|Medium| O(n)| O(1)|❤️|47.5%| -|0992|Subarrays with K Different Integers|[Go]({{< relref "/ChapterFour/0900~0999/0992.Subarrays-with-K-Different-Integers.md" >}})|Hard| O(n)| O(n)|❤️|53.4%| -|0995|Minimum Number of K Consecutive Bit Flips|[Go]({{< relref "/ChapterFour/0900~0999/0995.Minimum-Number-of-K-Consecutive-Bit-Flips.md" >}})|Hard| O(n)| O(1)|❤️|50.8%| -|1004|Max Consecutive Ones III|[Go]({{< relref "/ChapterFour/1000~1099/1004.Max-Consecutive-Ones-III.md" >}})|Medium| O(n)| O(1) ||63.0%| -|1052|Grumpy Bookstore Owner|[Go]({{< relref "/ChapterFour/1000~1099/1052.Grumpy-Bookstore-Owner.md" >}})|Medium| O(n log n)| O(1) ||56.7%| -|1208|Get Equal Substrings Within Budget|[Go]({{< relref "/ChapterFour/1200~1299/1208.Get-Equal-Substrings-Within-Budget.md" >}})|Medium||||46.5%| -|1234|Replace the Substring for Balanced String|[Go]({{< relref "/ChapterFour/1200~1299/1234.Replace-the-Substring-for-Balanced-String.md" >}})|Medium||||36.2%| -|1423|Maximum Points You Can Obtain from Cards|[Go]({{< relref "/ChapterFour/1400~1499/1423.Maximum-Points-You-Can-Obtain-from-Cards.md" >}})|Medium||||50.0%| -|1438|Longest Continuous Subarray With Absolute Diff Less Than or Equal to Limit|[Go]({{< relref "/ChapterFour/1400~1499/1438.Longest-Continuous-Subarray-With-Absolute-Diff-Less-Than-or-Equal-to-Limit.md" >}})|Medium||||46.4%| -|1658|Minimum Operations to Reduce X to Zero|[Go]({{< relref "/ChapterFour/1600~1699/1658.Minimum-Operations-to-Reduce-X-to-Zero.md" >}})|Medium||||33.6%| -|1695|Maximum Erasure Value|[Go]({{< relref "/ChapterFour/1600~1699/1695.Maximum-Erasure-Value.md" >}})|Medium||||52.4%| -|1696|Jump Game VI|[Go]({{< relref "/ChapterFour/1600~1699/1696.Jump-Game-VI.md" >}})|Medium||||42.8%| -|1763|Longest Nice Substring|[Go]({{< relref "/ChapterFour/1700~1799/1763.Longest-Nice-Substring.md" >}})|Easy||||61.8%| -|1984|Minimum Difference Between Highest and Lowest of K Scores|[Go]({{< relref "/ChapterFour/1900~1999/1984.Minimum-Difference-Between-Highest-and-Lowest-of-K-Scores.md" >}})|Easy||||53.5%| +|0003|Longest Substring Without Repeating Characters|[Go]({{< relref "/ChapterFour/0001~0099/0003.Longest-Substring-Without-Repeating-Characters.md" >}})|Medium| O(n)| O(1)|❤️|33.8%| +|0030|Substring with Concatenation of All Words|[Go]({{< relref "/ChapterFour/0001~0099/0030.Substring-with-Concatenation-of-All-Words.md" >}})|Hard||||31.2%| +|0076|Minimum Window Substring|[Go]({{< relref "/ChapterFour/0001~0099/0076.Minimum-Window-Substring.md" >}})|Hard| O(n)| O(n)|❤️|40.9%| +|0187|Repeated DNA Sequences|[Go]({{< relref "/ChapterFour/0100~0199/0187.Repeated-DNA-Sequences.md" >}})|Medium||||47.0%| +|0209|Minimum Size Subarray Sum|[Go]({{< relref "/ChapterFour/0200~0299/0209.Minimum-Size-Subarray-Sum.md" >}})|Medium||||45.0%| +|0219|Contains Duplicate II|[Go]({{< relref "/ChapterFour/0200~0299/0219.Contains-Duplicate-II.md" >}})|Easy||||42.6%| +|0220|Contains Duplicate III|[Go]({{< relref "/ChapterFour/0200~0299/0220.Contains-Duplicate-III.md" >}})|Hard||||22.1%| +|0239|Sliding Window Maximum|[Go]({{< relref "/ChapterFour/0200~0299/0239.Sliding-Window-Maximum.md" >}})|Hard| O(n * k)| O(n)|❤️|46.3%| +|0395|Longest Substring with At Least K Repeating Characters|[Go]({{< relref "/ChapterFour/0300~0399/0395.Longest-Substring-with-At-Least-K-Repeating-Characters.md" >}})|Medium||||44.8%| +|0424|Longest Repeating Character Replacement|[Go]({{< relref "/ChapterFour/0400~0499/0424.Longest-Repeating-Character-Replacement.md" >}})|Medium| O(n)| O(1) ||52.0%| +|0438|Find All Anagrams in a String|[Go]({{< relref "/ChapterFour/0400~0499/0438.Find-All-Anagrams-in-a-String.md" >}})|Medium||||50.2%| +|0480|Sliding Window Median|[Go]({{< relref "/ChapterFour/0400~0499/0480.Sliding-Window-Median.md" >}})|Hard| O(n * log k)| O(k)|❤️|41.1%| +|0567|Permutation in String|[Go]({{< relref "/ChapterFour/0500~0599/0567.Permutation-in-String.md" >}})|Medium| O(n)| O(1)|❤️|44.3%| +|0632|Smallest Range Covering Elements from K Lists|[Go]({{< relref "/ChapterFour/0600~0699/0632.Smallest-Range-Covering-Elements-from-K-Lists.md" >}})|Hard||||61.0%| +|0643|Maximum Average Subarray I|[Go]({{< relref "/ChapterFour/0600~0699/0643.Maximum-Average-Subarray-I.md" >}})|Easy||||43.7%| +|0658|Find K Closest Elements|[Go]({{< relref "/ChapterFour/0600~0699/0658.Find-K-Closest-Elements.md" >}})|Medium||||46.8%| +|0713|Subarray Product Less Than K|[Go]({{< relref "/ChapterFour/0700~0799/0713.Subarray-Product-Less-Than-K.md" >}})|Medium||||45.8%| +|0718|Maximum Length of Repeated Subarray|[Go]({{< relref "/ChapterFour/0700~0799/0718.Maximum-Length-of-Repeated-Subarray.md" >}})|Medium||||51.3%| +|0862|Shortest Subarray with Sum at Least K|[Go]({{< relref "/ChapterFour/0800~0899/0862.Shortest-Subarray-with-Sum-at-Least-K.md" >}})|Hard||||26.0%| +|0904|Fruit Into Baskets|[Go]({{< relref "/ChapterFour/0900~0999/0904.Fruit-Into-Baskets.md" >}})|Medium||||43.7%| +|0930|Binary Subarrays With Sum|[Go]({{< relref "/ChapterFour/0900~0999/0930.Binary-Subarrays-With-Sum.md" >}})|Medium||||52.2%| +|0978|Longest Turbulent Subarray|[Go]({{< relref "/ChapterFour/0900~0999/0978.Longest-Turbulent-Subarray.md" >}})|Medium| O(n)| O(1)|❤️|47.2%| +|0992|Subarrays with K Different Integers|[Go]({{< relref "/ChapterFour/0900~0999/0992.Subarrays-with-K-Different-Integers.md" >}})|Hard| O(n)| O(n)|❤️|54.6%| +|0995|Minimum Number of K Consecutive Bit Flips|[Go]({{< relref "/ChapterFour/0900~0999/0995.Minimum-Number-of-K-Consecutive-Bit-Flips.md" >}})|Hard| O(n)| O(1)|❤️|51.2%| +|1004|Max Consecutive Ones III|[Go]({{< relref "/ChapterFour/1000~1099/1004.Max-Consecutive-Ones-III.md" >}})|Medium| O(n)| O(1) ||63.2%| +|1052|Grumpy Bookstore Owner|[Go]({{< relref "/ChapterFour/1000~1099/1052.Grumpy-Bookstore-Owner.md" >}})|Medium| O(n log n)| O(1) ||57.1%| +|1208|Get Equal Substrings Within Budget|[Go]({{< relref "/ChapterFour/1200~1299/1208.Get-Equal-Substrings-Within-Budget.md" >}})|Medium||||48.6%| +|1234|Replace the Substring for Balanced String|[Go]({{< relref "/ChapterFour/1200~1299/1234.Replace-the-Substring-for-Balanced-String.md" >}})|Medium||||37.2%| +|1423|Maximum Points You Can Obtain from Cards|[Go]({{< relref "/ChapterFour/1400~1499/1423.Maximum-Points-You-Can-Obtain-from-Cards.md" >}})|Medium||||52.2%| +|1438|Longest Continuous Subarray With Absolute Diff Less Than or Equal to Limit|[Go]({{< relref "/ChapterFour/1400~1499/1438.Longest-Continuous-Subarray-With-Absolute-Diff-Less-Than-or-Equal-to-Limit.md" >}})|Medium||||48.3%| +|1658|Minimum Operations to Reduce X to Zero|[Go]({{< relref "/ChapterFour/1600~1699/1658.Minimum-Operations-to-Reduce-X-to-Zero.md" >}})|Medium||||37.6%| +|1695|Maximum Erasure Value|[Go]({{< relref "/ChapterFour/1600~1699/1695.Maximum-Erasure-Value.md" >}})|Medium||||57.6%| +|1696|Jump Game VI|[Go]({{< relref "/ChapterFour/1600~1699/1696.Jump-Game-VI.md" >}})|Medium||||46.1%| +|1763|Longest Nice Substring|[Go]({{< relref "/ChapterFour/1700~1799/1763.Longest-Nice-Substring.md" >}})|Easy||||61.5%| +|1984|Minimum Difference Between Highest and Lowest of K Scores|[Go]({{< relref "/ChapterFour/1900~1999/1984.Minimum-Difference-Between-Highest-and-Lowest-of-K-Scores.md" >}})|Easy||||54.5%| |------------|-------------------------------------------------------|-------| ----------------| ---------------|-------------|-------------|-------------| diff --git a/website/content/ChapterTwo/Sorting.md b/website/content/ChapterTwo/Sorting.md index a00800f1f..f50ce2687 100755 --- a/website/content/ChapterTwo/Sorting.md +++ b/website/content/ChapterTwo/Sorting.md @@ -18,111 +18,114 @@ weight: 14 | No. | Title | Solution | Difficulty | TimeComplexity | SpaceComplexity |Favorite| Acceptance | |:--------:|:------- | :--------: | :----------: | :----: | :-----: | :-----: |:-----: | -|0015|3Sum|[Go]({{< relref "/ChapterFour/0001~0099/0015.3Sum.md" >}})|Medium||||31.1%| -|0016|3Sum Closest|[Go]({{< relref "/ChapterFour/0001~0099/0016.3Sum-Closest.md" >}})|Medium||||47.1%| -|0018|4Sum|[Go]({{< relref "/ChapterFour/0001~0099/0018.4Sum.md" >}})|Medium||||37.3%| -|0049|Group Anagrams|[Go]({{< relref "/ChapterFour/0001~0099/0049.Group-Anagrams.md" >}})|Medium||||64.2%| -|0056|Merge Intervals|[Go]({{< relref "/ChapterFour/0001~0099/0056.Merge-Intervals.md" >}})|Medium| O(n log n)| O(log n)||44.9%| -|0075|Sort Colors|[Go]({{< relref "/ChapterFour/0001~0099/0075.Sort-Colors.md" >}})|Medium| O(n)| O(1)|❤️|54.8%| -|0088|Merge Sorted Array|[Go]({{< relref "/ChapterFour/0001~0099/0088.Merge-Sorted-Array.md" >}})|Easy||||43.9%| -|0147|Insertion Sort List|[Go]({{< relref "/ChapterFour/0100~0199/0147.Insertion-Sort-List.md" >}})|Medium| O(n^2)| O(1) |❤️|48.9%| -|0148|Sort List|[Go]({{< relref "/ChapterFour/0100~0199/0148.Sort-List.md" >}})|Medium|O(n log n)| O(log n)|❤️|52.1%| -|0164|Maximum Gap|[Go]({{< relref "/ChapterFour/0100~0199/0164.Maximum-Gap.md" >}})|Hard| O(n log n)| O(log n) |❤️|41.4%| -|0169|Majority Element|[Go]({{< relref "/ChapterFour/0100~0199/0169.Majority-Element.md" >}})|Easy||||62.9%| -|0179|Largest Number|[Go]({{< relref "/ChapterFour/0100~0199/0179.Largest-Number.md" >}})|Medium| O(n log n)| O(log n) |❤️|32.9%| -|0215|Kth Largest Element in an Array|[Go]({{< relref "/ChapterFour/0200~0299/0215.Kth-Largest-Element-in-an-Array.md" >}})|Medium||||63.5%| -|0217|Contains Duplicate|[Go]({{< relref "/ChapterFour/0200~0299/0217.Contains-Duplicate.md" >}})|Easy||||60.8%| -|0220|Contains Duplicate III|[Go]({{< relref "/ChapterFour/0200~0299/0220.Contains-Duplicate-III.md" >}})|Medium| O(n log n)| O(1) |❤️|21.7%| -|0229|Majority Element II|[Go]({{< relref "/ChapterFour/0200~0299/0229.Majority-Element-II.md" >}})|Medium||||42.4%| -|0242|Valid Anagram|[Go]({{< relref "/ChapterFour/0200~0299/0242.Valid-Anagram.md" >}})|Easy| O(n)| O(n) ||61.4%| -|0268|Missing Number|[Go]({{< relref "/ChapterFour/0200~0299/0268.Missing-Number.md" >}})|Easy||||59.4%| -|0274|H-Index|[Go]({{< relref "/ChapterFour/0200~0299/0274.H-Index.md" >}})|Medium| O(n)| O(n) ||37.6%| -|0324|Wiggle Sort II|[Go]({{< relref "/ChapterFour/0300~0399/0324.Wiggle-Sort-II.md" >}})|Medium| O(n)| O(n)|❤️|32.2%| -|0347|Top K Frequent Elements|[Go]({{< relref "/ChapterFour/0300~0399/0347.Top-K-Frequent-Elements.md" >}})|Medium||||65.1%| -|0349|Intersection of Two Arrays|[Go]({{< relref "/ChapterFour/0300~0399/0349.Intersection-of-Two-Arrays.md" >}})|Easy| O(n)| O(n) ||69.1%| -|0350|Intersection of Two Arrays II|[Go]({{< relref "/ChapterFour/0300~0399/0350.Intersection-of-Two-Arrays-II.md" >}})|Easy| O(n)| O(n) ||54.9%| -|0354|Russian Doll Envelopes|[Go]({{< relref "/ChapterFour/0300~0399/0354.Russian-Doll-Envelopes.md" >}})|Hard||||38.9%| -|0368|Largest Divisible Subset|[Go]({{< relref "/ChapterFour/0300~0399/0368.Largest-Divisible-Subset.md" >}})|Medium||||40.6%| -|0378|Kth Smallest Element in a Sorted Matrix|[Go]({{< relref "/ChapterFour/0300~0399/0378.Kth-Smallest-Element-in-a-Sorted-Matrix.md" >}})|Medium||||59.7%| -|0389|Find the Difference|[Go]({{< relref "/ChapterFour/0300~0399/0389.Find-the-Difference.md" >}})|Easy||||60.5%| -|0414|Third Maximum Number|[Go]({{< relref "/ChapterFour/0400~0499/0414.Third-Maximum-Number.md" >}})|Easy||||31.8%| -|0435|Non-overlapping Intervals|[Go]({{< relref "/ChapterFour/0400~0499/0435.Non-overlapping-Intervals.md" >}})|Medium||||48.3%| -|0436|Find Right Interval|[Go]({{< relref "/ChapterFour/0400~0499/0436.Find-Right-Interval.md" >}})|Medium||||49.5%| -|0451|Sort Characters By Frequency|[Go]({{< relref "/ChapterFour/0400~0499/0451.Sort-Characters-By-Frequency.md" >}})|Medium||||67.8%| -|0455|Assign Cookies|[Go]({{< relref "/ChapterFour/0400~0499/0455.Assign-Cookies.md" >}})|Easy||||50.7%| -|0462|Minimum Moves to Equal Array Elements II|[Go]({{< relref "/ChapterFour/0400~0499/0462.Minimum-Moves-to-Equal-Array-Elements-II.md" >}})|Medium||||57.0%| -|0475|Heaters|[Go]({{< relref "/ChapterFour/0400~0499/0475.Heaters.md" >}})|Medium||||35.3%| -|0506|Relative Ranks|[Go]({{< relref "/ChapterFour/0500~0599/0506.Relative-Ranks.md" >}})|Easy||||56.8%| -|0524|Longest Word in Dictionary through Deleting|[Go]({{< relref "/ChapterFour/0500~0599/0524.Longest-Word-in-Dictionary-through-Deleting.md" >}})|Medium| O(n)| O(1) ||50.9%| -|0532|K-diff Pairs in an Array|[Go]({{< relref "/ChapterFour/0500~0599/0532.K-diff-Pairs-in-an-Array.md" >}})|Medium||||40.1%| -|0561|Array Partition I|[Go]({{< relref "/ChapterFour/0500~0599/0561.Array-Partition-I.md" >}})|Easy||||75.7%| -|0581|Shortest Unsorted Continuous Subarray|[Go]({{< relref "/ChapterFour/0500~0599/0581.Shortest-Unsorted-Continuous-Subarray.md" >}})|Medium||||35.9%| -|0594|Longest Harmonious Subsequence|[Go]({{< relref "/ChapterFour/0500~0599/0594.Longest-Harmonious-Subsequence.md" >}})|Easy||||52.7%| -|0611|Valid Triangle Number|[Go]({{< relref "/ChapterFour/0600~0699/0611.Valid-Triangle-Number.md" >}})|Medium||||49.8%| -|0628|Maximum Product of Three Numbers|[Go]({{< relref "/ChapterFour/0600~0699/0628.Maximum-Product-of-Three-Numbers.md" >}})|Easy||||46.7%| -|0632|Smallest Range Covering Elements from K Lists|[Go]({{< relref "/ChapterFour/0600~0699/0632.Smallest-Range-Covering-Elements-from-K-Lists.md" >}})|Hard||||58.6%| -|0645|Set Mismatch|[Go]({{< relref "/ChapterFour/0600~0699/0645.Set-Mismatch.md" >}})|Easy||||41.3%| -|0658|Find K Closest Elements|[Go]({{< relref "/ChapterFour/0600~0699/0658.Find-K-Closest-Elements.md" >}})|Medium||||44.5%| -|0692|Top K Frequent Words|[Go]({{< relref "/ChapterFour/0600~0699/0692.Top-K-Frequent-Words.md" >}})|Medium||||54.4%| -|0710|Random Pick with Blacklist|[Go]({{< relref "/ChapterFour/0700~0799/0710.Random-Pick-with-Blacklist.md" >}})|Hard| O(n)| O(n) ||33.2%| -|0719|Find K-th Smallest Pair Distance|[Go]({{< relref "/ChapterFour/0700~0799/0719.Find-K-th-Smallest-Pair-Distance.md" >}})|Hard||||35.1%| -|0720|Longest Word in Dictionary|[Go]({{< relref "/ChapterFour/0700~0799/0720.Longest-Word-in-Dictionary.md" >}})|Medium||||51.0%| -|0726|Number of Atoms|[Go]({{< relref "/ChapterFour/0700~0799/0726.Number-of-Atoms.md" >}})|Hard||||51.7%| -|0747|Largest Number At Least Twice of Others|[Go]({{< relref "/ChapterFour/0700~0799/0747.Largest-Number-At-Least-Twice-of-Others.md" >}})|Easy||||45.3%| -|0767|Reorganize String|[Go]({{< relref "/ChapterFour/0700~0799/0767.Reorganize-String.md" >}})|Medium| O(n log n)| O(log n) |❤️|52.1%| -|0791|Custom Sort String|[Go]({{< relref "/ChapterFour/0700~0799/0791.Custom-Sort-String.md" >}})|Medium||||69.2%| -|0792|Number of Matching Subsequences|[Go]({{< relref "/ChapterFour/0700~0799/0792.Number-of-Matching-Subsequences.md" >}})|Medium||||50.5%| -|0825|Friends Of Appropriate Ages|[Go]({{< relref "/ChapterFour/0800~0899/0825.Friends-Of-Appropriate-Ages.md" >}})|Medium||||46.0%| -|0826|Most Profit Assigning Work|[Go]({{< relref "/ChapterFour/0800~0899/0826.Most-Profit-Assigning-Work.md" >}})|Medium||||42.1%| +|0015|3Sum|[Go]({{< relref "/ChapterFour/0001~0099/0015.3Sum.md" >}})|Medium||||32.6%| +|0016|3Sum Closest|[Go]({{< relref "/ChapterFour/0001~0099/0016.3Sum-Closest.md" >}})|Medium||||45.8%| +|0018|4Sum|[Go]({{< relref "/ChapterFour/0001~0099/0018.4Sum.md" >}})|Medium||||35.9%| +|0049|Group Anagrams|[Go]({{< relref "/ChapterFour/0001~0099/0049.Group-Anagrams.md" >}})|Medium||||66.7%| +|0056|Merge Intervals|[Go]({{< relref "/ChapterFour/0001~0099/0056.Merge-Intervals.md" >}})|Medium| O(n log n)| O(log n)||46.2%| +|0075|Sort Colors|[Go]({{< relref "/ChapterFour/0001~0099/0075.Sort-Colors.md" >}})|Medium| O(n)| O(1)|❤️|58.5%| +|0088|Merge Sorted Array|[Go]({{< relref "/ChapterFour/0001~0099/0088.Merge-Sorted-Array.md" >}})|Easy||||46.6%| +|0147|Insertion Sort List|[Go]({{< relref "/ChapterFour/0100~0199/0147.Insertion-Sort-List.md" >}})|Medium| O(n^2)| O(1) |❤️|51.0%| +|0148|Sort List|[Go]({{< relref "/ChapterFour/0100~0199/0148.Sort-List.md" >}})|Medium|O(n log n)| O(log n)|❤️|55.1%| +|0164|Maximum Gap|[Go]({{< relref "/ChapterFour/0100~0199/0164.Maximum-Gap.md" >}})|Hard| O(n log n)| O(log n) |❤️|43.3%| +|0169|Majority Element|[Go]({{< relref "/ChapterFour/0100~0199/0169.Majority-Element.md" >}})|Easy||||63.9%| +|0179|Largest Number|[Go]({{< relref "/ChapterFour/0100~0199/0179.Largest-Number.md" >}})|Medium| O(n log n)| O(log n) |❤️|34.5%| +|0215|Kth Largest Element in an Array|[Go]({{< relref "/ChapterFour/0200~0299/0215.Kth-Largest-Element-in-an-Array.md" >}})|Medium||||66.1%| +|0217|Contains Duplicate|[Go]({{< relref "/ChapterFour/0200~0299/0217.Contains-Duplicate.md" >}})|Easy||||61.4%| +|0220|Contains Duplicate III|[Go]({{< relref "/ChapterFour/0200~0299/0220.Contains-Duplicate-III.md" >}})|Hard| O(n log n)| O(1) |❤️|22.1%| +|0229|Majority Element II|[Go]({{< relref "/ChapterFour/0200~0299/0229.Majority-Element-II.md" >}})|Medium||||45.0%| +|0242|Valid Anagram|[Go]({{< relref "/ChapterFour/0200~0299/0242.Valid-Anagram.md" >}})|Easy| O(n)| O(n) ||63.0%| +|0268|Missing Number|[Go]({{< relref "/ChapterFour/0200~0299/0268.Missing-Number.md" >}})|Easy||||62.5%| +|0274|H-Index|[Go]({{< relref "/ChapterFour/0200~0299/0274.H-Index.md" >}})|Medium| O(n)| O(n) ||38.3%| +|0324|Wiggle Sort II|[Go]({{< relref "/ChapterFour/0300~0399/0324.Wiggle-Sort-II.md" >}})|Medium| O(n)| O(n)|❤️|33.3%| +|0347|Top K Frequent Elements|[Go]({{< relref "/ChapterFour/0300~0399/0347.Top-K-Frequent-Elements.md" >}})|Medium||||64.2%| +|0349|Intersection of Two Arrays|[Go]({{< relref "/ChapterFour/0300~0399/0349.Intersection-of-Two-Arrays.md" >}})|Easy| O(n)| O(n) ||70.9%| +|0350|Intersection of Two Arrays II|[Go]({{< relref "/ChapterFour/0300~0399/0350.Intersection-of-Two-Arrays-II.md" >}})|Easy| O(n)| O(n) ||56.0%| +|0354|Russian Doll Envelopes|[Go]({{< relref "/ChapterFour/0300~0399/0354.Russian-Doll-Envelopes.md" >}})|Hard||||38.0%| +|0368|Largest Divisible Subset|[Go]({{< relref "/ChapterFour/0300~0399/0368.Largest-Divisible-Subset.md" >}})|Medium||||41.5%| +|0378|Kth Smallest Element in a Sorted Matrix|[Go]({{< relref "/ChapterFour/0300~0399/0378.Kth-Smallest-Element-in-a-Sorted-Matrix.md" >}})|Medium||||61.7%| +|0389|Find the Difference|[Go]({{< relref "/ChapterFour/0300~0399/0389.Find-the-Difference.md" >}})|Easy||||59.9%| +|0414|Third Maximum Number|[Go]({{< relref "/ChapterFour/0400~0499/0414.Third-Maximum-Number.md" >}})|Easy||||33.2%| +|0435|Non-overlapping Intervals|[Go]({{< relref "/ChapterFour/0400~0499/0435.Non-overlapping-Intervals.md" >}})|Medium||||50.3%| +|0436|Find Right Interval|[Go]({{< relref "/ChapterFour/0400~0499/0436.Find-Right-Interval.md" >}})|Medium||||50.8%| +|0451|Sort Characters By Frequency|[Go]({{< relref "/ChapterFour/0400~0499/0451.Sort-Characters-By-Frequency.md" >}})|Medium||||70.1%| +|0455|Assign Cookies|[Go]({{< relref "/ChapterFour/0400~0499/0455.Assign-Cookies.md" >}})|Easy||||49.9%| +|0462|Minimum Moves to Equal Array Elements II|[Go]({{< relref "/ChapterFour/0400~0499/0462.Minimum-Moves-to-Equal-Array-Elements-II.md" >}})|Medium||||60.0%| +|0475|Heaters|[Go]({{< relref "/ChapterFour/0400~0499/0475.Heaters.md" >}})|Medium||||36.5%| +|0506|Relative Ranks|[Go]({{< relref "/ChapterFour/0500~0599/0506.Relative-Ranks.md" >}})|Easy||||60.5%| +|0524|Longest Word in Dictionary through Deleting|[Go]({{< relref "/ChapterFour/0500~0599/0524.Longest-Word-in-Dictionary-through-Deleting.md" >}})|Medium| O(n)| O(1) ||51.0%| +|0532|K-diff Pairs in an Array|[Go]({{< relref "/ChapterFour/0500~0599/0532.K-diff-Pairs-in-an-Array.md" >}})|Medium||||41.2%| +|0561|Array Partition|[Go]({{< relref "/ChapterFour/0500~0599/0561.Array-Partition.md" >}})|Easy||||77.2%| +|0581|Shortest Unsorted Continuous Subarray|[Go]({{< relref "/ChapterFour/0500~0599/0581.Shortest-Unsorted-Continuous-Subarray.md" >}})|Medium||||36.4%| +|0594|Longest Harmonious Subsequence|[Go]({{< relref "/ChapterFour/0500~0599/0594.Longest-Harmonious-Subsequence.md" >}})|Easy||||53.5%| +|0611|Valid Triangle Number|[Go]({{< relref "/ChapterFour/0600~0699/0611.Valid-Triangle-Number.md" >}})|Medium||||50.5%| +|0628|Maximum Product of Three Numbers|[Go]({{< relref "/ChapterFour/0600~0699/0628.Maximum-Product-of-Three-Numbers.md" >}})|Easy||||45.9%| +|0632|Smallest Range Covering Elements from K Lists|[Go]({{< relref "/ChapterFour/0600~0699/0632.Smallest-Range-Covering-Elements-from-K-Lists.md" >}})|Hard||||61.0%| +|0645|Set Mismatch|[Go]({{< relref "/ChapterFour/0600~0699/0645.Set-Mismatch.md" >}})|Easy||||42.7%| +|0658|Find K Closest Elements|[Go]({{< relref "/ChapterFour/0600~0699/0658.Find-K-Closest-Elements.md" >}})|Medium||||46.8%| +|0692|Top K Frequent Words|[Go]({{< relref "/ChapterFour/0600~0699/0692.Top-K-Frequent-Words.md" >}})|Medium||||57.2%| +|0710|Random Pick with Blacklist|[Go]({{< relref "/ChapterFour/0700~0799/0710.Random-Pick-with-Blacklist.md" >}})|Hard| O(n)| O(n) ||33.5%| +|0719|Find K-th Smallest Pair Distance|[Go]({{< relref "/ChapterFour/0700~0799/0719.Find-K-th-Smallest-Pair-Distance.md" >}})|Hard||||36.7%| +|0720|Longest Word in Dictionary|[Go]({{< relref "/ChapterFour/0700~0799/0720.Longest-Word-in-Dictionary.md" >}})|Medium||||52.0%| +|0726|Number of Atoms|[Go]({{< relref "/ChapterFour/0700~0799/0726.Number-of-Atoms.md" >}})|Hard||||52.1%| +|0747|Largest Number At Least Twice of Others|[Go]({{< relref "/ChapterFour/0700~0799/0747.Largest-Number-At-Least-Twice-of-Others.md" >}})|Easy||||47.1%| +|0767|Reorganize String|[Go]({{< relref "/ChapterFour/0700~0799/0767.Reorganize-String.md" >}})|Medium| O(n log n)| O(log n) |❤️|52.9%| +|0786|K-th Smallest Prime Fraction|[Go]({{< relref "/ChapterFour/0700~0799/0786.K-th-Smallest-Prime-Fraction.md" >}})|Medium||||51.6%| +|0791|Custom Sort String|[Go]({{< relref "/ChapterFour/0700~0799/0791.Custom-Sort-String.md" >}})|Medium||||69.1%| +|0792|Number of Matching Subsequences|[Go]({{< relref "/ChapterFour/0700~0799/0792.Number-of-Matching-Subsequences.md" >}})|Medium||||51.6%| +|0825|Friends Of Appropriate Ages|[Go]({{< relref "/ChapterFour/0800~0899/0825.Friends-Of-Appropriate-Ages.md" >}})|Medium||||46.3%| +|0826|Most Profit Assigning Work|[Go]({{< relref "/ChapterFour/0800~0899/0826.Most-Profit-Assigning-Work.md" >}})|Medium||||44.9%| |0846|Hand of Straights|[Go]({{< relref "/ChapterFour/0800~0899/0846.Hand-of-Straights.md" >}})|Medium||||56.2%| -|0853|Car Fleet|[Go]({{< relref "/ChapterFour/0800~0899/0853.Car-Fleet.md" >}})|Medium| O(n log n)| O(log n) ||48.2%| -|0869|Reordered Power of 2|[Go]({{< relref "/ChapterFour/0800~0899/0869.Reordered-Power-of-2.md" >}})|Medium||||61.3%| -|0870|Advantage Shuffle|[Go]({{< relref "/ChapterFour/0800~0899/0870.Advantage-Shuffle.md" >}})|Medium||||51.3%| -|0881|Boats to Save People|[Go]({{< relref "/ChapterFour/0800~0899/0881.Boats-to-Save-People.md" >}})|Medium||||52.5%| -|0888|Fair Candy Swap|[Go]({{< relref "/ChapterFour/0800~0899/0888.Fair-Candy-Swap.md" >}})|Easy||||60.4%| -|0891|Sum of Subsequence Widths|[Go]({{< relref "/ChapterFour/0800~0899/0891.Sum-of-Subsequence-Widths.md" >}})|Hard||||35.6%| -|0910|Smallest Range II|[Go]({{< relref "/ChapterFour/0900~0999/0910.Smallest-Range-II.md" >}})|Medium||||32.8%| -|0922|Sort Array By Parity II|[Go]({{< relref "/ChapterFour/0900~0999/0922.Sort-Array-By-Parity-II.md" >}})|Easy| O(n)| O(1) ||70.6%| -|0923|3Sum With Multiplicity|[Go]({{< relref "/ChapterFour/0900~0999/0923.3Sum-With-Multiplicity.md" >}})|Medium||||45.4%| -|0969|Pancake Sorting|[Go]({{< relref "/ChapterFour/0900~0999/0969.Pancake-Sorting.md" >}})|Medium| O(n log n)| O(log n) |❤️|69.7%| -|0973|K Closest Points to Origin|[Go]({{< relref "/ChapterFour/0900~0999/0973.K-Closest-Points-to-Origin.md" >}})|Medium| O(n log n)| O(log n) ||66.0%| -|0976|Largest Perimeter Triangle|[Go]({{< relref "/ChapterFour/0900~0999/0976.Largest-Perimeter-Triangle.md" >}})|Easy| O(n log n)| O(log n) ||55.5%| -|0977|Squares of a Sorted Array|[Go]({{< relref "/ChapterFour/0900~0999/0977.Squares-of-a-Sorted-Array.md" >}})|Easy||||71.6%| -|1005|Maximize Sum Of Array After K Negations|[Go]({{< relref "/ChapterFour/1000~1099/1005.Maximize-Sum-Of-Array-After-K-Negations.md" >}})|Easy||||51.4%| -|1030|Matrix Cells in Distance Order|[Go]({{< relref "/ChapterFour/1000~1099/1030.Matrix-Cells-in-Distance-Order.md" >}})|Easy| O(n^2)| O(1) ||69.1%| -|1040|Moving Stones Until Consecutive II|[Go]({{< relref "/ChapterFour/1000~1099/1040.Moving-Stones-Until-Consecutive-II.md" >}})|Medium||||55.6%| -|1051|Height Checker|[Go]({{< relref "/ChapterFour/1000~1099/1051.Height-Checker.md" >}})|Easy||||74.3%| -|1054|Distant Barcodes|[Go]({{< relref "/ChapterFour/1000~1099/1054.Distant-Barcodes.md" >}})|Medium| O(n log n)| O(log n) |❤️|45.2%| -|1122|Relative Sort Array|[Go]({{< relref "/ChapterFour/1100~1199/1122.Relative-Sort-Array.md" >}})|Easy||||68.2%| -|1170|Compare Strings by Frequency of the Smallest Character|[Go]({{< relref "/ChapterFour/1100~1199/1170.Compare-Strings-by-Frequency-of-the-Smallest-Character.md" >}})|Medium||||61.1%| -|1200|Minimum Absolute Difference|[Go]({{< relref "/ChapterFour/1200~1299/1200.Minimum-Absolute-Difference.md" >}})|Easy||||69.8%| -|1235|Maximum Profit in Job Scheduling|[Go]({{< relref "/ChapterFour/1200~1299/1235.Maximum-Profit-in-Job-Scheduling.md" >}})|Hard||||50.9%| +|0853|Car Fleet|[Go]({{< relref "/ChapterFour/0800~0899/0853.Car-Fleet.md" >}})|Medium| O(n log n)| O(log n) ||50.3%| +|0869|Reordered Power of 2|[Go]({{< relref "/ChapterFour/0800~0899/0869.Reordered-Power-of-2.md" >}})|Medium||||63.5%| +|0870|Advantage Shuffle|[Go]({{< relref "/ChapterFour/0800~0899/0870.Advantage-Shuffle.md" >}})|Medium||||51.8%| +|0881|Boats to Save People|[Go]({{< relref "/ChapterFour/0800~0899/0881.Boats-to-Save-People.md" >}})|Medium||||53.1%| +|0888|Fair Candy Swap|[Go]({{< relref "/ChapterFour/0800~0899/0888.Fair-Candy-Swap.md" >}})|Easy||||60.7%| +|0891|Sum of Subsequence Widths|[Go]({{< relref "/ChapterFour/0800~0899/0891.Sum-of-Subsequence-Widths.md" >}})|Hard||||36.6%| +|0910|Smallest Range II|[Go]({{< relref "/ChapterFour/0900~0999/0910.Smallest-Range-II.md" >}})|Medium||||35.1%| +|0922|Sort Array By Parity II|[Go]({{< relref "/ChapterFour/0900~0999/0922.Sort-Array-By-Parity-II.md" >}})|Easy| O(n)| O(1) ||70.7%| +|0923|3Sum With Multiplicity|[Go]({{< relref "/ChapterFour/0900~0999/0923.3Sum-With-Multiplicity.md" >}})|Medium||||45.3%| +|0969|Pancake Sorting|[Go]({{< relref "/ChapterFour/0900~0999/0969.Pancake-Sorting.md" >}})|Medium| O(n log n)| O(log n) |❤️|70.1%| +|0973|K Closest Points to Origin|[Go]({{< relref "/ChapterFour/0900~0999/0973.K-Closest-Points-to-Origin.md" >}})|Medium| O(n log n)| O(log n) ||65.7%| +|0976|Largest Perimeter Triangle|[Go]({{< relref "/ChapterFour/0900~0999/0976.Largest-Perimeter-Triangle.md" >}})|Easy| O(n log n)| O(log n) ||54.6%| +|0977|Squares of a Sorted Array|[Go]({{< relref "/ChapterFour/0900~0999/0977.Squares-of-a-Sorted-Array.md" >}})|Easy||||71.9%| +|1005|Maximize Sum Of Array After K Negations|[Go]({{< relref "/ChapterFour/1000~1099/1005.Maximize-Sum-Of-Array-After-K-Negations.md" >}})|Easy||||50.9%| +|1030|Matrix Cells in Distance Order|[Go]({{< relref "/ChapterFour/1000~1099/1030.Matrix-Cells-in-Distance-Order.md" >}})|Easy| O(n^2)| O(1) ||69.7%| +|1040|Moving Stones Until Consecutive II|[Go]({{< relref "/ChapterFour/1000~1099/1040.Moving-Stones-Until-Consecutive-II.md" >}})|Medium||||55.9%| +|1051|Height Checker|[Go]({{< relref "/ChapterFour/1000~1099/1051.Height-Checker.md" >}})|Easy||||75.6%| +|1054|Distant Barcodes|[Go]({{< relref "/ChapterFour/1000~1099/1054.Distant-Barcodes.md" >}})|Medium| O(n log n)| O(log n) |❤️|45.8%| +|1122|Relative Sort Array|[Go]({{< relref "/ChapterFour/1100~1199/1122.Relative-Sort-Array.md" >}})|Easy||||68.6%| +|1170|Compare Strings by Frequency of the Smallest Character|[Go]({{< relref "/ChapterFour/1100~1199/1170.Compare-Strings-by-Frequency-of-the-Smallest-Character.md" >}})|Medium||||61.5%| +|1200|Minimum Absolute Difference|[Go]({{< relref "/ChapterFour/1200~1299/1200.Minimum-Absolute-Difference.md" >}})|Easy||||69.6%| +|1235|Maximum Profit in Job Scheduling|[Go]({{< relref "/ChapterFour/1200~1299/1235.Maximum-Profit-in-Job-Scheduling.md" >}})|Hard||||53.4%| |1296|Divide Array in Sets of K Consecutive Numbers|[Go]({{< relref "/ChapterFour/1200~1299/1296.Divide-Array-in-Sets-of-K-Consecutive-Numbers.md" >}})|Medium||||56.5%| -|1300|Sum of Mutated Array Closest to Target|[Go]({{< relref "/ChapterFour/1300~1399/1300.Sum-of-Mutated-Array-Closest-to-Target.md" >}})|Medium||||42.8%| -|1305|All Elements in Two Binary Search Trees|[Go]({{< relref "/ChapterFour/1300~1399/1305.All-Elements-in-Two-Binary-Search-Trees.md" >}})|Medium||||79.6%| -|1329|Sort the Matrix Diagonally|[Go]({{< relref "/ChapterFour/1300~1399/1329.Sort-the-Matrix-Diagonally.md" >}})|Medium||||81.3%| -|1337|The K Weakest Rows in a Matrix|[Go]({{< relref "/ChapterFour/1300~1399/1337.The-K-Weakest-Rows-in-a-Matrix.md" >}})|Easy||||74.3%| -|1383|Maximum Performance of a Team|[Go]({{< relref "/ChapterFour/1300~1399/1383.Maximum-Performance-of-a-Team.md" >}})|Hard||||41.5%| -|1385|Find the Distance Value Between Two Arrays|[Go]({{< relref "/ChapterFour/1300~1399/1385.Find-the-Distance-Value-Between-Two-Arrays.md" >}})|Easy||||65.9%| -|1464|Maximum Product of Two Elements in an Array|[Go]({{< relref "/ChapterFour/1400~1499/1464.Maximum-Product-of-Two-Elements-in-an-Array.md" >}})|Easy||||78.5%| -|1465|Maximum Area of a Piece of Cake After Horizontal and Vertical Cuts|[Go]({{< relref "/ChapterFour/1400~1499/1465.Maximum-Area-of-a-Piece-of-Cake-After-Horizontal-and-Vertical-Cuts.md" >}})|Medium||||37.1%| +|1300|Sum of Mutated Array Closest to Target|[Go]({{< relref "/ChapterFour/1300~1399/1300.Sum-of-Mutated-Array-Closest-to-Target.md" >}})|Medium||||43.6%| +|1305|All Elements in Two Binary Search Trees|[Go]({{< relref "/ChapterFour/1300~1399/1305.All-Elements-in-Two-Binary-Search-Trees.md" >}})|Medium||||79.8%| +|1329|Sort the Matrix Diagonally|[Go]({{< relref "/ChapterFour/1300~1399/1329.Sort-the-Matrix-Diagonally.md" >}})|Medium||||83.3%| +|1337|The K Weakest Rows in a Matrix|[Go]({{< relref "/ChapterFour/1300~1399/1337.The-K-Weakest-Rows-in-a-Matrix.md" >}})|Easy||||72.1%| +|1353|Maximum Number of Events That Can Be Attended|[Go]({{< relref "/ChapterFour/1300~1399/1353.Maximum-Number-of-Events-That-Can-Be-Attended.md" >}})|Medium||||32.5%| +|1383|Maximum Performance of a Team|[Go]({{< relref "/ChapterFour/1300~1399/1383.Maximum-Performance-of-a-Team.md" >}})|Hard||||48.5%| +|1385|Find the Distance Value Between Two Arrays|[Go]({{< relref "/ChapterFour/1300~1399/1385.Find-the-Distance-Value-Between-Two-Arrays.md" >}})|Easy||||66.5%| +|1464|Maximum Product of Two Elements in an Array|[Go]({{< relref "/ChapterFour/1400~1499/1464.Maximum-Product-of-Two-Elements-in-an-Array.md" >}})|Easy||||79.9%| +|1465|Maximum Area of a Piece of Cake After Horizontal and Vertical Cuts|[Go]({{< relref "/ChapterFour/1400~1499/1465.Maximum-Area-of-a-Piece-of-Cake-After-Horizontal-and-Vertical-Cuts.md" >}})|Medium||||40.9%| |1608|Special Array With X Elements Greater Than or Equal X|[Go]({{< relref "/ChapterFour/1600~1699/1608.Special-Array-With-X-Elements-Greater-Than-or-Equal-X.md" >}})|Easy||||60.5%| -|1619|Mean of Array After Removing Some Elements|[Go]({{< relref "/ChapterFour/1600~1699/1619.Mean-of-Array-After-Removing-Some-Elements.md" >}})|Easy||||64.5%| -|1636|Sort Array by Increasing Frequency|[Go]({{< relref "/ChapterFour/1600~1699/1636.Sort-Array-by-Increasing-Frequency.md" >}})|Easy||||68.4%| -|1647|Minimum Deletions to Make Character Frequencies Unique|[Go]({{< relref "/ChapterFour/1600~1699/1647.Minimum-Deletions-to-Make-Character-Frequencies-Unique.md" >}})|Medium||||56.5%| -|1648|Sell Diminishing-Valued Colored Balls|[Go]({{< relref "/ChapterFour/1600~1699/1648.Sell-Diminishing-Valued-Colored-Balls.md" >}})|Medium||||30.8%| -|1657|Determine if Two Strings Are Close|[Go]({{< relref "/ChapterFour/1600~1699/1657.Determine-if-Two-Strings-Are-Close.md" >}})|Medium||||54.5%| -|1665|Minimum Initial Energy to Finish Tasks|[Go]({{< relref "/ChapterFour/1600~1699/1665.Minimum-Initial-Energy-to-Finish-Tasks.md" >}})|Hard||||55.8%| -|1679|Max Number of K-Sum Pairs|[Go]({{< relref "/ChapterFour/1600~1699/1679.Max-Number-of-K-Sum-Pairs.md" >}})|Medium||||57.7%| -|1691|Maximum Height by Stacking Cuboids|[Go]({{< relref "/ChapterFour/1600~1699/1691.Maximum-Height-by-Stacking-Cuboids.md" >}})|Hard||||53.6%| -|1710|Maximum Units on a Truck|[Go]({{< relref "/ChapterFour/1700~1799/1710.Maximum-Units-on-a-Truck.md" >}})|Easy||||72.0%| -|1818|Minimum Absolute Sum Difference|[Go]({{< relref "/ChapterFour/1800~1899/1818.Minimum-Absolute-Sum-Difference.md" >}})|Medium||||29.4%| -|1846|Maximum Element After Decreasing and Rearranging|[Go]({{< relref "/ChapterFour/1800~1899/1846.Maximum-Element-After-Decreasing-and-Rearranging.md" >}})|Medium||||57.9%| -|1877|Minimize Maximum Pair Sum in Array|[Go]({{< relref "/ChapterFour/1800~1899/1877.Minimize-Maximum-Pair-Sum-in-Array.md" >}})|Medium||||80.7%| -|1984|Minimum Difference Between Highest and Lowest of K Scores|[Go]({{< relref "/ChapterFour/1900~1999/1984.Minimum-Difference-Between-Highest-and-Lowest-of-K-Scores.md" >}})|Easy||||53.5%| -|2164|Sort Even and Odd Indices Independently|[Go]({{< relref "/ChapterFour/2100~2199/2164.Sort-Even-and-Odd-Indices-Independently.md" >}})|Easy||||67.5%| -|2165|Smallest Value of the Rearranged Number|[Go]({{< relref "/ChapterFour/2100~2199/2165.Smallest-Value-of-the-Rearranged-Number.md" >}})|Medium||||50.7%| -|2171|Removing Minimum Number of Magic Beans|[Go]({{< relref "/ChapterFour/2100~2199/2171.Removing-Minimum-Number-of-Magic-Beans.md" >}})|Medium||||41.1%| +|1619|Mean of Array After Removing Some Elements|[Go]({{< relref "/ChapterFour/1600~1699/1619.Mean-of-Array-After-Removing-Some-Elements.md" >}})|Easy||||65.7%| +|1636|Sort Array by Increasing Frequency|[Go]({{< relref "/ChapterFour/1600~1699/1636.Sort-Array-by-Increasing-Frequency.md" >}})|Easy||||69.5%| +|1647|Minimum Deletions to Make Character Frequencies Unique|[Go]({{< relref "/ChapterFour/1600~1699/1647.Minimum-Deletions-to-Make-Character-Frequencies-Unique.md" >}})|Medium||||59.1%| +|1648|Sell Diminishing-Valued Colored Balls|[Go]({{< relref "/ChapterFour/1600~1699/1648.Sell-Diminishing-Valued-Colored-Balls.md" >}})|Medium||||30.5%| +|1657|Determine if Two Strings Are Close|[Go]({{< relref "/ChapterFour/1600~1699/1657.Determine-if-Two-Strings-Are-Close.md" >}})|Medium||||56.3%| +|1665|Minimum Initial Energy to Finish Tasks|[Go]({{< relref "/ChapterFour/1600~1699/1665.Minimum-Initial-Energy-to-Finish-Tasks.md" >}})|Hard||||56.3%| +|1679|Max Number of K-Sum Pairs|[Go]({{< relref "/ChapterFour/1600~1699/1679.Max-Number-of-K-Sum-Pairs.md" >}})|Medium||||57.3%| +|1691|Maximum Height by Stacking Cuboids|[Go]({{< relref "/ChapterFour/1600~1699/1691.Maximum-Height-by-Stacking-Cuboids.md" >}})|Hard||||54.4%| +|1710|Maximum Units on a Truck|[Go]({{< relref "/ChapterFour/1700~1799/1710.Maximum-Units-on-a-Truck.md" >}})|Easy||||73.8%| +|1818|Minimum Absolute Sum Difference|[Go]({{< relref "/ChapterFour/1800~1899/1818.Minimum-Absolute-Sum-Difference.md" >}})|Medium||||30.4%| +|1846|Maximum Element After Decreasing and Rearranging|[Go]({{< relref "/ChapterFour/1800~1899/1846.Maximum-Element-After-Decreasing-and-Rearranging.md" >}})|Medium||||58.9%| +|1877|Minimize Maximum Pair Sum in Array|[Go]({{< relref "/ChapterFour/1800~1899/1877.Minimize-Maximum-Pair-Sum-in-Array.md" >}})|Medium||||79.9%| +|1984|Minimum Difference Between Highest and Lowest of K Scores|[Go]({{< relref "/ChapterFour/1900~1999/1984.Minimum-Difference-Between-Highest-and-Lowest-of-K-Scores.md" >}})|Easy||||54.4%| +|2037|Minimum Number of Moves to Seat Everyone|[Go]({{< relref "/ChapterFour/2000~2099/2037.Minimum-Number-of-Moves-to-Seat-Everyone.md" >}})|Easy||||82.1%| +|2164|Sort Even and Odd Indices Independently|[Go]({{< relref "/ChapterFour/2100~2199/2164.Sort-Even-and-Odd-Indices-Independently.md" >}})|Easy||||65.0%| +|2165|Smallest Value of the Rearranged Number|[Go]({{< relref "/ChapterFour/2100~2199/2165.Smallest-Value-of-the-Rearranged-Number.md" >}})|Medium||||51.4%| +|2171|Removing Minimum Number of Magic Beans|[Go]({{< relref "/ChapterFour/2100~2199/2171.Removing-Minimum-Number-of-Magic-Beans.md" >}})|Medium||||42.1%| |------------|-------------------------------------------------------|-------| ----------------| ---------------|-------------|-------------|-------------| diff --git a/website/content/ChapterTwo/Stack.md b/website/content/ChapterTwo/Stack.md index 61d90f268..5b5c28b9a 100644 --- a/website/content/ChapterTwo/Stack.md +++ b/website/content/ChapterTwo/Stack.md @@ -17,63 +17,63 @@ weight: 5 | No. | Title | Solution | Difficulty | TimeComplexity | SpaceComplexity |Favorite| Acceptance | |:--------:|:------- | :--------: | :----------: | :----: | :-----: | :-----: |:-----: | -|0020|Valid Parentheses|[Go]({{< relref "/ChapterFour/0001~0099/0020.Valid-Parentheses.md" >}})|Easy| O(log n)| O(1)||40.9%| -|0032|Longest Valid Parentheses|[Go]({{< relref "/ChapterFour/0001~0099/0032.Longest-Valid-Parentheses.md" >}})|Hard||||31.3%| -|0042|Trapping Rain Water|[Go]({{< relref "/ChapterFour/0001~0099/0042.Trapping-Rain-Water.md" >}})|Hard| O(n)| O(1)|❤️|56.5%| -|0071|Simplify Path|[Go]({{< relref "/ChapterFour/0001~0099/0071.Simplify-Path.md" >}})|Medium| O(n)| O(n)|❤️|38.8%| -|0084|Largest Rectangle in Histogram|[Go]({{< relref "/ChapterFour/0001~0099/0084.Largest-Rectangle-in-Histogram.md" >}})|Hard| O(n)| O(n)|❤️|40.8%| -|0094|Binary Tree Inorder Traversal|[Go]({{< relref "/ChapterFour/0001~0099/0094.Binary-Tree-Inorder-Traversal.md" >}})|Easy| O(n)| O(1)||70.8%| -|0114|Flatten Binary Tree to Linked List|[Go]({{< relref "/ChapterFour/0100~0199/0114.Flatten-Binary-Tree-to-Linked-List.md" >}})|Medium||||57.8%| -|0143|Reorder List|[Go]({{< relref "/ChapterFour/0100~0199/0143.Reorder-List.md" >}})|Medium||||47.9%| -|0144|Binary Tree Preorder Traversal|[Go]({{< relref "/ChapterFour/0100~0199/0144.Binary-Tree-Preorder-Traversal.md" >}})|Easy| O(n)| O(1)||62.5%| -|0145|Binary Tree Postorder Traversal|[Go]({{< relref "/ChapterFour/0100~0199/0145.Binary-Tree-Postorder-Traversal.md" >}})|Easy| O(n)| O(1)||64.1%| -|0150|Evaluate Reverse Polish Notation|[Go]({{< relref "/ChapterFour/0100~0199/0150.Evaluate-Reverse-Polish-Notation.md" >}})|Medium| O(n)| O(1)||42.6%| -|0155|Min Stack|[Go]({{< relref "/ChapterFour/0100~0199/0155.Min-Stack.md" >}})|Easy| O(n)| O(n)||50.2%| -|0173|Binary Search Tree Iterator|[Go]({{< relref "/ChapterFour/0100~0199/0173.Binary-Search-Tree-Iterator.md" >}})|Medium| O(n)| O(1)||67.3%| -|0224|Basic Calculator|[Go]({{< relref "/ChapterFour/0200~0299/0224.Basic-Calculator.md" >}})|Hard| O(n)| O(n)||40.5%| -|0225|Implement Stack using Queues|[Go]({{< relref "/ChapterFour/0200~0299/0225.Implement-Stack-using-Queues.md" >}})|Easy| O(n)| O(n)||53.6%| -|0227|Basic Calculator II|[Go]({{< relref "/ChapterFour/0200~0299/0227.Basic-Calculator-II.md" >}})|Medium||||41.6%| -|0232|Implement Queue using Stacks|[Go]({{< relref "/ChapterFour/0200~0299/0232.Implement-Queue-using-Stacks.md" >}})|Easy| O(n)| O(n)||58.2%| -|0234|Palindrome Linked List|[Go]({{< relref "/ChapterFour/0200~0299/0234.Palindrome-Linked-List.md" >}})|Easy||||46.6%| -|0331|Verify Preorder Serialization of a Binary Tree|[Go]({{< relref "/ChapterFour/0300~0399/0331.Verify-Preorder-Serialization-of-a-Binary-Tree.md" >}})|Medium| O(n)| O(1)||43.7%| -|0341|Flatten Nested List Iterator|[Go]({{< relref "/ChapterFour/0300~0399/0341.Flatten-Nested-List-Iterator.md" >}})|Medium||||58.8%| -|0385|Mini Parser|[Go]({{< relref "/ChapterFour/0300~0399/0385.Mini-Parser.md" >}})|Medium||||35.9%| -|0394|Decode String|[Go]({{< relref "/ChapterFour/0300~0399/0394.Decode-String.md" >}})|Medium| O(n)| O(n)||56.3%| -|0402|Remove K Digits|[Go]({{< relref "/ChapterFour/0400~0499/0402.Remove-K-Digits.md" >}})|Medium| O(n)| O(1)||30.5%| -|0445|Add Two Numbers II|[Go]({{< relref "/ChapterFour/0400~0499/0445.Add-Two-Numbers-II.md" >}})|Medium||||58.6%| -|0456|132 Pattern|[Go]({{< relref "/ChapterFour/0400~0499/0456.132-Pattern.md" >}})|Medium| O(n)| O(n)||30.9%| -|0496|Next Greater Element I|[Go]({{< relref "/ChapterFour/0400~0499/0496.Next-Greater-Element-I.md" >}})|Easy| O(n)| O(n)||70.1%| -|0503|Next Greater Element II|[Go]({{< relref "/ChapterFour/0500~0599/0503.Next-Greater-Element-II.md" >}})|Medium| O(n)| O(n)||62.1%| -|0581|Shortest Unsorted Continuous Subarray|[Go]({{< relref "/ChapterFour/0500~0599/0581.Shortest-Unsorted-Continuous-Subarray.md" >}})|Medium||||35.9%| -|0589|N-ary Tree Preorder Traversal|[Go]({{< relref "/ChapterFour/0500~0599/0589.N-ary-Tree-Preorder-Traversal.md" >}})|Easy||||76.1%| -|0636|Exclusive Time of Functions|[Go]({{< relref "/ChapterFour/0600~0699/0636.Exclusive-Time-of-Functions.md" >}})|Medium| O(n)| O(n)||60.3%| -|0682|Baseball Game|[Go]({{< relref "/ChapterFour/0600~0699/0682.Baseball-Game.md" >}})|Easy| O(n)| O(n)||73.1%| -|0726|Number of Atoms|[Go]({{< relref "/ChapterFour/0700~0799/0726.Number-of-Atoms.md" >}})|Hard| O(n)| O(n) |❤️|51.7%| +|0020|Valid Parentheses|[Go]({{< relref "/ChapterFour/0001~0099/0020.Valid-Parentheses.md" >}})|Easy| O(log n)| O(1)||40.2%| +|0032|Longest Valid Parentheses|[Go]({{< relref "/ChapterFour/0001~0099/0032.Longest-Valid-Parentheses.md" >}})|Hard||||32.8%| +|0042|Trapping Rain Water|[Go]({{< relref "/ChapterFour/0001~0099/0042.Trapping-Rain-Water.md" >}})|Hard| O(n)| O(1)|❤️|59.2%| +|0071|Simplify Path|[Go]({{< relref "/ChapterFour/0001~0099/0071.Simplify-Path.md" >}})|Medium| O(n)| O(n)|❤️|39.3%| +|0084|Largest Rectangle in Histogram|[Go]({{< relref "/ChapterFour/0001~0099/0084.Largest-Rectangle-in-Histogram.md" >}})|Hard| O(n)| O(n)|❤️|42.6%| +|0094|Binary Tree Inorder Traversal|[Go]({{< relref "/ChapterFour/0001~0099/0094.Binary-Tree-Inorder-Traversal.md" >}})|Easy| O(n)| O(1)||73.8%| +|0114|Flatten Binary Tree to Linked List|[Go]({{< relref "/ChapterFour/0100~0199/0114.Flatten-Binary-Tree-to-Linked-List.md" >}})|Medium||||61.8%| +|0143|Reorder List|[Go]({{< relref "/ChapterFour/0100~0199/0143.Reorder-List.md" >}})|Medium||||52.5%| +|0144|Binary Tree Preorder Traversal|[Go]({{< relref "/ChapterFour/0100~0199/0144.Binary-Tree-Preorder-Traversal.md" >}})|Easy| O(n)| O(1)||66.8%| +|0145|Binary Tree Postorder Traversal|[Go]({{< relref "/ChapterFour/0100~0199/0145.Binary-Tree-Postorder-Traversal.md" >}})|Easy| O(n)| O(1)||67.9%| +|0150|Evaluate Reverse Polish Notation|[Go]({{< relref "/ChapterFour/0100~0199/0150.Evaluate-Reverse-Polish-Notation.md" >}})|Medium| O(n)| O(1)||45.7%| +|0155|Min Stack|[Go]({{< relref "/ChapterFour/0100~0199/0155.Min-Stack.md" >}})|Medium| O(n)| O(n)||52.3%| +|0173|Binary Search Tree Iterator|[Go]({{< relref "/ChapterFour/0100~0199/0173.Binary-Search-Tree-Iterator.md" >}})|Medium| O(n)| O(1)||69.7%| +|0224|Basic Calculator|[Go]({{< relref "/ChapterFour/0200~0299/0224.Basic-Calculator.md" >}})|Hard| O(n)| O(n)||42.4%| +|0225|Implement Stack using Queues|[Go]({{< relref "/ChapterFour/0200~0299/0225.Implement-Stack-using-Queues.md" >}})|Easy| O(n)| O(n)||58.6%| +|0227|Basic Calculator II|[Go]({{< relref "/ChapterFour/0200~0299/0227.Basic-Calculator-II.md" >}})|Medium||||42.4%| +|0232|Implement Queue using Stacks|[Go]({{< relref "/ChapterFour/0200~0299/0232.Implement-Queue-using-Stacks.md" >}})|Easy| O(n)| O(n)||63.2%| +|0234|Palindrome Linked List|[Go]({{< relref "/ChapterFour/0200~0299/0234.Palindrome-Linked-List.md" >}})|Easy||||50.2%| +|0331|Verify Preorder Serialization of a Binary Tree|[Go]({{< relref "/ChapterFour/0300~0399/0331.Verify-Preorder-Serialization-of-a-Binary-Tree.md" >}})|Medium| O(n)| O(1)||44.6%| +|0341|Flatten Nested List Iterator|[Go]({{< relref "/ChapterFour/0300~0399/0341.Flatten-Nested-List-Iterator.md" >}})|Medium||||61.8%| +|0385|Mini Parser|[Go]({{< relref "/ChapterFour/0300~0399/0385.Mini-Parser.md" >}})|Medium||||36.9%| +|0394|Decode String|[Go]({{< relref "/ChapterFour/0300~0399/0394.Decode-String.md" >}})|Medium| O(n)| O(n)||57.9%| +|0402|Remove K Digits|[Go]({{< relref "/ChapterFour/0400~0499/0402.Remove-K-Digits.md" >}})|Medium| O(n)| O(1)||30.6%| +|0445|Add Two Numbers II|[Go]({{< relref "/ChapterFour/0400~0499/0445.Add-Two-Numbers-II.md" >}})|Medium||||59.6%| +|0456|132 Pattern|[Go]({{< relref "/ChapterFour/0400~0499/0456.132-Pattern.md" >}})|Medium| O(n)| O(n)||32.4%| +|0496|Next Greater Element I|[Go]({{< relref "/ChapterFour/0400~0499/0496.Next-Greater-Element-I.md" >}})|Easy| O(n)| O(n)||71.4%| +|0503|Next Greater Element II|[Go]({{< relref "/ChapterFour/0500~0599/0503.Next-Greater-Element-II.md" >}})|Medium| O(n)| O(n)||63.2%| +|0581|Shortest Unsorted Continuous Subarray|[Go]({{< relref "/ChapterFour/0500~0599/0581.Shortest-Unsorted-Continuous-Subarray.md" >}})|Medium||||36.4%| +|0589|N-ary Tree Preorder Traversal|[Go]({{< relref "/ChapterFour/0500~0599/0589.N-ary-Tree-Preorder-Traversal.md" >}})|Easy||||75.9%| +|0636|Exclusive Time of Functions|[Go]({{< relref "/ChapterFour/0600~0699/0636.Exclusive-Time-of-Functions.md" >}})|Medium| O(n)| O(n)||61.2%| +|0682|Baseball Game|[Go]({{< relref "/ChapterFour/0600~0699/0682.Baseball-Game.md" >}})|Easy| O(n)| O(n)||74.3%| +|0726|Number of Atoms|[Go]({{< relref "/ChapterFour/0700~0799/0726.Number-of-Atoms.md" >}})|Hard| O(n)| O(n) |❤️|52.1%| |0735|Asteroid Collision|[Go]({{< relref "/ChapterFour/0700~0799/0735.Asteroid-Collision.md" >}})|Medium| O(n)| O(n) ||44.4%| -|0739|Daily Temperatures|[Go]({{< relref "/ChapterFour/0700~0799/0739.Daily-Temperatures.md" >}})|Medium| O(n)| O(n) ||67.1%| -|0844|Backspace String Compare|[Go]({{< relref "/ChapterFour/0800~0899/0844.Backspace-String-Compare.md" >}})|Easy| O(n)| O(n) ||48.0%| -|0853|Car Fleet|[Go]({{< relref "/ChapterFour/0800~0899/0853.Car-Fleet.md" >}})|Medium||||48.2%| -|0856|Score of Parentheses|[Go]({{< relref "/ChapterFour/0800~0899/0856.Score-of-Parentheses.md" >}})|Medium| O(n)| O(n)||65.4%| +|0739|Daily Temperatures|[Go]({{< relref "/ChapterFour/0700~0799/0739.Daily-Temperatures.md" >}})|Medium| O(n)| O(n) ||66.3%| +|0844|Backspace String Compare|[Go]({{< relref "/ChapterFour/0800~0899/0844.Backspace-String-Compare.md" >}})|Easy| O(n)| O(n) ||48.1%| +|0853|Car Fleet|[Go]({{< relref "/ChapterFour/0800~0899/0853.Car-Fleet.md" >}})|Medium||||50.3%| +|0856|Score of Parentheses|[Go]({{< relref "/ChapterFour/0800~0899/0856.Score-of-Parentheses.md" >}})|Medium| O(n)| O(n)||64.8%| |0880|Decoded String at Index|[Go]({{< relref "/ChapterFour/0800~0899/0880.Decoded-String-at-Index.md" >}})|Medium| O(n)| O(n)||28.3%| -|0895|Maximum Frequency Stack|[Go]({{< relref "/ChapterFour/0800~0899/0895.Maximum-Frequency-Stack.md" >}})|Hard| O(n)| O(n) ||66.4%| -|0897|Increasing Order Search Tree|[Go]({{< relref "/ChapterFour/0800~0899/0897.Increasing-Order-Search-Tree.md" >}})|Easy||||78.3%| -|0901|Online Stock Span|[Go]({{< relref "/ChapterFour/0900~0999/0901.Online-Stock-Span.md" >}})|Medium| O(n)| O(n) ||63.1%| -|0907|Sum of Subarray Minimums|[Go]({{< relref "/ChapterFour/0900~0999/0907.Sum-of-Subarray-Minimums.md" >}})|Medium| O(n)| O(n)|❤️|33.9%| -|0921|Minimum Add to Make Parentheses Valid|[Go]({{< relref "/ChapterFour/0900~0999/0921.Minimum-Add-to-Make-Parentheses-Valid.md" >}})|Medium| O(n)| O(n)||77.1%| -|0946|Validate Stack Sequences|[Go]({{< relref "/ChapterFour/0900~0999/0946.Validate-Stack-Sequences.md" >}})|Medium| O(n)| O(n)||67.6%| -|1003|Check If Word Is Valid After Substitutions|[Go]({{< relref "/ChapterFour/1000~1099/1003.Check-If-Word-Is-Valid-After-Substitutions.md" >}})|Medium| O(n)| O(1)||57.9%| -|1006|Clumsy Factorial|[Go]({{< relref "/ChapterFour/1000~1099/1006.Clumsy-Factorial.md" >}})|Medium||||54.7%| -|1019|Next Greater Node In Linked List|[Go]({{< relref "/ChapterFour/1000~1099/1019.Next-Greater-Node-In-Linked-List.md" >}})|Medium| O(n)| O(1)||59.6%| -|1021|Remove Outermost Parentheses|[Go]({{< relref "/ChapterFour/1000~1099/1021.Remove-Outermost-Parentheses.md" >}})|Easy| O(n)| O(1)||79.8%| -|1047|Remove All Adjacent Duplicates In String|[Go]({{< relref "/ChapterFour/1000~1099/1047.Remove-All-Adjacent-Duplicates-In-String.md" >}})|Easy| O(n)| O(1)||70.9%| -|1111|Maximum Nesting Depth of Two Valid Parentheses Strings|[Go]({{< relref "/ChapterFour/1100~1199/1111.Maximum-Nesting-Depth-of-Two-Valid-Parentheses-Strings.md" >}})|Medium||||73.2%| -|1190|Reverse Substrings Between Each Pair of Parentheses|[Go]({{< relref "/ChapterFour/1100~1199/1190.Reverse-Substrings-Between-Each-Pair-of-Parentheses.md" >}})|Medium||||65.7%| -|1209|Remove All Adjacent Duplicates in String II|[Go]({{< relref "/ChapterFour/1200~1299/1209.Remove-All-Adjacent-Duplicates-in-String-II.md" >}})|Medium||||55.9%| -|1249|Minimum Remove to Make Valid Parentheses|[Go]({{< relref "/ChapterFour/1200~1299/1249.Minimum-Remove-to-Make-Valid-Parentheses.md" >}})|Medium||||65.7%| -|1614|Maximum Nesting Depth of the Parentheses|[Go]({{< relref "/ChapterFour/1600~1699/1614.Maximum-Nesting-Depth-of-the-Parentheses.md" >}})|Easy||||82.9%| -|1653|Minimum Deletions to Make String Balanced|[Go]({{< relref "/ChapterFour/1600~1699/1653.Minimum-Deletions-to-Make-String-Balanced.md" >}})|Medium||||56.6%| -|1673|Find the Most Competitive Subsequence|[Go]({{< relref "/ChapterFour/1600~1699/1673.Find-the-Most-Competitive-Subsequence.md" >}})|Medium||||48.4%| -|1700|Number of Students Unable to Eat Lunch|[Go]({{< relref "/ChapterFour/1700~1799/1700.Number-of-Students-Unable-to-Eat-Lunch.md" >}})|Easy||||67.7%| +|0895|Maximum Frequency Stack|[Go]({{< relref "/ChapterFour/0800~0899/0895.Maximum-Frequency-Stack.md" >}})|Hard| O(n)| O(n) ||66.6%| +|0897|Increasing Order Search Tree|[Go]({{< relref "/ChapterFour/0800~0899/0897.Increasing-Order-Search-Tree.md" >}})|Easy||||78.4%| +|0901|Online Stock Span|[Go]({{< relref "/ChapterFour/0900~0999/0901.Online-Stock-Span.md" >}})|Medium| O(n)| O(n) ||65.2%| +|0907|Sum of Subarray Minimums|[Go]({{< relref "/ChapterFour/0900~0999/0907.Sum-of-Subarray-Minimums.md" >}})|Medium| O(n)| O(n)|❤️|35.8%| +|0921|Minimum Add to Make Parentheses Valid|[Go]({{< relref "/ChapterFour/0900~0999/0921.Minimum-Add-to-Make-Parentheses-Valid.md" >}})|Medium| O(n)| O(n)||75.8%| +|0946|Validate Stack Sequences|[Go]({{< relref "/ChapterFour/0900~0999/0946.Validate-Stack-Sequences.md" >}})|Medium| O(n)| O(n)||67.7%| +|1003|Check If Word Is Valid After Substitutions|[Go]({{< relref "/ChapterFour/1000~1099/1003.Check-If-Word-Is-Valid-After-Substitutions.md" >}})|Medium| O(n)| O(1)||58.2%| +|1006|Clumsy Factorial|[Go]({{< relref "/ChapterFour/1000~1099/1006.Clumsy-Factorial.md" >}})|Medium||||55.4%| +|1019|Next Greater Node In Linked List|[Go]({{< relref "/ChapterFour/1000~1099/1019.Next-Greater-Node-In-Linked-List.md" >}})|Medium| O(n)| O(1)||59.9%| +|1021|Remove Outermost Parentheses|[Go]({{< relref "/ChapterFour/1000~1099/1021.Remove-Outermost-Parentheses.md" >}})|Easy| O(n)| O(1)||80.6%| +|1047|Remove All Adjacent Duplicates In String|[Go]({{< relref "/ChapterFour/1000~1099/1047.Remove-All-Adjacent-Duplicates-In-String.md" >}})|Easy| O(n)| O(1)||69.7%| +|1111|Maximum Nesting Depth of Two Valid Parentheses Strings|[Go]({{< relref "/ChapterFour/1100~1199/1111.Maximum-Nesting-Depth-of-Two-Valid-Parentheses-Strings.md" >}})|Medium||||73.0%| +|1190|Reverse Substrings Between Each Pair of Parentheses|[Go]({{< relref "/ChapterFour/1100~1199/1190.Reverse-Substrings-Between-Each-Pair-of-Parentheses.md" >}})|Medium||||65.9%| +|1209|Remove All Adjacent Duplicates in String II|[Go]({{< relref "/ChapterFour/1200~1299/1209.Remove-All-Adjacent-Duplicates-in-String-II.md" >}})|Medium||||56.2%| +|1249|Minimum Remove to Make Valid Parentheses|[Go]({{< relref "/ChapterFour/1200~1299/1249.Minimum-Remove-to-Make-Valid-Parentheses.md" >}})|Medium||||65.8%| +|1614|Maximum Nesting Depth of the Parentheses|[Go]({{< relref "/ChapterFour/1600~1699/1614.Maximum-Nesting-Depth-of-the-Parentheses.md" >}})|Easy||||82.3%| +|1653|Minimum Deletions to Make String Balanced|[Go]({{< relref "/ChapterFour/1600~1699/1653.Minimum-Deletions-to-Make-String-Balanced.md" >}})|Medium||||58.9%| +|1673|Find the Most Competitive Subsequence|[Go]({{< relref "/ChapterFour/1600~1699/1673.Find-the-Most-Competitive-Subsequence.md" >}})|Medium||||49.3%| +|1700|Number of Students Unable to Eat Lunch|[Go]({{< relref "/ChapterFour/1700~1799/1700.Number-of-Students-Unable-to-Eat-Lunch.md" >}})|Easy||||68.7%| |------------|-------------------------------------------------------|-------| ----------------| ---------------|-------------|-------------|-------------| diff --git a/website/content/ChapterTwo/String.md b/website/content/ChapterTwo/String.md index 16f00c7a3..240b6b1ac 100644 --- a/website/content/ChapterTwo/String.md +++ b/website/content/ChapterTwo/String.md @@ -9,184 +9,186 @@ weight: 2 | No. | Title | Solution | Difficulty | TimeComplexity | SpaceComplexity |Favorite| Acceptance | |:--------:|:------- | :--------: | :----------: | :----: | :-----: | :-----: |:-----: | -|0003|Longest Substring Without Repeating Characters|[Go]({{< relref "/ChapterFour/0001~0099/0003.Longest-Substring-Without-Repeating-Characters.md" >}})|Medium| O(n)| O(1)|❤️|33.1%| -|0005|Longest Palindromic Substring|[Go]({{< relref "/ChapterFour/0001~0099/0005.Longest-Palindromic-Substring.md" >}})|Medium||||31.8%| -|0006|Zigzag Conversion|[Go]({{< relref "/ChapterFour/0001~0099/0006.Zigzag-Conversion.md" >}})|Medium||||41.6%| -|0008|String to Integer (atoi)|[Go]({{< relref "/ChapterFour/0001~0099/0008.String-to-Integer-atoi.md" >}})|Medium||||16.5%| -|0012|Integer to Roman|[Go]({{< relref "/ChapterFour/0001~0099/0012.Integer-to-Roman.md" >}})|Medium||||59.4%| -|0013|Roman to Integer|[Go]({{< relref "/ChapterFour/0001~0099/0013.Roman-to-Integer.md" >}})|Easy||||57.9%| -|0014|Longest Common Prefix|[Go]({{< relref "/ChapterFour/0001~0099/0014.Longest-Common-Prefix.md" >}})|Easy||||39.4%| -|0017|Letter Combinations of a Phone Number|[Go]({{< relref "/ChapterFour/0001~0099/0017.Letter-Combinations-of-a-Phone-Number.md" >}})|Medium| O(log n)| O(1)||53.6%| -|0020|Valid Parentheses|[Go]({{< relref "/ChapterFour/0001~0099/0020.Valid-Parentheses.md" >}})|Easy| O(log n)| O(1)||40.9%| -|0022|Generate Parentheses|[Go]({{< relref "/ChapterFour/0001~0099/0022.Generate-Parentheses.md" >}})|Medium| O(log n)| O(1)||70.1%| -|0028|Implement strStr()|[Go]({{< relref "/ChapterFour/0001~0099/0028.Implement-strStr.md" >}})|Easy| O(n)| O(1)||35.9%| -|0030|Substring with Concatenation of All Words|[Go]({{< relref "/ChapterFour/0001~0099/0030.Substring-with-Concatenation-of-All-Words.md" >}})|Hard| O(n)| O(n)|❤️|28.1%| -|0032|Longest Valid Parentheses|[Go]({{< relref "/ChapterFour/0001~0099/0032.Longest-Valid-Parentheses.md" >}})|Hard||||31.3%| -|0043|Multiply Strings|[Go]({{< relref "/ChapterFour/0001~0099/0043.Multiply-Strings.md" >}})|Medium||||37.7%| -|0049|Group Anagrams|[Go]({{< relref "/ChapterFour/0001~0099/0049.Group-Anagrams.md" >}})|Medium| O(n log n)| O(n)||64.2%| -|0058|Length of Last Word|[Go]({{< relref "/ChapterFour/0001~0099/0058.Length-of-Last-Word.md" >}})|Easy||||37.7%| -|0065|Valid Number|[Go]({{< relref "/ChapterFour/0001~0099/0065.Valid-Number.md" >}})|Hard||||18.2%| -|0067|Add Binary|[Go]({{< relref "/ChapterFour/0001~0099/0067.Add-Binary.md" >}})|Easy||||50.5%| -|0071|Simplify Path|[Go]({{< relref "/ChapterFour/0001~0099/0071.Simplify-Path.md" >}})|Medium| O(n)| O(n)||38.8%| -|0076|Minimum Window Substring|[Go]({{< relref "/ChapterFour/0001~0099/0076.Minimum-Window-Substring.md" >}})|Hard| O(n)| O(n)|❤️|39.0%| -|0091|Decode Ways|[Go]({{< relref "/ChapterFour/0001~0099/0091.Decode-Ways.md" >}})|Medium| O(n)| O(n)||30.3%| -|0093|Restore IP Addresses|[Go]({{< relref "/ChapterFour/0001~0099/0093.Restore-IP-Addresses.md" >}})|Medium| O(n)| O(n)|❤️|41.9%| -|0097|Interleaving String|[Go]({{< relref "/ChapterFour/0001~0099/0097.Interleaving-String.md" >}})|Medium||||34.8%| -|0115|Distinct Subsequences|[Go]({{< relref "/ChapterFour/0100~0199/0115.Distinct-Subsequences.md" >}})|Hard||||42.3%| -|0125|Valid Palindrome|[Go]({{< relref "/ChapterFour/0100~0199/0125.Valid-Palindrome.md" >}})|Easy| O(n)| O(1)||41.7%| -|0126|Word Ladder II|[Go]({{< relref "/ChapterFour/0100~0199/0126.Word-Ladder-II.md" >}})|Hard| O(n)| O(n^2)|❤️|27.0%| -|0127|Word Ladder|[Go]({{< relref "/ChapterFour/0100~0199/0127.Word-Ladder.md" >}})|Hard||||35.5%| -|0131|Palindrome Partitioning|[Go]({{< relref "/ChapterFour/0100~0199/0131.Palindrome-Partitioning.md" >}})|Medium||||59.5%| -|0151|Reverse Words in a String|[Go]({{< relref "/ChapterFour/0100~0199/0151.Reverse-Words-in-a-String.md" >}})|Medium||||28.5%| -|0168|Excel Sheet Column Title|[Go]({{< relref "/ChapterFour/0100~0199/0168.Excel-Sheet-Column-Title.md" >}})|Easy||||33.9%| -|0171|Excel Sheet Column Number|[Go]({{< relref "/ChapterFour/0100~0199/0171.Excel-Sheet-Column-Number.md" >}})|Easy||||60.6%| -|0179|Largest Number|[Go]({{< relref "/ChapterFour/0100~0199/0179.Largest-Number.md" >}})|Medium||||32.9%| -|0187|Repeated DNA Sequences|[Go]({{< relref "/ChapterFour/0100~0199/0187.Repeated-DNA-Sequences.md" >}})|Medium||||44.7%| -|0205|Isomorphic Strings|[Go]({{< relref "/ChapterFour/0200~0299/0205.Isomorphic-Strings.md" >}})|Easy||||42.1%| -|0208|Implement Trie (Prefix Tree)|[Go]({{< relref "/ChapterFour/0200~0299/0208.Implement-Trie-Prefix-Tree.md" >}})|Medium||||58.2%| +|0003|Longest Substring Without Repeating Characters|[Go]({{< relref "/ChapterFour/0001~0099/0003.Longest-Substring-Without-Repeating-Characters.md" >}})|Medium| O(n)| O(1)|❤️|33.8%| +|0005|Longest Palindromic Substring|[Go]({{< relref "/ChapterFour/0001~0099/0005.Longest-Palindromic-Substring.md" >}})|Medium||||32.4%| +|0006|Zigzag Conversion|[Go]({{< relref "/ChapterFour/0001~0099/0006.Zigzag-Conversion.md" >}})|Medium||||44.8%| +|0008|String to Integer (atoi)|[Go]({{< relref "/ChapterFour/0001~0099/0008.String-to-Integer-atoi.md" >}})|Medium||||16.6%| +|0012|Integer to Roman|[Go]({{< relref "/ChapterFour/0001~0099/0012.Integer-to-Roman.md" >}})|Medium||||62.0%| +|0013|Roman to Integer|[Go]({{< relref "/ChapterFour/0001~0099/0013.Roman-to-Integer.md" >}})|Easy||||58.5%| +|0014|Longest Common Prefix|[Go]({{< relref "/ChapterFour/0001~0099/0014.Longest-Common-Prefix.md" >}})|Easy||||40.9%| +|0017|Letter Combinations of a Phone Number|[Go]({{< relref "/ChapterFour/0001~0099/0017.Letter-Combinations-of-a-Phone-Number.md" >}})|Medium| O(log n)| O(1)||56.5%| +|0020|Valid Parentheses|[Go]({{< relref "/ChapterFour/0001~0099/0020.Valid-Parentheses.md" >}})|Easy| O(log n)| O(1)||40.2%| +|0022|Generate Parentheses|[Go]({{< relref "/ChapterFour/0001~0099/0022.Generate-Parentheses.md" >}})|Medium| O(log n)| O(1)||72.5%| +|0028|Find the Index of the First Occurrence in a String|[Go]({{< relref "/ChapterFour/0001~0099/0028.Find-the-Index-of-the-First-Occurrence-in-a-String.md" >}})|Easy| O(n)| O(1)||39.0%| +|0030|Substring with Concatenation of All Words|[Go]({{< relref "/ChapterFour/0001~0099/0030.Substring-with-Concatenation-of-All-Words.md" >}})|Hard| O(n)| O(n)|❤️|31.2%| +|0032|Longest Valid Parentheses|[Go]({{< relref "/ChapterFour/0001~0099/0032.Longest-Valid-Parentheses.md" >}})|Hard||||32.8%| +|0043|Multiply Strings|[Go]({{< relref "/ChapterFour/0001~0099/0043.Multiply-Strings.md" >}})|Medium||||39.2%| +|0049|Group Anagrams|[Go]({{< relref "/ChapterFour/0001~0099/0049.Group-Anagrams.md" >}})|Medium| O(n log n)| O(n)||66.7%| +|0058|Length of Last Word|[Go]({{< relref "/ChapterFour/0001~0099/0058.Length-of-Last-Word.md" >}})|Easy||||42.8%| +|0065|Valid Number|[Go]({{< relref "/ChapterFour/0001~0099/0065.Valid-Number.md" >}})|Hard||||18.7%| +|0067|Add Binary|[Go]({{< relref "/ChapterFour/0001~0099/0067.Add-Binary.md" >}})|Easy||||52.4%| +|0071|Simplify Path|[Go]({{< relref "/ChapterFour/0001~0099/0071.Simplify-Path.md" >}})|Medium| O(n)| O(n)||39.3%| +|0076|Minimum Window Substring|[Go]({{< relref "/ChapterFour/0001~0099/0076.Minimum-Window-Substring.md" >}})|Hard| O(n)| O(n)|❤️|40.9%| +|0091|Decode Ways|[Go]({{< relref "/ChapterFour/0001~0099/0091.Decode-Ways.md" >}})|Medium| O(n)| O(n)||32.7%| +|0093|Restore IP Addresses|[Go]({{< relref "/ChapterFour/0001~0099/0093.Restore-IP-Addresses.md" >}})|Medium| O(n)| O(n)|❤️|47.4%| +|0097|Interleaving String|[Go]({{< relref "/ChapterFour/0001~0099/0097.Interleaving-String.md" >}})|Medium||||37.3%| +|0115|Distinct Subsequences|[Go]({{< relref "/ChapterFour/0100~0199/0115.Distinct-Subsequences.md" >}})|Hard||||44.4%| +|0125|Valid Palindrome|[Go]({{< relref "/ChapterFour/0100~0199/0125.Valid-Palindrome.md" >}})|Easy| O(n)| O(1)||44.3%| +|0126|Word Ladder II|[Go]({{< relref "/ChapterFour/0100~0199/0126.Word-Ladder-II.md" >}})|Hard| O(n)| O(n^2)|❤️|27.5%| +|0127|Word Ladder|[Go]({{< relref "/ChapterFour/0100~0199/0127.Word-Ladder.md" >}})|Hard||||37.1%| +|0131|Palindrome Partitioning|[Go]({{< relref "/ChapterFour/0100~0199/0131.Palindrome-Partitioning.md" >}})|Medium||||64.8%| +|0151|Reverse Words in a String|[Go]({{< relref "/ChapterFour/0100~0199/0151.Reverse-Words-in-a-String.md" >}})|Medium||||32.7%| +|0168|Excel Sheet Column Title|[Go]({{< relref "/ChapterFour/0100~0199/0168.Excel-Sheet-Column-Title.md" >}})|Easy||||35.5%| +|0171|Excel Sheet Column Number|[Go]({{< relref "/ChapterFour/0100~0199/0171.Excel-Sheet-Column-Number.md" >}})|Easy||||62.0%| +|0179|Largest Number|[Go]({{< relref "/ChapterFour/0100~0199/0179.Largest-Number.md" >}})|Medium||||34.5%| +|0187|Repeated DNA Sequences|[Go]({{< relref "/ChapterFour/0100~0199/0187.Repeated-DNA-Sequences.md" >}})|Medium||||46.9%| +|0205|Isomorphic Strings|[Go]({{< relref "/ChapterFour/0200~0299/0205.Isomorphic-Strings.md" >}})|Easy||||42.9%| +|0208|Implement Trie (Prefix Tree)|[Go]({{< relref "/ChapterFour/0200~0299/0208.Implement-Trie-Prefix-Tree.md" >}})|Medium||||62.7%| |0211|Design Add and Search Words Data Structure|[Go]({{< relref "/ChapterFour/0200~0299/0211.Design-Add-and-Search-Words-Data-Structure.md" >}})|Medium||||44.0%| -|0212|Word Search II|[Go]({{< relref "/ChapterFour/0200~0299/0212.Word-Search-II.md" >}})|Hard||||38.0%| -|0224|Basic Calculator|[Go]({{< relref "/ChapterFour/0200~0299/0224.Basic-Calculator.md" >}})|Hard||||40.5%| -|0227|Basic Calculator II|[Go]({{< relref "/ChapterFour/0200~0299/0227.Basic-Calculator-II.md" >}})|Medium||||41.6%| -|0242|Valid Anagram|[Go]({{< relref "/ChapterFour/0200~0299/0242.Valid-Anagram.md" >}})|Easy||||61.4%| -|0257|Binary Tree Paths|[Go]({{< relref "/ChapterFour/0200~0299/0257.Binary-Tree-Paths.md" >}})|Easy||||58.7%| -|0290|Word Pattern|[Go]({{< relref "/ChapterFour/0200~0299/0290.Word-Pattern.md" >}})|Easy||||40.2%| -|0297|Serialize and Deserialize Binary Tree|[Go]({{< relref "/ChapterFour/0200~0299/0297.Serialize-and-Deserialize-Binary-Tree.md" >}})|Hard||||53.8%| -|0299|Bulls and Cows|[Go]({{< relref "/ChapterFour/0200~0299/0299.Bulls-and-Cows.md" >}})|Medium||||47.2%| -|0301|Remove Invalid Parentheses|[Go]({{< relref "/ChapterFour/0300~0399/0301.Remove-Invalid-Parentheses.md" >}})|Hard||||46.9%| -|0306|Additive Number|[Go]({{< relref "/ChapterFour/0300~0399/0306.Additive-Number.md" >}})|Medium||||30.6%| -|0318|Maximum Product of Word Lengths|[Go]({{< relref "/ChapterFour/0300~0399/0318.Maximum-Product-of-Word-Lengths.md" >}})|Medium||||56.7%| -|0331|Verify Preorder Serialization of a Binary Tree|[Go]({{< relref "/ChapterFour/0300~0399/0331.Verify-Preorder-Serialization-of-a-Binary-Tree.md" >}})|Medium||||43.7%| -|0344|Reverse String|[Go]({{< relref "/ChapterFour/0300~0399/0344.Reverse-String.md" >}})|Easy| O(n)| O(1)||74.9%| -|0345|Reverse Vowels of a String|[Go]({{< relref "/ChapterFour/0300~0399/0345.Reverse-Vowels-of-a-String.md" >}})|Easy| O(n)| O(1)||47.0%| -|0383|Ransom Note|[Go]({{< relref "/ChapterFour/0300~0399/0383.Ransom-Note.md" >}})|Easy||||55.8%| -|0385|Mini Parser|[Go]({{< relref "/ChapterFour/0300~0399/0385.Mini-Parser.md" >}})|Medium||||35.9%| -|0387|First Unique Character in a String|[Go]({{< relref "/ChapterFour/0300~0399/0387.First-Unique-Character-in-a-String.md" >}})|Easy||||57.1%| -|0389|Find the Difference|[Go]({{< relref "/ChapterFour/0300~0399/0389.Find-the-Difference.md" >}})|Easy||||60.5%| -|0392|Is Subsequence|[Go]({{< relref "/ChapterFour/0300~0399/0392.Is-Subsequence.md" >}})|Easy||||51.0%| -|0394|Decode String|[Go]({{< relref "/ChapterFour/0300~0399/0394.Decode-String.md" >}})|Medium||||56.3%| -|0395|Longest Substring with At Least K Repeating Characters|[Go]({{< relref "/ChapterFour/0300~0399/0395.Longest-Substring-with-At-Least-K-Repeating-Characters.md" >}})|Medium||||44.6%| -|0402|Remove K Digits|[Go]({{< relref "/ChapterFour/0400~0499/0402.Remove-K-Digits.md" >}})|Medium||||30.5%| -|0409|Longest Palindrome|[Go]({{< relref "/ChapterFour/0400~0499/0409.Longest-Palindrome.md" >}})|Easy||||53.6%| -|0412|Fizz Buzz|[Go]({{< relref "/ChapterFour/0400~0499/0412.Fizz-Buzz.md" >}})|Easy||||66.7%| -|0423|Reconstruct Original Digits from English|[Go]({{< relref "/ChapterFour/0400~0499/0423.Reconstruct-Original-Digits-from-English.md" >}})|Medium||||51.2%| -|0424|Longest Repeating Character Replacement|[Go]({{< relref "/ChapterFour/0400~0499/0424.Longest-Repeating-Character-Replacement.md" >}})|Medium||||50.8%| -|0433|Minimum Genetic Mutation|[Go]({{< relref "/ChapterFour/0400~0499/0433.Minimum-Genetic-Mutation.md" >}})|Medium||||46.8%| -|0434|Number of Segments in a String|[Go]({{< relref "/ChapterFour/0400~0499/0434.Number-of-Segments-in-a-String.md" >}})|Easy||||37.9%| -|0438|Find All Anagrams in a String|[Go]({{< relref "/ChapterFour/0400~0499/0438.Find-All-Anagrams-in-a-String.md" >}})|Medium||||48.3%| -|0451|Sort Characters By Frequency|[Go]({{< relref "/ChapterFour/0400~0499/0451.Sort-Characters-By-Frequency.md" >}})|Medium||||67.8%| -|0474|Ones and Zeroes|[Go]({{< relref "/ChapterFour/0400~0499/0474.Ones-and-Zeroes.md" >}})|Medium||||44.6%| -|0488|Zuma Game|[Go]({{< relref "/ChapterFour/0400~0499/0488.Zuma-Game.md" >}})|Hard||||36.1%| -|0500|Keyboard Row|[Go]({{< relref "/ChapterFour/0500~0599/0500.Keyboard-Row.md" >}})|Easy||||68.0%| -|0520|Detect Capital|[Go]({{< relref "/ChapterFour/0500~0599/0520.Detect-Capital.md" >}})|Easy||||55.7%| -|0524|Longest Word in Dictionary through Deleting|[Go]({{< relref "/ChapterFour/0500~0599/0524.Longest-Word-in-Dictionary-through-Deleting.md" >}})|Medium||||50.9%| -|0535|Encode and Decode TinyURL|[Go]({{< relref "/ChapterFour/0500~0599/0535.Encode-and-Decode-TinyURL.md" >}})|Medium||||85.4%| -|0537|Complex Number Multiplication|[Go]({{< relref "/ChapterFour/0500~0599/0537.Complex-Number-Multiplication.md" >}})|Medium||||71.1%| -|0541|Reverse String II|[Go]({{< relref "/ChapterFour/0500~0599/0541.Reverse-String-II.md" >}})|Easy||||50.2%| -|0551|Student Attendance Record I|[Go]({{< relref "/ChapterFour/0500~0599/0551.Student-Attendance-Record-I.md" >}})|Easy||||47.6%| -|0557|Reverse Words in a String III|[Go]({{< relref "/ChapterFour/0500~0599/0557.Reverse-Words-in-a-String-III.md" >}})|Easy||||78.7%| -|0567|Permutation in String|[Go]({{< relref "/ChapterFour/0500~0599/0567.Permutation-in-String.md" >}})|Medium||||44.7%| -|0583|Delete Operation for Two Strings|[Go]({{< relref "/ChapterFour/0500~0599/0583.Delete-Operation-for-Two-Strings.md" >}})|Medium||||55.8%| -|0599|Minimum Index Sum of Two Lists|[Go]({{< relref "/ChapterFour/0500~0599/0599.Minimum-Index-Sum-of-Two-Lists.md" >}})|Easy||||52.8%| -|0609|Find Duplicate File in System|[Go]({{< relref "/ChapterFour/0600~0699/0609.Find-Duplicate-File-in-System.md" >}})|Medium||||63.8%| -|0647|Palindromic Substrings|[Go]({{< relref "/ChapterFour/0600~0699/0647.Palindromic-Substrings.md" >}})|Medium||||64.6%| -|0648|Replace Words|[Go]({{< relref "/ChapterFour/0600~0699/0648.Replace-Words.md" >}})|Medium||||62.0%| -|0676|Implement Magic Dictionary|[Go]({{< relref "/ChapterFour/0600~0699/0676.Implement-Magic-Dictionary.md" >}})|Medium||||56.6%| -|0677|Map Sum Pairs|[Go]({{< relref "/ChapterFour/0600~0699/0677.Map-Sum-Pairs.md" >}})|Medium||||57.0%| -|0692|Top K Frequent Words|[Go]({{< relref "/ChapterFour/0600~0699/0692.Top-K-Frequent-Words.md" >}})|Medium||||54.4%| -|0696|Count Binary Substrings|[Go]({{< relref "/ChapterFour/0600~0699/0696.Count-Binary-Substrings.md" >}})|Easy||||64.9%| -|0709|To Lower Case|[Go]({{< relref "/ChapterFour/0700~0799/0709.To-Lower-Case.md" >}})|Easy||||81.4%| -|0720|Longest Word in Dictionary|[Go]({{< relref "/ChapterFour/0700~0799/0720.Longest-Word-in-Dictionary.md" >}})|Medium||||51.0%| -|0721|Accounts Merge|[Go]({{< relref "/ChapterFour/0700~0799/0721.Accounts-Merge.md" >}})|Medium||||55.9%| -|0726|Number of Atoms|[Go]({{< relref "/ChapterFour/0700~0799/0726.Number-of-Atoms.md" >}})|Hard||||51.7%| -|0745|Prefix and Suffix Search|[Go]({{< relref "/ChapterFour/0700~0799/0745.Prefix-and-Suffix-Search.md" >}})|Hard||||36.5%| -|0748|Shortest Completing Word|[Go]({{< relref "/ChapterFour/0700~0799/0748.Shortest-Completing-Word.md" >}})|Easy||||58.9%| -|0752|Open the Lock|[Go]({{< relref "/ChapterFour/0700~0799/0752.Open-the-Lock.md" >}})|Medium||||55.3%| -|0763|Partition Labels|[Go]({{< relref "/ChapterFour/0700~0799/0763.Partition-Labels.md" >}})|Medium||||79.6%| -|0767|Reorganize String|[Go]({{< relref "/ChapterFour/0700~0799/0767.Reorganize-String.md" >}})|Medium| O(n log n)| O(log n) |❤️|52.1%| -|0771|Jewels and Stones|[Go]({{< relref "/ChapterFour/0700~0799/0771.Jewels-and-Stones.md" >}})|Easy||||87.7%| -|0784|Letter Case Permutation|[Go]({{< relref "/ChapterFour/0700~0799/0784.Letter-Case-Permutation.md" >}})|Medium||||72.4%| -|0791|Custom Sort String|[Go]({{< relref "/ChapterFour/0700~0799/0791.Custom-Sort-String.md" >}})|Medium||||69.2%| -|0792|Number of Matching Subsequences|[Go]({{< relref "/ChapterFour/0700~0799/0792.Number-of-Matching-Subsequences.md" >}})|Medium||||50.5%| -|0794|Valid Tic-Tac-Toe State|[Go]({{< relref "/ChapterFour/0700~0799/0794.Valid-Tic-Tac-Toe-State.md" >}})|Medium||||35.2%| -|0811|Subdomain Visit Count|[Go]({{< relref "/ChapterFour/0800~0899/0811.Subdomain-Visit-Count.md" >}})|Medium||||74.2%| -|0816|Ambiguous Coordinates|[Go]({{< relref "/ChapterFour/0800~0899/0816.Ambiguous-Coordinates.md" >}})|Medium||||55.9%| -|0819|Most Common Word|[Go]({{< relref "/ChapterFour/0800~0899/0819.Most-Common-Word.md" >}})|Easy||||45.2%| -|0820|Short Encoding of Words|[Go]({{< relref "/ChapterFour/0800~0899/0820.Short-Encoding-of-Words.md" >}})|Medium||||55.3%| -|0821|Shortest Distance to a Character|[Go]({{< relref "/ChapterFour/0800~0899/0821.Shortest-Distance-to-a-Character.md" >}})|Easy||||71.0%| -|0828|Count Unique Characters of All Substrings of a Given String|[Go]({{< relref "/ChapterFour/0800~0899/0828.Count-Unique-Characters-of-All-Substrings-of-a-Given-String.md" >}})|Hard||||49.9%| -|0830|Positions of Large Groups|[Go]({{< relref "/ChapterFour/0800~0899/0830.Positions-of-Large-Groups.md" >}})|Easy||||51.4%| -|0838|Push Dominoes|[Go]({{< relref "/ChapterFour/0800~0899/0838.Push-Dominoes.md" >}})|Medium||||52.3%| -|0839|Similar String Groups|[Go]({{< relref "/ChapterFour/0800~0899/0839.Similar-String-Groups.md" >}})|Hard||||45.5%| -|0842|Split Array into Fibonacci Sequence|[Go]({{< relref "/ChapterFour/0800~0899/0842.Split-Array-into-Fibonacci-Sequence.md" >}})|Medium| O(n^2)| O(1)|❤️|37.8%| -|0844|Backspace String Compare|[Go]({{< relref "/ChapterFour/0800~0899/0844.Backspace-String-Compare.md" >}})|Easy||||48.0%| -|0856|Score of Parentheses|[Go]({{< relref "/ChapterFour/0800~0899/0856.Score-of-Parentheses.md" >}})|Medium| O(n)| O(n)||65.4%| -|0859|Buddy Strings|[Go]({{< relref "/ChapterFour/0800~0899/0859.Buddy-Strings.md" >}})|Easy||||28.8%| +|0212|Word Search II|[Go]({{< relref "/ChapterFour/0200~0299/0212.Word-Search-II.md" >}})|Hard||||36.4%| +|0224|Basic Calculator|[Go]({{< relref "/ChapterFour/0200~0299/0224.Basic-Calculator.md" >}})|Hard||||42.4%| +|0227|Basic Calculator II|[Go]({{< relref "/ChapterFour/0200~0299/0227.Basic-Calculator-II.md" >}})|Medium||||42.4%| +|0242|Valid Anagram|[Go]({{< relref "/ChapterFour/0200~0299/0242.Valid-Anagram.md" >}})|Easy||||63.0%| +|0257|Binary Tree Paths|[Go]({{< relref "/ChapterFour/0200~0299/0257.Binary-Tree-Paths.md" >}})|Easy||||61.4%| +|0290|Word Pattern|[Go]({{< relref "/ChapterFour/0200~0299/0290.Word-Pattern.md" >}})|Easy||||41.7%| +|0297|Serialize and Deserialize Binary Tree|[Go]({{< relref "/ChapterFour/0200~0299/0297.Serialize-and-Deserialize-Binary-Tree.md" >}})|Hard||||55.4%| +|0299|Bulls and Cows|[Go]({{< relref "/ChapterFour/0200~0299/0299.Bulls-and-Cows.md" >}})|Medium||||49.4%| +|0301|Remove Invalid Parentheses|[Go]({{< relref "/ChapterFour/0300~0399/0301.Remove-Invalid-Parentheses.md" >}})|Hard||||47.2%| +|0306|Additive Number|[Go]({{< relref "/ChapterFour/0300~0399/0306.Additive-Number.md" >}})|Medium||||31.1%| +|0318|Maximum Product of Word Lengths|[Go]({{< relref "/ChapterFour/0300~0399/0318.Maximum-Product-of-Word-Lengths.md" >}})|Medium||||59.9%| +|0331|Verify Preorder Serialization of a Binary Tree|[Go]({{< relref "/ChapterFour/0300~0399/0331.Verify-Preorder-Serialization-of-a-Binary-Tree.md" >}})|Medium||||44.6%| +|0344|Reverse String|[Go]({{< relref "/ChapterFour/0300~0399/0344.Reverse-String.md" >}})|Easy| O(n)| O(1)||76.7%| +|0345|Reverse Vowels of a String|[Go]({{< relref "/ChapterFour/0300~0399/0345.Reverse-Vowels-of-a-String.md" >}})|Easy| O(n)| O(1)||50.1%| +|0383|Ransom Note|[Go]({{< relref "/ChapterFour/0300~0399/0383.Ransom-Note.md" >}})|Easy||||58.2%| +|0385|Mini Parser|[Go]({{< relref "/ChapterFour/0300~0399/0385.Mini-Parser.md" >}})|Medium||||36.9%| +|0387|First Unique Character in a String|[Go]({{< relref "/ChapterFour/0300~0399/0387.First-Unique-Character-in-a-String.md" >}})|Easy||||59.6%| +|0389|Find the Difference|[Go]({{< relref "/ChapterFour/0300~0399/0389.Find-the-Difference.md" >}})|Easy||||59.9%| +|0392|Is Subsequence|[Go]({{< relref "/ChapterFour/0300~0399/0392.Is-Subsequence.md" >}})|Easy||||47.6%| +|0394|Decode String|[Go]({{< relref "/ChapterFour/0300~0399/0394.Decode-String.md" >}})|Medium||||57.9%| +|0395|Longest Substring with At Least K Repeating Characters|[Go]({{< relref "/ChapterFour/0300~0399/0395.Longest-Substring-with-At-Least-K-Repeating-Characters.md" >}})|Medium||||44.8%| +|0402|Remove K Digits|[Go]({{< relref "/ChapterFour/0400~0499/0402.Remove-K-Digits.md" >}})|Medium||||30.6%| +|0409|Longest Palindrome|[Go]({{< relref "/ChapterFour/0400~0499/0409.Longest-Palindrome.md" >}})|Easy||||54.2%| +|0412|Fizz Buzz|[Go]({{< relref "/ChapterFour/0400~0499/0412.Fizz-Buzz.md" >}})|Easy||||69.9%| +|0423|Reconstruct Original Digits from English|[Go]({{< relref "/ChapterFour/0400~0499/0423.Reconstruct-Original-Digits-from-English.md" >}})|Medium||||51.3%| +|0424|Longest Repeating Character Replacement|[Go]({{< relref "/ChapterFour/0400~0499/0424.Longest-Repeating-Character-Replacement.md" >}})|Medium||||51.9%| +|0433|Minimum Genetic Mutation|[Go]({{< relref "/ChapterFour/0400~0499/0433.Minimum-Genetic-Mutation.md" >}})|Medium||||52.3%| +|0434|Number of Segments in a String|[Go]({{< relref "/ChapterFour/0400~0499/0434.Number-of-Segments-in-a-String.md" >}})|Easy||||37.2%| +|0438|Find All Anagrams in a String|[Go]({{< relref "/ChapterFour/0400~0499/0438.Find-All-Anagrams-in-a-String.md" >}})|Medium||||50.2%| +|0451|Sort Characters By Frequency|[Go]({{< relref "/ChapterFour/0400~0499/0451.Sort-Characters-By-Frequency.md" >}})|Medium||||70.1%| +|0474|Ones and Zeroes|[Go]({{< relref "/ChapterFour/0400~0499/0474.Ones-and-Zeroes.md" >}})|Medium||||46.8%| +|0488|Zuma Game|[Go]({{< relref "/ChapterFour/0400~0499/0488.Zuma-Game.md" >}})|Hard||||33.9%| +|0500|Keyboard Row|[Go]({{< relref "/ChapterFour/0500~0599/0500.Keyboard-Row.md" >}})|Easy||||69.5%| +|0520|Detect Capital|[Go]({{< relref "/ChapterFour/0500~0599/0520.Detect-Capital.md" >}})|Easy||||57.0%| +|0524|Longest Word in Dictionary through Deleting|[Go]({{< relref "/ChapterFour/0500~0599/0524.Longest-Word-in-Dictionary-through-Deleting.md" >}})|Medium||||51.0%| +|0535|Encode and Decode TinyURL|[Go]({{< relref "/ChapterFour/0500~0599/0535.Encode-and-Decode-TinyURL.md" >}})|Medium||||85.9%| +|0537|Complex Number Multiplication|[Go]({{< relref "/ChapterFour/0500~0599/0537.Complex-Number-Multiplication.md" >}})|Medium||||71.4%| +|0541|Reverse String II|[Go]({{< relref "/ChapterFour/0500~0599/0541.Reverse-String-II.md" >}})|Easy||||50.5%| +|0551|Student Attendance Record I|[Go]({{< relref "/ChapterFour/0500~0599/0551.Student-Attendance-Record-I.md" >}})|Easy||||48.2%| +|0557|Reverse Words in a String III|[Go]({{< relref "/ChapterFour/0500~0599/0557.Reverse-Words-in-a-String-III.md" >}})|Easy||||81.9%| +|0567|Permutation in String|[Go]({{< relref "/ChapterFour/0500~0599/0567.Permutation-in-String.md" >}})|Medium||||44.3%| +|0583|Delete Operation for Two Strings|[Go]({{< relref "/ChapterFour/0500~0599/0583.Delete-Operation-for-Two-Strings.md" >}})|Medium||||59.8%| +|0599|Minimum Index Sum of Two Lists|[Go]({{< relref "/ChapterFour/0500~0599/0599.Minimum-Index-Sum-of-Two-Lists.md" >}})|Easy||||53.4%| +|0609|Find Duplicate File in System|[Go]({{< relref "/ChapterFour/0600~0699/0609.Find-Duplicate-File-in-System.md" >}})|Medium||||67.7%| +|0647|Palindromic Substrings|[Go]({{< relref "/ChapterFour/0600~0699/0647.Palindromic-Substrings.md" >}})|Medium||||66.8%| +|0648|Replace Words|[Go]({{< relref "/ChapterFour/0600~0699/0648.Replace-Words.md" >}})|Medium||||62.7%| +|0676|Implement Magic Dictionary|[Go]({{< relref "/ChapterFour/0600~0699/0676.Implement-Magic-Dictionary.md" >}})|Medium||||57.0%| +|0677|Map Sum Pairs|[Go]({{< relref "/ChapterFour/0600~0699/0677.Map-Sum-Pairs.md" >}})|Medium||||56.8%| +|0692|Top K Frequent Words|[Go]({{< relref "/ChapterFour/0600~0699/0692.Top-K-Frequent-Words.md" >}})|Medium||||57.2%| +|0696|Count Binary Substrings|[Go]({{< relref "/ChapterFour/0600~0699/0696.Count-Binary-Substrings.md" >}})|Easy||||65.5%| +|0709|To Lower Case|[Go]({{< relref "/ChapterFour/0700~0799/0709.To-Lower-Case.md" >}})|Easy||||82.4%| +|0720|Longest Word in Dictionary|[Go]({{< relref "/ChapterFour/0700~0799/0720.Longest-Word-in-Dictionary.md" >}})|Medium||||52.0%| +|0721|Accounts Merge|[Go]({{< relref "/ChapterFour/0700~0799/0721.Accounts-Merge.md" >}})|Medium||||56.3%| +|0726|Number of Atoms|[Go]({{< relref "/ChapterFour/0700~0799/0726.Number-of-Atoms.md" >}})|Hard||||52.1%| +|0745|Prefix and Suffix Search|[Go]({{< relref "/ChapterFour/0700~0799/0745.Prefix-and-Suffix-Search.md" >}})|Hard||||41.2%| +|0748|Shortest Completing Word|[Go]({{< relref "/ChapterFour/0700~0799/0748.Shortest-Completing-Word.md" >}})|Easy||||59.3%| +|0752|Open the Lock|[Go]({{< relref "/ChapterFour/0700~0799/0752.Open-the-Lock.md" >}})|Medium||||55.6%| +|0763|Partition Labels|[Go]({{< relref "/ChapterFour/0700~0799/0763.Partition-Labels.md" >}})|Medium||||79.7%| +|0767|Reorganize String|[Go]({{< relref "/ChapterFour/0700~0799/0767.Reorganize-String.md" >}})|Medium| O(n log n)| O(log n) |❤️|52.9%| +|0771|Jewels and Stones|[Go]({{< relref "/ChapterFour/0700~0799/0771.Jewels-and-Stones.md" >}})|Easy||||88.2%| +|0784|Letter Case Permutation|[Go]({{< relref "/ChapterFour/0700~0799/0784.Letter-Case-Permutation.md" >}})|Medium||||73.8%| +|0791|Custom Sort String|[Go]({{< relref "/ChapterFour/0700~0799/0791.Custom-Sort-String.md" >}})|Medium||||69.1%| +|0792|Number of Matching Subsequences|[Go]({{< relref "/ChapterFour/0700~0799/0792.Number-of-Matching-Subsequences.md" >}})|Medium||||51.6%| +|0794|Valid Tic-Tac-Toe State|[Go]({{< relref "/ChapterFour/0700~0799/0794.Valid-Tic-Tac-Toe-State.md" >}})|Medium||||35.1%| +|0811|Subdomain Visit Count|[Go]({{< relref "/ChapterFour/0800~0899/0811.Subdomain-Visit-Count.md" >}})|Medium||||75.5%| +|0816|Ambiguous Coordinates|[Go]({{< relref "/ChapterFour/0800~0899/0816.Ambiguous-Coordinates.md" >}})|Medium||||56.3%| +|0819|Most Common Word|[Go]({{< relref "/ChapterFour/0800~0899/0819.Most-Common-Word.md" >}})|Easy||||44.8%| +|0820|Short Encoding of Words|[Go]({{< relref "/ChapterFour/0800~0899/0820.Short-Encoding-of-Words.md" >}})|Medium||||60.6%| +|0821|Shortest Distance to a Character|[Go]({{< relref "/ChapterFour/0800~0899/0821.Shortest-Distance-to-a-Character.md" >}})|Easy||||71.3%| +|0828|Count Unique Characters of All Substrings of a Given String|[Go]({{< relref "/ChapterFour/0800~0899/0828.Count-Unique-Characters-of-All-Substrings-of-a-Given-String.md" >}})|Hard||||51.6%| +|0830|Positions of Large Groups|[Go]({{< relref "/ChapterFour/0800~0899/0830.Positions-of-Large-Groups.md" >}})|Easy||||51.8%| +|0838|Push Dominoes|[Go]({{< relref "/ChapterFour/0800~0899/0838.Push-Dominoes.md" >}})|Medium||||57.0%| +|0839|Similar String Groups|[Go]({{< relref "/ChapterFour/0800~0899/0839.Similar-String-Groups.md" >}})|Hard||||48.0%| +|0842|Split Array into Fibonacci Sequence|[Go]({{< relref "/ChapterFour/0800~0899/0842.Split-Array-into-Fibonacci-Sequence.md" >}})|Medium| O(n^2)| O(1)|❤️|38.4%| +|0844|Backspace String Compare|[Go]({{< relref "/ChapterFour/0800~0899/0844.Backspace-String-Compare.md" >}})|Easy||||48.1%| +|0856|Score of Parentheses|[Go]({{< relref "/ChapterFour/0800~0899/0856.Score-of-Parentheses.md" >}})|Medium| O(n)| O(n)||64.8%| +|0859|Buddy Strings|[Go]({{< relref "/ChapterFour/0800~0899/0859.Buddy-Strings.md" >}})|Easy||||29.2%| |0880|Decoded String at Index|[Go]({{< relref "/ChapterFour/0800~0899/0880.Decoded-String-at-Index.md" >}})|Medium||||28.3%| -|0884|Uncommon Words from Two Sentences|[Go]({{< relref "/ChapterFour/0800~0899/0884.Uncommon-Words-from-Two-Sentences.md" >}})|Easy||||65.6%| -|0890|Find and Replace Pattern|[Go]({{< relref "/ChapterFour/0800~0899/0890.Find-and-Replace-Pattern.md" >}})|Medium||||75.6%| -|0916|Word Subsets|[Go]({{< relref "/ChapterFour/0900~0999/0916.Word-Subsets.md" >}})|Medium||||52.6%| -|0921|Minimum Add to Make Parentheses Valid|[Go]({{< relref "/ChapterFour/0900~0999/0921.Minimum-Add-to-Make-Parentheses-Valid.md" >}})|Medium||||77.1%| -|0925|Long Pressed Name|[Go]({{< relref "/ChapterFour/0900~0999/0925.Long-Pressed-Name.md" >}})|Easy| O(n)| O(1)||34.6%| -|0942|DI String Match|[Go]({{< relref "/ChapterFour/0900~0999/0942.DI-String-Match.md" >}})|Easy||||75.9%| -|0949|Largest Time for Given Digits|[Go]({{< relref "/ChapterFour/0900~0999/0949.Largest-Time-for-Given-Digits.md" >}})|Medium||||35.4%| -|0953|Verifying an Alien Dictionary|[Go]({{< relref "/ChapterFour/0900~0999/0953.Verifying-an-Alien-Dictionary.md" >}})|Easy||||52.5%| -|0966|Vowel Spellchecker|[Go]({{< relref "/ChapterFour/0900~0999/0966.Vowel-Spellchecker.md" >}})|Medium||||51.6%| -|0981|Time Based Key-Value Store|[Go]({{< relref "/ChapterFour/0900~0999/0981.Time-Based-Key-Value-Store.md" >}})|Medium||||52.7%| -|0984|String Without AAA or BBB|[Go]({{< relref "/ChapterFour/0900~0999/0984.String-Without-AAA-or-BBB.md" >}})|Medium||||42.3%| -|0990|Satisfiability of Equality Equations|[Go]({{< relref "/ChapterFour/0900~0999/0990.Satisfiability-of-Equality-Equations.md" >}})|Medium||||50.1%| -|1002|Find Common Characters|[Go]({{< relref "/ChapterFour/1000~1099/1002.Find-Common-Characters.md" >}})|Easy||||68.4%| -|1003|Check If Word Is Valid After Substitutions|[Go]({{< relref "/ChapterFour/1000~1099/1003.Check-If-Word-Is-Valid-After-Substitutions.md" >}})|Medium| O(n)| O(1)||57.9%| -|1021|Remove Outermost Parentheses|[Go]({{< relref "/ChapterFour/1000~1099/1021.Remove-Outermost-Parentheses.md" >}})|Easy||||79.8%| -|1028|Recover a Tree From Preorder Traversal|[Go]({{< relref "/ChapterFour/1000~1099/1028.Recover-a-Tree-From-Preorder-Traversal.md" >}})|Hard||||72.4%| -|1047|Remove All Adjacent Duplicates In String|[Go]({{< relref "/ChapterFour/1000~1099/1047.Remove-All-Adjacent-Duplicates-In-String.md" >}})|Easy||||70.9%| -|1048|Longest String Chain|[Go]({{< relref "/ChapterFour/1000~1099/1048.Longest-String-Chain.md" >}})|Medium||||57.8%| -|1078|Occurrences After Bigram|[Go]({{< relref "/ChapterFour/1000~1099/1078.Occurrences-After-Bigram.md" >}})|Easy||||64.2%| -|1079|Letter Tile Possibilities|[Go]({{< relref "/ChapterFour/1000~1099/1079.Letter-Tile-Possibilities.md" >}})|Medium||||76.1%| -|1108|Defanging an IP Address|[Go]({{< relref "/ChapterFour/1100~1199/1108.Defanging-an-IP-Address.md" >}})|Easy||||89.0%| -|1111|Maximum Nesting Depth of Two Valid Parentheses Strings|[Go]({{< relref "/ChapterFour/1100~1199/1111.Maximum-Nesting-Depth-of-Two-Valid-Parentheses-Strings.md" >}})|Medium||||73.2%| -|1143|Longest Common Subsequence|[Go]({{< relref "/ChapterFour/1100~1199/1143.Longest-Common-Subsequence.md" >}})|Medium||||58.9%| -|1154|Day of the Year|[Go]({{< relref "/ChapterFour/1100~1199/1154.Day-of-the-Year.md" >}})|Easy||||50.9%| -|1160|Find Words That Can Be Formed by Characters|[Go]({{< relref "/ChapterFour/1100~1199/1160.Find-Words-That-Can-Be-Formed-by-Characters.md" >}})|Easy||||67.7%| -|1170|Compare Strings by Frequency of the Smallest Character|[Go]({{< relref "/ChapterFour/1100~1199/1170.Compare-Strings-by-Frequency-of-the-Smallest-Character.md" >}})|Medium||||61.1%| -|1178|Number of Valid Words for Each Puzzle|[Go]({{< relref "/ChapterFour/1100~1199/1178.Number-of-Valid-Words-for-Each-Puzzle.md" >}})|Hard||||46.8%| -|1189|Maximum Number of Balloons|[Go]({{< relref "/ChapterFour/1100~1199/1189.Maximum-Number-of-Balloons.md" >}})|Easy||||62.5%| -|1190|Reverse Substrings Between Each Pair of Parentheses|[Go]({{< relref "/ChapterFour/1100~1199/1190.Reverse-Substrings-Between-Each-Pair-of-Parentheses.md" >}})|Medium||||65.7%| -|1202|Smallest String With Swaps|[Go]({{< relref "/ChapterFour/1200~1299/1202.Smallest-String-With-Swaps.md" >}})|Medium||||57.1%| -|1208|Get Equal Substrings Within Budget|[Go]({{< relref "/ChapterFour/1200~1299/1208.Get-Equal-Substrings-Within-Budget.md" >}})|Medium||||46.5%| -|1209|Remove All Adjacent Duplicates in String II|[Go]({{< relref "/ChapterFour/1200~1299/1209.Remove-All-Adjacent-Duplicates-in-String-II.md" >}})|Medium||||55.9%| -|1221|Split a String in Balanced Strings|[Go]({{< relref "/ChapterFour/1200~1299/1221.Split-a-String-in-Balanced-Strings.md" >}})|Easy||||84.6%| -|1234|Replace the Substring for Balanced String|[Go]({{< relref "/ChapterFour/1200~1299/1234.Replace-the-Substring-for-Balanced-String.md" >}})|Medium||||36.2%| -|1239|Maximum Length of a Concatenated String with Unique Characters|[Go]({{< relref "/ChapterFour/1200~1299/1239.Maximum-Length-of-a-Concatenated-String-with-Unique-Characters.md" >}})|Medium||||50.5%| -|1249|Minimum Remove to Make Valid Parentheses|[Go]({{< relref "/ChapterFour/1200~1299/1249.Minimum-Remove-to-Make-Valid-Parentheses.md" >}})|Medium||||65.7%| -|1268|Search Suggestions System|[Go]({{< relref "/ChapterFour/1200~1299/1268.Search-Suggestions-System.md" >}})|Medium||||65.3%| -|1332|Remove Palindromic Subsequences|[Go]({{< relref "/ChapterFour/1300~1399/1332.Remove-Palindromic-Subsequences.md" >}})|Easy||||69.6%| -|1396|Design Underground System|[Go]({{< relref "/ChapterFour/1300~1399/1396.Design-Underground-System.md" >}})|Medium||||73.5%| -|1446|Consecutive Characters|[Go]({{< relref "/ChapterFour/1400~1499/1446.Consecutive-Characters.md" >}})|Easy||||62.0%| -|1455|Check If a Word Occurs As a Prefix of Any Word in a Sentence|[Go]({{< relref "/ChapterFour/1400~1499/1455.Check-If-a-Word-Occurs-As-a-Prefix-of-Any-Word-in-a-Sentence.md" >}})|Easy||||64.5%| -|1461|Check If a String Contains All Binary Codes of Size K|[Go]({{< relref "/ChapterFour/1400~1499/1461.Check-If-a-String-Contains-All-Binary-Codes-of-Size-K.md" >}})|Medium||||54.5%| -|1573|Number of Ways to Split a String|[Go]({{< relref "/ChapterFour/1500~1599/1573.Number-of-Ways-to-Split-a-String.md" >}})|Medium||||32.1%| -|1576|Replace All ?'s to Avoid Consecutive Repeating Characters|[Go]({{< relref "/ChapterFour/1500~1599/1576.Replace-All-s-to-Avoid-Consecutive-Repeating-Characters.md" >}})|Easy||||49.7%| -|1614|Maximum Nesting Depth of the Parentheses|[Go]({{< relref "/ChapterFour/1600~1699/1614.Maximum-Nesting-Depth-of-the-Parentheses.md" >}})|Easy||||82.9%| -|1624|Largest Substring Between Two Equal Characters|[Go]({{< relref "/ChapterFour/1600~1699/1624.Largest-Substring-Between-Two-Equal-Characters.md" >}})|Easy||||59.3%| -|1629|Slowest Key|[Go]({{< relref "/ChapterFour/1600~1699/1629.Slowest-Key.md" >}})|Easy||||59.6%| -|1647|Minimum Deletions to Make Character Frequencies Unique|[Go]({{< relref "/ChapterFour/1600~1699/1647.Minimum-Deletions-to-Make-Character-Frequencies-Unique.md" >}})|Medium||||56.5%| -|1653|Minimum Deletions to Make String Balanced|[Go]({{< relref "/ChapterFour/1600~1699/1653.Minimum-Deletions-to-Make-String-Balanced.md" >}})|Medium||||56.6%| -|1657|Determine if Two Strings Are Close|[Go]({{< relref "/ChapterFour/1600~1699/1657.Determine-if-Two-Strings-Are-Close.md" >}})|Medium||||54.5%| -|1662|Check If Two String Arrays are Equivalent|[Go]({{< relref "/ChapterFour/1600~1699/1662.Check-If-Two-String-Arrays-are-Equivalent.md" >}})|Easy||||82.0%| -|1663|Smallest String With A Given Numeric Value|[Go]({{< relref "/ChapterFour/1600~1699/1663.Smallest-String-With-A-Given-Numeric-Value.md" >}})|Medium||||67.0%| -|1668|Maximum Repeating Substring|[Go]({{< relref "/ChapterFour/1600~1699/1668.Maximum-Repeating-Substring.md" >}})|Easy||||39.6%| -|1678|Goal Parser Interpretation|[Go]({{< relref "/ChapterFour/1600~1699/1678.Goal-Parser-Interpretation.md" >}})|Easy||||85.8%| -|1684|Count the Number of Consistent Strings|[Go]({{< relref "/ChapterFour/1600~1699/1684.Count-the-Number-of-Consistent-Strings.md" >}})|Easy||||81.8%| -|1689|Partitioning Into Minimum Number Of Deci-Binary Numbers|[Go]({{< relref "/ChapterFour/1600~1699/1689.Partitioning-Into-Minimum-Number-Of-Deci-Binary-Numbers.md" >}})|Medium||||87.8%| -|1694|Reformat Phone Number|[Go]({{< relref "/ChapterFour/1600~1699/1694.Reformat-Phone-Number.md" >}})|Easy||||64.9%| -|1704|Determine if String Halves Are Alike|[Go]({{< relref "/ChapterFour/1700~1799/1704.Determine-if-String-Halves-Are-Alike.md" >}})|Easy||||78.0%| -|1736|Latest Time by Replacing Hidden Digits|[Go]({{< relref "/ChapterFour/1700~1799/1736.Latest-Time-by-Replacing-Hidden-Digits.md" >}})|Easy||||42.1%| -|1758|Minimum Changes To Make Alternating Binary String|[Go]({{< relref "/ChapterFour/1700~1799/1758.Minimum-Changes-To-Make-Alternating-Binary-String.md" >}})|Easy||||59.2%| -|1763|Longest Nice Substring|[Go]({{< relref "/ChapterFour/1700~1799/1763.Longest-Nice-Substring.md" >}})|Easy||||61.8%| -|1816|Truncate Sentence|[Go]({{< relref "/ChapterFour/1800~1899/1816.Truncate-Sentence.md" >}})|Easy||||81.3%| -|2167|Minimum Time to Remove All Cars Containing Illegal Goods|[Go]({{< relref "/ChapterFour/2100~2199/2167.Minimum-Time-to-Remove-All-Cars-Containing-Illegal-Goods.md" >}})|Hard||||39.1%| -|2182|Construct String With Repeat Limit|[Go]({{< relref "/ChapterFour/2100~2199/2182.Construct-String-With-Repeat-Limit.md" >}})|Medium||||51.1%| +|0884|Uncommon Words from Two Sentences|[Go]({{< relref "/ChapterFour/0800~0899/0884.Uncommon-Words-from-Two-Sentences.md" >}})|Easy||||66.3%| +|0890|Find and Replace Pattern|[Go]({{< relref "/ChapterFour/0800~0899/0890.Find-and-Replace-Pattern.md" >}})|Medium||||77.6%| +|0916|Word Subsets|[Go]({{< relref "/ChapterFour/0900~0999/0916.Word-Subsets.md" >}})|Medium||||53.7%| +|0921|Minimum Add to Make Parentheses Valid|[Go]({{< relref "/ChapterFour/0900~0999/0921.Minimum-Add-to-Make-Parentheses-Valid.md" >}})|Medium||||75.8%| +|0925|Long Pressed Name|[Go]({{< relref "/ChapterFour/0900~0999/0925.Long-Pressed-Name.md" >}})|Easy| O(n)| O(1)||33.1%| +|0942|DI String Match|[Go]({{< relref "/ChapterFour/0900~0999/0942.DI-String-Match.md" >}})|Easy||||77.3%| +|0949|Largest Time for Given Digits|[Go]({{< relref "/ChapterFour/0900~0999/0949.Largest-Time-for-Given-Digits.md" >}})|Medium||||35.2%| +|0953|Verifying an Alien Dictionary|[Go]({{< relref "/ChapterFour/0900~0999/0953.Verifying-an-Alien-Dictionary.md" >}})|Easy||||54.5%| +|0966|Vowel Spellchecker|[Go]({{< relref "/ChapterFour/0900~0999/0966.Vowel-Spellchecker.md" >}})|Medium||||51.4%| +|0981|Time Based Key-Value Store|[Go]({{< relref "/ChapterFour/0900~0999/0981.Time-Based-Key-Value-Store.md" >}})|Medium||||52.3%| +|0984|String Without AAA or BBB|[Go]({{< relref "/ChapterFour/0900~0999/0984.String-Without-AAA-or-BBB.md" >}})|Medium||||43.1%| +|0990|Satisfiability of Equality Equations|[Go]({{< relref "/ChapterFour/0900~0999/0990.Satisfiability-of-Equality-Equations.md" >}})|Medium||||50.5%| +|1002|Find Common Characters|[Go]({{< relref "/ChapterFour/1000~1099/1002.Find-Common-Characters.md" >}})|Easy||||68.5%| +|1003|Check If Word Is Valid After Substitutions|[Go]({{< relref "/ChapterFour/1000~1099/1003.Check-If-Word-Is-Valid-After-Substitutions.md" >}})|Medium| O(n)| O(1)||58.2%| +|1021|Remove Outermost Parentheses|[Go]({{< relref "/ChapterFour/1000~1099/1021.Remove-Outermost-Parentheses.md" >}})|Easy||||80.6%| +|1028|Recover a Tree From Preorder Traversal|[Go]({{< relref "/ChapterFour/1000~1099/1028.Recover-a-Tree-From-Preorder-Traversal.md" >}})|Hard||||73.3%| +|1047|Remove All Adjacent Duplicates In String|[Go]({{< relref "/ChapterFour/1000~1099/1047.Remove-All-Adjacent-Duplicates-In-String.md" >}})|Easy||||69.7%| +|1048|Longest String Chain|[Go]({{< relref "/ChapterFour/1000~1099/1048.Longest-String-Chain.md" >}})|Medium||||59.2%| +|1078|Occurrences After Bigram|[Go]({{< relref "/ChapterFour/1000~1099/1078.Occurrences-After-Bigram.md" >}})|Easy||||63.6%| +|1079|Letter Tile Possibilities|[Go]({{< relref "/ChapterFour/1000~1099/1079.Letter-Tile-Possibilities.md" >}})|Medium||||76.0%| +|1108|Defanging an IP Address|[Go]({{< relref "/ChapterFour/1100~1199/1108.Defanging-an-IP-Address.md" >}})|Easy||||89.1%| +|1111|Maximum Nesting Depth of Two Valid Parentheses Strings|[Go]({{< relref "/ChapterFour/1100~1199/1111.Maximum-Nesting-Depth-of-Two-Valid-Parentheses-Strings.md" >}})|Medium||||73.0%| +|1143|Longest Common Subsequence|[Go]({{< relref "/ChapterFour/1100~1199/1143.Longest-Common-Subsequence.md" >}})|Medium||||58.4%| +|1154|Day of the Year|[Go]({{< relref "/ChapterFour/1100~1199/1154.Day-of-the-Year.md" >}})|Easy||||49.6%| +|1160|Find Words That Can Be Formed by Characters|[Go]({{< relref "/ChapterFour/1100~1199/1160.Find-Words-That-Can-Be-Formed-by-Characters.md" >}})|Easy||||67.5%| +|1170|Compare Strings by Frequency of the Smallest Character|[Go]({{< relref "/ChapterFour/1100~1199/1170.Compare-Strings-by-Frequency-of-the-Smallest-Character.md" >}})|Medium||||61.5%| +|1178|Number of Valid Words for Each Puzzle|[Go]({{< relref "/ChapterFour/1100~1199/1178.Number-of-Valid-Words-for-Each-Puzzle.md" >}})|Hard||||46.3%| +|1189|Maximum Number of Balloons|[Go]({{< relref "/ChapterFour/1100~1199/1189.Maximum-Number-of-Balloons.md" >}})|Easy||||61.0%| +|1190|Reverse Substrings Between Each Pair of Parentheses|[Go]({{< relref "/ChapterFour/1100~1199/1190.Reverse-Substrings-Between-Each-Pair-of-Parentheses.md" >}})|Medium||||65.9%| +|1202|Smallest String With Swaps|[Go]({{< relref "/ChapterFour/1200~1299/1202.Smallest-String-With-Swaps.md" >}})|Medium||||57.7%| +|1208|Get Equal Substrings Within Budget|[Go]({{< relref "/ChapterFour/1200~1299/1208.Get-Equal-Substrings-Within-Budget.md" >}})|Medium||||48.5%| +|1209|Remove All Adjacent Duplicates in String II|[Go]({{< relref "/ChapterFour/1200~1299/1209.Remove-All-Adjacent-Duplicates-in-String-II.md" >}})|Medium||||56.2%| +|1221|Split a String in Balanced Strings|[Go]({{< relref "/ChapterFour/1200~1299/1221.Split-a-String-in-Balanced-Strings.md" >}})|Easy||||85.1%| +|1234|Replace the Substring for Balanced String|[Go]({{< relref "/ChapterFour/1200~1299/1234.Replace-the-Substring-for-Balanced-String.md" >}})|Medium||||37.2%| +|1239|Maximum Length of a Concatenated String with Unique Characters|[Go]({{< relref "/ChapterFour/1200~1299/1239.Maximum-Length-of-a-Concatenated-String-with-Unique-Characters.md" >}})|Medium||||52.2%| +|1249|Minimum Remove to Make Valid Parentheses|[Go]({{< relref "/ChapterFour/1200~1299/1249.Minimum-Remove-to-Make-Valid-Parentheses.md" >}})|Medium||||65.8%| +|1268|Search Suggestions System|[Go]({{< relref "/ChapterFour/1200~1299/1268.Search-Suggestions-System.md" >}})|Medium||||66.2%| +|1332|Remove Palindromic Subsequences|[Go]({{< relref "/ChapterFour/1300~1399/1332.Remove-Palindromic-Subsequences.md" >}})|Easy||||76.2%| +|1396|Design Underground System|[Go]({{< relref "/ChapterFour/1300~1399/1396.Design-Underground-System.md" >}})|Medium||||73.6%| +|1446|Consecutive Characters|[Go]({{< relref "/ChapterFour/1400~1499/1446.Consecutive-Characters.md" >}})|Easy||||61.2%| +|1455|Check If a Word Occurs As a Prefix of Any Word in a Sentence|[Go]({{< relref "/ChapterFour/1400~1499/1455.Check-If-a-Word-Occurs-As-a-Prefix-of-Any-Word-in-a-Sentence.md" >}})|Easy||||64.2%| +|1461|Check If a String Contains All Binary Codes of Size K|[Go]({{< relref "/ChapterFour/1400~1499/1461.Check-If-a-String-Contains-All-Binary-Codes-of-Size-K.md" >}})|Medium||||56.6%| +|1573|Number of Ways to Split a String|[Go]({{< relref "/ChapterFour/1500~1599/1573.Number-of-Ways-to-Split-a-String.md" >}})|Medium||||32.5%| +|1576|Replace All ?'s to Avoid Consecutive Repeating Characters|[Go]({{< relref "/ChapterFour/1500~1599/1576.Replace-All-s-to-Avoid-Consecutive-Repeating-Characters.md" >}})|Easy||||48.3%| +|1614|Maximum Nesting Depth of the Parentheses|[Go]({{< relref "/ChapterFour/1600~1699/1614.Maximum-Nesting-Depth-of-the-Parentheses.md" >}})|Easy||||82.3%| +|1624|Largest Substring Between Two Equal Characters|[Go]({{< relref "/ChapterFour/1600~1699/1624.Largest-Substring-Between-Two-Equal-Characters.md" >}})|Easy||||59.1%| +|1629|Slowest Key|[Go]({{< relref "/ChapterFour/1600~1699/1629.Slowest-Key.md" >}})|Easy||||59.2%| +|1647|Minimum Deletions to Make Character Frequencies Unique|[Go]({{< relref "/ChapterFour/1600~1699/1647.Minimum-Deletions-to-Make-Character-Frequencies-Unique.md" >}})|Medium||||59.1%| +|1653|Minimum Deletions to Make String Balanced|[Go]({{< relref "/ChapterFour/1600~1699/1653.Minimum-Deletions-to-Make-String-Balanced.md" >}})|Medium||||58.9%| +|1657|Determine if Two Strings Are Close|[Go]({{< relref "/ChapterFour/1600~1699/1657.Determine-if-Two-Strings-Are-Close.md" >}})|Medium||||56.3%| +|1662|Check If Two String Arrays are Equivalent|[Go]({{< relref "/ChapterFour/1600~1699/1662.Check-If-Two-String-Arrays-are-Equivalent.md" >}})|Easy||||83.5%| +|1663|Smallest String With A Given Numeric Value|[Go]({{< relref "/ChapterFour/1600~1699/1663.Smallest-String-With-A-Given-Numeric-Value.md" >}})|Medium||||66.8%| +|1668|Maximum Repeating Substring|[Go]({{< relref "/ChapterFour/1600~1699/1668.Maximum-Repeating-Substring.md" >}})|Easy||||39.5%| +|1678|Goal Parser Interpretation|[Go]({{< relref "/ChapterFour/1600~1699/1678.Goal-Parser-Interpretation.md" >}})|Easy||||86.5%| +|1684|Count the Number of Consistent Strings|[Go]({{< relref "/ChapterFour/1600~1699/1684.Count-the-Number-of-Consistent-Strings.md" >}})|Easy||||82.2%| +|1689|Partitioning Into Minimum Number Of Deci-Binary Numbers|[Go]({{< relref "/ChapterFour/1600~1699/1689.Partitioning-Into-Minimum-Number-Of-Deci-Binary-Numbers.md" >}})|Medium||||89.2%| +|1694|Reformat Phone Number|[Go]({{< relref "/ChapterFour/1600~1699/1694.Reformat-Phone-Number.md" >}})|Easy||||65.1%| +|1704|Determine if String Halves Are Alike|[Go]({{< relref "/ChapterFour/1700~1799/1704.Determine-if-String-Halves-Are-Alike.md" >}})|Easy||||77.7%| +|1736|Latest Time by Replacing Hidden Digits|[Go]({{< relref "/ChapterFour/1700~1799/1736.Latest-Time-by-Replacing-Hidden-Digits.md" >}})|Easy||||42.4%| +|1758|Minimum Changes To Make Alternating Binary String|[Go]({{< relref "/ChapterFour/1700~1799/1758.Minimum-Changes-To-Make-Alternating-Binary-String.md" >}})|Easy||||58.3%| +|1763|Longest Nice Substring|[Go]({{< relref "/ChapterFour/1700~1799/1763.Longest-Nice-Substring.md" >}})|Easy||||61.6%| +|1816|Truncate Sentence|[Go]({{< relref "/ChapterFour/1800~1899/1816.Truncate-Sentence.md" >}})|Easy||||83.0%| +|2038|Remove Colored Pieces if Both Neighbors are the Same Color|[Go]({{< relref "/ChapterFour/2000~2099/2038.Remove-Colored-Pieces-if-Both-Neighbors-are-the-Same-Color.md" >}})|Medium||||57.9%| +|2096|Step-By-Step Directions From a Binary Tree Node to Another|[Go]({{< relref "/ChapterFour/2000~2099/2096.Step-By-Step-Directions-From-a-Binary-Tree-Node-to-Another.md" >}})|Medium||||48.4%| +|2167|Minimum Time to Remove All Cars Containing Illegal Goods|[Go]({{< relref "/ChapterFour/2100~2199/2167.Minimum-Time-to-Remove-All-Cars-Containing-Illegal-Goods.md" >}})|Hard||||40.7%| +|2182|Construct String With Repeat Limit|[Go]({{< relref "/ChapterFour/2100~2199/2182.Construct-String-With-Repeat-Limit.md" >}})|Medium||||52.2%| |------------|-------------------------------------------------------|-------| ----------------| ---------------|-------------|-------------|-------------| diff --git a/website/content/ChapterTwo/Tree.md b/website/content/ChapterTwo/Tree.md index 083d5b7d5..ebd6b5b9b 100644 --- a/website/content/ChapterTwo/Tree.md +++ b/website/content/ChapterTwo/Tree.md @@ -9,88 +9,90 @@ weight: 6 | No. | Title | Solution | Difficulty | TimeComplexity | SpaceComplexity |Favorite| Acceptance | |:--------:|:------- | :--------: | :----------: | :----: | :-----: | :-----: |:-----: | -|0094|Binary Tree Inorder Traversal|[Go]({{< relref "/ChapterFour/0001~0099/0094.Binary-Tree-Inorder-Traversal.md" >}})|Easy| O(n)| O(1)||70.8%| -|0095|Unique Binary Search Trees II|[Go]({{< relref "/ChapterFour/0001~0099/0095.Unique-Binary-Search-Trees-II.md" >}})|Medium||||49.5%| -|0096|Unique Binary Search Trees|[Go]({{< relref "/ChapterFour/0001~0099/0096.Unique-Binary-Search-Trees.md" >}})|Medium| O(n^2)| O(n)||58.3%| -|0098|Validate Binary Search Tree|[Go]({{< relref "/ChapterFour/0001~0099/0098.Validate-Binary-Search-Tree.md" >}})|Medium| O(n)| O(1)||30.5%| -|0099|Recover Binary Search Tree|[Go]({{< relref "/ChapterFour/0001~0099/0099.Recover-Binary-Search-Tree.md" >}})|Medium| O(n)| O(1)||48.7%| -|0100|Same Tree|[Go]({{< relref "/ChapterFour/0100~0199/0100.Same-Tree.md" >}})|Easy| O(n)| O(1)||55.5%| -|0101|Symmetric Tree|[Go]({{< relref "/ChapterFour/0100~0199/0101.Symmetric-Tree.md" >}})|Easy| O(n)| O(1)||51.6%| -|0102|Binary Tree Level Order Traversal|[Go]({{< relref "/ChapterFour/0100~0199/0102.Binary-Tree-Level-Order-Traversal.md" >}})|Medium| O(n)| O(1)||60.9%| -|0103|Binary Tree Zigzag Level Order Traversal|[Go]({{< relref "/ChapterFour/0100~0199/0103.Binary-Tree-Zigzag-Level-Order-Traversal.md" >}})|Medium| O(n)| O(n)||53.6%| -|0104|Maximum Depth of Binary Tree|[Go]({{< relref "/ChapterFour/0100~0199/0104.Maximum-Depth-of-Binary-Tree.md" >}})|Easy| O(n)| O(1)||71.9%| -|0105|Construct Binary Tree from Preorder and Inorder Traversal|[Go]({{< relref "/ChapterFour/0100~0199/0105.Construct-Binary-Tree-from-Preorder-and-Inorder-Traversal.md" >}})|Medium||||57.7%| -|0106|Construct Binary Tree from Inorder and Postorder Traversal|[Go]({{< relref "/ChapterFour/0100~0199/0106.Construct-Binary-Tree-from-Inorder-and-Postorder-Traversal.md" >}})|Medium||||55.4%| -|0107|Binary Tree Level Order Traversal II|[Go]({{< relref "/ChapterFour/0100~0199/0107.Binary-Tree-Level-Order-Traversal-II.md" >}})|Medium| O(n)| O(1)||58.7%| -|0108|Convert Sorted Array to Binary Search Tree|[Go]({{< relref "/ChapterFour/0100~0199/0108.Convert-Sorted-Array-to-Binary-Search-Tree.md" >}})|Easy| O(n)| O(1)||66.1%| -|0109|Convert Sorted List to Binary Search Tree|[Go]({{< relref "/ChapterFour/0100~0199/0109.Convert-Sorted-List-to-Binary-Search-Tree.md" >}})|Medium||||55.6%| -|0110|Balanced Binary Tree|[Go]({{< relref "/ChapterFour/0100~0199/0110.Balanced-Binary-Tree.md" >}})|Easy| O(n)| O(1)||46.8%| -|0111|Minimum Depth of Binary Tree|[Go]({{< relref "/ChapterFour/0100~0199/0111.Minimum-Depth-of-Binary-Tree.md" >}})|Easy| O(n)| O(1)||42.5%| -|0112|Path Sum|[Go]({{< relref "/ChapterFour/0100~0199/0112.Path-Sum.md" >}})|Easy| O(n)| O(1)||45.5%| -|0113|Path Sum II|[Go]({{< relref "/ChapterFour/0100~0199/0113.Path-Sum-II.md" >}})|Medium| O(n)| O(1)||54.0%| -|0114|Flatten Binary Tree to Linked List|[Go]({{< relref "/ChapterFour/0100~0199/0114.Flatten-Binary-Tree-to-Linked-List.md" >}})|Medium| O(n)| O(1)||57.8%| -|0116|Populating Next Right Pointers in Each Node|[Go]({{< relref "/ChapterFour/0100~0199/0116.Populating-Next-Right-Pointers-in-Each-Node.md" >}})|Medium||||57.0%| -|0124|Binary Tree Maximum Path Sum|[Go]({{< relref "/ChapterFour/0100~0199/0124.Binary-Tree-Maximum-Path-Sum.md" >}})|Hard| O(n)| O(1)||37.7%| -|0129|Sum Root to Leaf Numbers|[Go]({{< relref "/ChapterFour/0100~0199/0129.Sum-Root-to-Leaf-Numbers.md" >}})|Medium| O(n)| O(1)||57.0%| -|0144|Binary Tree Preorder Traversal|[Go]({{< relref "/ChapterFour/0100~0199/0144.Binary-Tree-Preorder-Traversal.md" >}})|Easy| O(n)| O(1)||62.5%| -|0145|Binary Tree Postorder Traversal|[Go]({{< relref "/ChapterFour/0100~0199/0145.Binary-Tree-Postorder-Traversal.md" >}})|Easy| O(n)| O(1)||64.1%| -|0173|Binary Search Tree Iterator|[Go]({{< relref "/ChapterFour/0100~0199/0173.Binary-Search-Tree-Iterator.md" >}})|Medium| O(n)| O(1)||67.3%| -|0199|Binary Tree Right Side View|[Go]({{< relref "/ChapterFour/0100~0199/0199.Binary-Tree-Right-Side-View.md" >}})|Medium| O(n)| O(1)||59.6%| -|0222|Count Complete Tree Nodes|[Go]({{< relref "/ChapterFour/0200~0299/0222.Count-Complete-Tree-Nodes.md" >}})|Medium| O(n)| O(1)||55.3%| -|0226|Invert Binary Tree|[Go]({{< relref "/ChapterFour/0200~0299/0226.Invert-Binary-Tree.md" >}})|Easy| O(n)| O(1)||71.6%| -|0230|Kth Smallest Element in a BST|[Go]({{< relref "/ChapterFour/0200~0299/0230.Kth-Smallest-Element-in-a-BST.md" >}})|Medium| O(n)| O(1)||67.7%| -|0235|Lowest Common Ancestor of a Binary Search Tree|[Go]({{< relref "/ChapterFour/0200~0299/0235.Lowest-Common-Ancestor-of-a-Binary-Search-Tree.md" >}})|Easy| O(n)| O(1)||57.0%| -|0236|Lowest Common Ancestor of a Binary Tree|[Go]({{< relref "/ChapterFour/0200~0299/0236.Lowest-Common-Ancestor-of-a-Binary-Tree.md" >}})|Medium| O(n)| O(1)||55.4%| -|0257|Binary Tree Paths|[Go]({{< relref "/ChapterFour/0200~0299/0257.Binary-Tree-Paths.md" >}})|Easy| O(n)| O(1)||58.7%| -|0297|Serialize and Deserialize Binary Tree|[Go]({{< relref "/ChapterFour/0200~0299/0297.Serialize-and-Deserialize-Binary-Tree.md" >}})|Hard||||53.8%| -|0331|Verify Preorder Serialization of a Binary Tree|[Go]({{< relref "/ChapterFour/0300~0399/0331.Verify-Preorder-Serialization-of-a-Binary-Tree.md" >}})|Medium||||43.7%| -|0337|House Robber III|[Go]({{< relref "/ChapterFour/0300~0399/0337.House-Robber-III.md" >}})|Medium||||53.5%| -|0341|Flatten Nested List Iterator|[Go]({{< relref "/ChapterFour/0300~0399/0341.Flatten-Nested-List-Iterator.md" >}})|Medium||||58.8%| -|0404|Sum of Left Leaves|[Go]({{< relref "/ChapterFour/0400~0499/0404.Sum-of-Left-Leaves.md" >}})|Easy| O(n)| O(1)||55.1%| -|0429|N-ary Tree Level Order Traversal|[Go]({{< relref "/ChapterFour/0400~0499/0429.N-ary-Tree-Level-Order-Traversal.md" >}})|Medium||||68.9%| -|0437|Path Sum III|[Go]({{< relref "/ChapterFour/0400~0499/0437.Path-Sum-III.md" >}})|Medium| O(n)| O(1)||50.1%| -|0508|Most Frequent Subtree Sum|[Go]({{< relref "/ChapterFour/0500~0599/0508.Most-Frequent-Subtree-Sum.md" >}})|Medium||||62.8%| -|0513|Find Bottom Left Tree Value|[Go]({{< relref "/ChapterFour/0500~0599/0513.Find-Bottom-Left-Tree-Value.md" >}})|Medium||||65.2%| -|0515|Find Largest Value in Each Tree Row|[Go]({{< relref "/ChapterFour/0500~0599/0515.Find-Largest-Value-in-Each-Tree-Row.md" >}})|Medium| O(n)| O(n)||64.5%| -|0530|Minimum Absolute Difference in BST|[Go]({{< relref "/ChapterFour/0500~0599/0530.Minimum-Absolute-Difference-in-BST.md" >}})|Easy||||56.3%| -|0538|Convert BST to Greater Tree|[Go]({{< relref "/ChapterFour/0500~0599/0538.Convert-BST-to-Greater-Tree.md" >}})|Medium||||66.2%| -|0543|Diameter of Binary Tree|[Go]({{< relref "/ChapterFour/0500~0599/0543.Diameter-of-Binary-Tree.md" >}})|Easy||||54.3%| -|0559|Maximum Depth of N-ary Tree|[Go]({{< relref "/ChapterFour/0500~0599/0559.Maximum-Depth-of-N-ary-Tree.md" >}})|Easy||||71.1%| -|0563|Binary Tree Tilt|[Go]({{< relref "/ChapterFour/0500~0599/0563.Binary-Tree-Tilt.md" >}})|Easy||||58.5%| -|0572|Subtree of Another Tree|[Go]({{< relref "/ChapterFour/0500~0599/0572.Subtree-of-Another-Tree.md" >}})|Easy||||45.4%| -|0589|N-ary Tree Preorder Traversal|[Go]({{< relref "/ChapterFour/0500~0599/0589.N-ary-Tree-Preorder-Traversal.md" >}})|Easy||||76.1%| -|0617|Merge Two Binary Trees|[Go]({{< relref "/ChapterFour/0600~0699/0617.Merge-Two-Binary-Trees.md" >}})|Easy||||77.9%| -|0623|Add One Row to Tree|[Go]({{< relref "/ChapterFour/0600~0699/0623.Add-One-Row-to-Tree.md" >}})|Medium||||53.9%| -|0637|Average of Levels in Binary Tree|[Go]({{< relref "/ChapterFour/0600~0699/0637.Average-of-Levels-in-Binary-Tree.md" >}})|Easy| O(n)| O(n)||68.7%| -|0653|Two Sum IV - Input is a BST|[Go]({{< relref "/ChapterFour/0600~0699/0653.Two-Sum-IV-Input-is-a-BST.md" >}})|Easy||||58.8%| -|0662|Maximum Width of Binary Tree|[Go]({{< relref "/ChapterFour/0600~0699/0662.Maximum-Width-of-Binary-Tree.md" >}})|Medium||||40.3%| -|0669|Trim a Binary Search Tree|[Go]({{< relref "/ChapterFour/0600~0699/0669.Trim-a-Binary-Search-Tree.md" >}})|Medium||||66.3%| -|0700|Search in a Binary Search Tree|[Go]({{< relref "/ChapterFour/0700~0799/0700.Search-in-a-Binary-Search-Tree.md" >}})|Easy||||76.4%| -|0701|Insert into a Binary Search Tree|[Go]({{< relref "/ChapterFour/0700~0799/0701.Insert-into-a-Binary-Search-Tree.md" >}})|Medium||||74.9%| -|0703|Kth Largest Element in a Stream|[Go]({{< relref "/ChapterFour/0700~0799/0703.Kth-Largest-Element-in-a-Stream.md" >}})|Easy||||54.8%| -|0783|Minimum Distance Between BST Nodes|[Go]({{< relref "/ChapterFour/0700~0799/0783.Minimum-Distance-Between-BST-Nodes.md" >}})|Easy||||56.1%| -|0834|Sum of Distances in Tree|[Go]({{< relref "/ChapterFour/0800~0899/0834.Sum-of-Distances-in-Tree.md" >}})|Hard||||53.0%| -|0863|All Nodes Distance K in Binary Tree|[Go]({{< relref "/ChapterFour/0800~0899/0863.All-Nodes-Distance-K-in-Binary-Tree.md" >}})|Medium||||61.1%| -|0872|Leaf-Similar Trees|[Go]({{< relref "/ChapterFour/0800~0899/0872.Leaf-Similar-Trees.md" >}})|Easy||||65.0%| -|0897|Increasing Order Search Tree|[Go]({{< relref "/ChapterFour/0800~0899/0897.Increasing-Order-Search-Tree.md" >}})|Easy||||78.3%| -|0938|Range Sum of BST|[Go]({{< relref "/ChapterFour/0900~0999/0938.Range-Sum-of-BST.md" >}})|Easy||||85.1%| -|0958|Check Completeness of a Binary Tree|[Go]({{< relref "/ChapterFour/0900~0999/0958.Check-Completeness-of-a-Binary-Tree.md" >}})|Medium||||53.6%| -|0968|Binary Tree Cameras|[Go]({{< relref "/ChapterFour/0900~0999/0968.Binary-Tree-Cameras.md" >}})|Hard||||41.9%| -|0971|Flip Binary Tree To Match Preorder Traversal|[Go]({{< relref "/ChapterFour/0900~0999/0971.Flip-Binary-Tree-To-Match-Preorder-Traversal.md" >}})|Medium||||49.9%| -|0979|Distribute Coins in Binary Tree|[Go]({{< relref "/ChapterFour/0900~0999/0979.Distribute-Coins-in-Binary-Tree.md" >}})|Medium||||71.6%| -|0987|Vertical Order Traversal of a Binary Tree|[Go]({{< relref "/ChapterFour/0900~0999/0987.Vertical-Order-Traversal-of-a-Binary-Tree.md" >}})|Hard||||41.6%| -|0993|Cousins in Binary Tree|[Go]({{< relref "/ChapterFour/0900~0999/0993.Cousins-in-Binary-Tree.md" >}})|Easy| O(n)| O(1)||53.8%| -|1026|Maximum Difference Between Node and Ancestor|[Go]({{< relref "/ChapterFour/1000~1099/1026.Maximum-Difference-Between-Node-and-Ancestor.md" >}})|Medium||||73.2%| -|1028|Recover a Tree From Preorder Traversal|[Go]({{< relref "/ChapterFour/1000~1099/1028.Recover-a-Tree-From-Preorder-Traversal.md" >}})|Hard||||72.4%| -|1038|Binary Search Tree to Greater Sum Tree|[Go]({{< relref "/ChapterFour/1000~1099/1038.Binary-Search-Tree-to-Greater-Sum-Tree.md" >}})|Medium||||84.8%| -|1104|Path In Zigzag Labelled Binary Tree|[Go]({{< relref "/ChapterFour/1100~1199/1104.Path-In-Zigzag-Labelled-Binary-Tree.md" >}})|Medium||||74.6%| +|0094|Binary Tree Inorder Traversal|[Go]({{< relref "/ChapterFour/0001~0099/0094.Binary-Tree-Inorder-Traversal.md" >}})|Easy| O(n)| O(1)||73.8%| +|0095|Unique Binary Search Trees II|[Go]({{< relref "/ChapterFour/0001~0099/0095.Unique-Binary-Search-Trees-II.md" >}})|Medium||||52.3%| +|0096|Unique Binary Search Trees|[Go]({{< relref "/ChapterFour/0001~0099/0096.Unique-Binary-Search-Trees.md" >}})|Medium| O(n^2)| O(n)||59.6%| +|0098|Validate Binary Search Tree|[Go]({{< relref "/ChapterFour/0001~0099/0098.Validate-Binary-Search-Tree.md" >}})|Medium| O(n)| O(1)||32.0%| +|0099|Recover Binary Search Tree|[Go]({{< relref "/ChapterFour/0001~0099/0099.Recover-Binary-Search-Tree.md" >}})|Medium| O(n)| O(1)||51.0%| +|0100|Same Tree|[Go]({{< relref "/ChapterFour/0100~0199/0100.Same-Tree.md" >}})|Easy| O(n)| O(1)||58.1%| +|0101|Symmetric Tree|[Go]({{< relref "/ChapterFour/0100~0199/0101.Symmetric-Tree.md" >}})|Easy| O(n)| O(1)||54.3%| +|0102|Binary Tree Level Order Traversal|[Go]({{< relref "/ChapterFour/0100~0199/0102.Binary-Tree-Level-Order-Traversal.md" >}})|Medium| O(n)| O(1)||64.3%| +|0103|Binary Tree Zigzag Level Order Traversal|[Go]({{< relref "/ChapterFour/0100~0199/0103.Binary-Tree-Zigzag-Level-Order-Traversal.md" >}})|Medium| O(n)| O(n)||56.9%| +|0104|Maximum Depth of Binary Tree|[Go]({{< relref "/ChapterFour/0100~0199/0104.Maximum-Depth-of-Binary-Tree.md" >}})|Easy| O(n)| O(1)||73.9%| +|0105|Construct Binary Tree from Preorder and Inorder Traversal|[Go]({{< relref "/ChapterFour/0100~0199/0105.Construct-Binary-Tree-from-Preorder-and-Inorder-Traversal.md" >}})|Medium||||61.5%| +|0106|Construct Binary Tree from Inorder and Postorder Traversal|[Go]({{< relref "/ChapterFour/0100~0199/0106.Construct-Binary-Tree-from-Inorder-and-Postorder-Traversal.md" >}})|Medium||||60.0%| +|0107|Binary Tree Level Order Traversal II|[Go]({{< relref "/ChapterFour/0100~0199/0107.Binary-Tree-Level-Order-Traversal-II.md" >}})|Medium| O(n)| O(1)||61.1%| +|0108|Convert Sorted Array to Binary Search Tree|[Go]({{< relref "/ChapterFour/0100~0199/0108.Convert-Sorted-Array-to-Binary-Search-Tree.md" >}})|Easy| O(n)| O(1)||69.8%| +|0109|Convert Sorted List to Binary Search Tree|[Go]({{< relref "/ChapterFour/0100~0199/0109.Convert-Sorted-List-to-Binary-Search-Tree.md" >}})|Medium||||60.2%| +|0110|Balanced Binary Tree|[Go]({{< relref "/ChapterFour/0100~0199/0110.Balanced-Binary-Tree.md" >}})|Easy| O(n)| O(1)||49.0%| +|0111|Minimum Depth of Binary Tree|[Go]({{< relref "/ChapterFour/0100~0199/0111.Minimum-Depth-of-Binary-Tree.md" >}})|Easy| O(n)| O(1)||44.4%| +|0112|Path Sum|[Go]({{< relref "/ChapterFour/0100~0199/0112.Path-Sum.md" >}})|Easy| O(n)| O(1)||48.2%| +|0113|Path Sum II|[Go]({{< relref "/ChapterFour/0100~0199/0113.Path-Sum-II.md" >}})|Medium| O(n)| O(1)||57.1%| +|0114|Flatten Binary Tree to Linked List|[Go]({{< relref "/ChapterFour/0100~0199/0114.Flatten-Binary-Tree-to-Linked-List.md" >}})|Medium| O(n)| O(1)||61.8%| +|0116|Populating Next Right Pointers in Each Node|[Go]({{< relref "/ChapterFour/0100~0199/0116.Populating-Next-Right-Pointers-in-Each-Node.md" >}})|Medium||||60.4%| +|0124|Binary Tree Maximum Path Sum|[Go]({{< relref "/ChapterFour/0100~0199/0124.Binary-Tree-Maximum-Path-Sum.md" >}})|Hard| O(n)| O(1)||39.2%| +|0129|Sum Root to Leaf Numbers|[Go]({{< relref "/ChapterFour/0100~0199/0129.Sum-Root-to-Leaf-Numbers.md" >}})|Medium| O(n)| O(1)||61.0%| +|0144|Binary Tree Preorder Traversal|[Go]({{< relref "/ChapterFour/0100~0199/0144.Binary-Tree-Preorder-Traversal.md" >}})|Easy| O(n)| O(1)||66.8%| +|0145|Binary Tree Postorder Traversal|[Go]({{< relref "/ChapterFour/0100~0199/0145.Binary-Tree-Postorder-Traversal.md" >}})|Easy| O(n)| O(1)||67.9%| +|0173|Binary Search Tree Iterator|[Go]({{< relref "/ChapterFour/0100~0199/0173.Binary-Search-Tree-Iterator.md" >}})|Medium| O(n)| O(1)||69.7%| +|0199|Binary Tree Right Side View|[Go]({{< relref "/ChapterFour/0100~0199/0199.Binary-Tree-Right-Side-View.md" >}})|Medium| O(n)| O(1)||61.6%| +|0222|Count Complete Tree Nodes|[Go]({{< relref "/ChapterFour/0200~0299/0222.Count-Complete-Tree-Nodes.md" >}})|Medium| O(n)| O(1)||60.5%| +|0226|Invert Binary Tree|[Go]({{< relref "/ChapterFour/0200~0299/0226.Invert-Binary-Tree.md" >}})|Easy| O(n)| O(1)||74.7%| +|0230|Kth Smallest Element in a BST|[Go]({{< relref "/ChapterFour/0200~0299/0230.Kth-Smallest-Element-in-a-BST.md" >}})|Medium| O(n)| O(1)||70.1%| +|0235|Lowest Common Ancestor of a Binary Search Tree|[Go]({{< relref "/ChapterFour/0200~0299/0235.Lowest-Common-Ancestor-of-a-Binary-Search-Tree.md" >}})|Medium| O(n)| O(1)||61.5%| +|0236|Lowest Common Ancestor of a Binary Tree|[Go]({{< relref "/ChapterFour/0200~0299/0236.Lowest-Common-Ancestor-of-a-Binary-Tree.md" >}})|Medium| O(n)| O(1)||58.8%| +|0257|Binary Tree Paths|[Go]({{< relref "/ChapterFour/0200~0299/0257.Binary-Tree-Paths.md" >}})|Easy| O(n)| O(1)||61.4%| +|0297|Serialize and Deserialize Binary Tree|[Go]({{< relref "/ChapterFour/0200~0299/0297.Serialize-and-Deserialize-Binary-Tree.md" >}})|Hard||||55.4%| +|0331|Verify Preorder Serialization of a Binary Tree|[Go]({{< relref "/ChapterFour/0300~0399/0331.Verify-Preorder-Serialization-of-a-Binary-Tree.md" >}})|Medium||||44.6%| +|0337|House Robber III|[Go]({{< relref "/ChapterFour/0300~0399/0337.House-Robber-III.md" >}})|Medium||||53.9%| +|0341|Flatten Nested List Iterator|[Go]({{< relref "/ChapterFour/0300~0399/0341.Flatten-Nested-List-Iterator.md" >}})|Medium||||61.8%| +|0404|Sum of Left Leaves|[Go]({{< relref "/ChapterFour/0400~0499/0404.Sum-of-Left-Leaves.md" >}})|Easy| O(n)| O(1)||56.7%| +|0429|N-ary Tree Level Order Traversal|[Go]({{< relref "/ChapterFour/0400~0499/0429.N-ary-Tree-Level-Order-Traversal.md" >}})|Medium||||70.7%| +|0437|Path Sum III|[Go]({{< relref "/ChapterFour/0400~0499/0437.Path-Sum-III.md" >}})|Medium| O(n)| O(1)||48.0%| +|0508|Most Frequent Subtree Sum|[Go]({{< relref "/ChapterFour/0500~0599/0508.Most-Frequent-Subtree-Sum.md" >}})|Medium||||64.9%| +|0513|Find Bottom Left Tree Value|[Go]({{< relref "/ChapterFour/0500~0599/0513.Find-Bottom-Left-Tree-Value.md" >}})|Medium||||66.9%| +|0515|Find Largest Value in Each Tree Row|[Go]({{< relref "/ChapterFour/0500~0599/0515.Find-Largest-Value-in-Each-Tree-Row.md" >}})|Medium| O(n)| O(n)||64.6%| +|0530|Minimum Absolute Difference in BST|[Go]({{< relref "/ChapterFour/0500~0599/0530.Minimum-Absolute-Difference-in-BST.md" >}})|Easy||||57.3%| +|0538|Convert BST to Greater Tree|[Go]({{< relref "/ChapterFour/0500~0599/0538.Convert-BST-to-Greater-Tree.md" >}})|Medium||||67.8%| +|0543|Diameter of Binary Tree|[Go]({{< relref "/ChapterFour/0500~0599/0543.Diameter-of-Binary-Tree.md" >}})|Easy||||56.8%| +|0559|Maximum Depth of N-ary Tree|[Go]({{< relref "/ChapterFour/0500~0599/0559.Maximum-Depth-of-N-ary-Tree.md" >}})|Easy||||71.7%| +|0563|Binary Tree Tilt|[Go]({{< relref "/ChapterFour/0500~0599/0563.Binary-Tree-Tilt.md" >}})|Easy||||60.0%| +|0572|Subtree of Another Tree|[Go]({{< relref "/ChapterFour/0500~0599/0572.Subtree-of-Another-Tree.md" >}})|Easy||||46.4%| +|0589|N-ary Tree Preorder Traversal|[Go]({{< relref "/ChapterFour/0500~0599/0589.N-ary-Tree-Preorder-Traversal.md" >}})|Easy||||75.9%| +|0617|Merge Two Binary Trees|[Go]({{< relref "/ChapterFour/0600~0699/0617.Merge-Two-Binary-Trees.md" >}})|Easy||||78.6%| +|0623|Add One Row to Tree|[Go]({{< relref "/ChapterFour/0600~0699/0623.Add-One-Row-to-Tree.md" >}})|Medium||||59.5%| +|0637|Average of Levels in Binary Tree|[Go]({{< relref "/ChapterFour/0600~0699/0637.Average-of-Levels-in-Binary-Tree.md" >}})|Easy| O(n)| O(n)||71.8%| +|0653|Two Sum IV - Input is a BST|[Go]({{< relref "/ChapterFour/0600~0699/0653.Two-Sum-IV-Input-is-a-BST.md" >}})|Easy||||61.0%| +|0662|Maximum Width of Binary Tree|[Go]({{< relref "/ChapterFour/0600~0699/0662.Maximum-Width-of-Binary-Tree.md" >}})|Medium||||40.7%| +|0669|Trim a Binary Search Tree|[Go]({{< relref "/ChapterFour/0600~0699/0669.Trim-a-Binary-Search-Tree.md" >}})|Medium||||66.4%| +|0700|Search in a Binary Search Tree|[Go]({{< relref "/ChapterFour/0700~0799/0700.Search-in-a-Binary-Search-Tree.md" >}})|Easy||||77.7%| +|0701|Insert into a Binary Search Tree|[Go]({{< relref "/ChapterFour/0700~0799/0701.Insert-into-a-Binary-Search-Tree.md" >}})|Medium||||74.3%| +|0703|Kth Largest Element in a Stream|[Go]({{< relref "/ChapterFour/0700~0799/0703.Kth-Largest-Element-in-a-Stream.md" >}})|Easy||||55.5%| +|0783|Minimum Distance Between BST Nodes|[Go]({{< relref "/ChapterFour/0700~0799/0783.Minimum-Distance-Between-BST-Nodes.md" >}})|Easy||||59.3%| +|0834|Sum of Distances in Tree|[Go]({{< relref "/ChapterFour/0800~0899/0834.Sum-of-Distances-in-Tree.md" >}})|Hard||||59.1%| +|0863|All Nodes Distance K in Binary Tree|[Go]({{< relref "/ChapterFour/0800~0899/0863.All-Nodes-Distance-K-in-Binary-Tree.md" >}})|Medium||||62.2%| +|0872|Leaf-Similar Trees|[Go]({{< relref "/ChapterFour/0800~0899/0872.Leaf-Similar-Trees.md" >}})|Easy||||67.6%| +|0897|Increasing Order Search Tree|[Go]({{< relref "/ChapterFour/0800~0899/0897.Increasing-Order-Search-Tree.md" >}})|Easy||||78.4%| +|0938|Range Sum of BST|[Go]({{< relref "/ChapterFour/0900~0999/0938.Range-Sum-of-BST.md" >}})|Easy||||85.9%| +|0958|Check Completeness of a Binary Tree|[Go]({{< relref "/ChapterFour/0900~0999/0958.Check-Completeness-of-a-Binary-Tree.md" >}})|Medium||||56.2%| +|0968|Binary Tree Cameras|[Go]({{< relref "/ChapterFour/0900~0999/0968.Binary-Tree-Cameras.md" >}})|Hard||||46.6%| +|0971|Flip Binary Tree To Match Preorder Traversal|[Go]({{< relref "/ChapterFour/0900~0999/0971.Flip-Binary-Tree-To-Match-Preorder-Traversal.md" >}})|Medium||||50.0%| +|0979|Distribute Coins in Binary Tree|[Go]({{< relref "/ChapterFour/0900~0999/0979.Distribute-Coins-in-Binary-Tree.md" >}})|Medium||||72.2%| +|0987|Vertical Order Traversal of a Binary Tree|[Go]({{< relref "/ChapterFour/0900~0999/0987.Vertical-Order-Traversal-of-a-Binary-Tree.md" >}})|Hard||||45.1%| +|0993|Cousins in Binary Tree|[Go]({{< relref "/ChapterFour/0900~0999/0993.Cousins-in-Binary-Tree.md" >}})|Easy| O(n)| O(1)||54.6%| +|1022|Sum of Root To Leaf Binary Numbers|[Go]({{< relref "/ChapterFour/1000~1099/1022.Sum-of-Root-To-Leaf-Binary-Numbers.md" >}})|Easy||||73.6%| +|1026|Maximum Difference Between Node and Ancestor|[Go]({{< relref "/ChapterFour/1000~1099/1026.Maximum-Difference-Between-Node-and-Ancestor.md" >}})|Medium||||75.8%| +|1028|Recover a Tree From Preorder Traversal|[Go]({{< relref "/ChapterFour/1000~1099/1028.Recover-a-Tree-From-Preorder-Traversal.md" >}})|Hard||||73.3%| +|1038|Binary Search Tree to Greater Sum Tree|[Go]({{< relref "/ChapterFour/1000~1099/1038.Binary-Search-Tree-to-Greater-Sum-Tree.md" >}})|Medium||||85.5%| +|1104|Path In Zigzag Labelled Binary Tree|[Go]({{< relref "/ChapterFour/1100~1199/1104.Path-In-Zigzag-Labelled-Binary-Tree.md" >}})|Medium||||75.1%| |1110|Delete Nodes And Return Forest|[Go]({{< relref "/ChapterFour/1100~1199/1110.Delete-Nodes-And-Return-Forest.md" >}})|Medium||||69.3%| -|1123|Lowest Common Ancestor of Deepest Leaves|[Go]({{< relref "/ChapterFour/1100~1199/1123.Lowest-Common-Ancestor-of-Deepest-Leaves.md" >}})|Medium||||70.2%| -|1145|Binary Tree Coloring Game|[Go]({{< relref "/ChapterFour/1100~1199/1145.Binary-Tree-Coloring-Game.md" >}})|Medium||||51.2%| -|1302|Deepest Leaves Sum|[Go]({{< relref "/ChapterFour/1300~1399/1302.Deepest-Leaves-Sum.md" >}})|Medium||||85.7%| -|1305|All Elements in Two Binary Search Trees|[Go]({{< relref "/ChapterFour/1300~1399/1305.All-Elements-in-Two-Binary-Search-Trees.md" >}})|Medium||||79.6%| -|1600|Throne Inheritance|[Go]({{< relref "/ChapterFour/1600~1699/1600.Throne-Inheritance.md" >}})|Medium||||63.2%| -|1609|Even Odd Tree|[Go]({{< relref "/ChapterFour/1600~1699/1609.Even-Odd-Tree.md" >}})|Medium||||53.0%| +|1123|Lowest Common Ancestor of Deepest Leaves|[Go]({{< relref "/ChapterFour/1100~1199/1123.Lowest-Common-Ancestor-of-Deepest-Leaves.md" >}})|Medium||||70.9%| +|1145|Binary Tree Coloring Game|[Go]({{< relref "/ChapterFour/1100~1199/1145.Binary-Tree-Coloring-Game.md" >}})|Medium||||51.7%| +|1302|Deepest Leaves Sum|[Go]({{< relref "/ChapterFour/1300~1399/1302.Deepest-Leaves-Sum.md" >}})|Medium||||86.7%| +|1305|All Elements in Two Binary Search Trees|[Go]({{< relref "/ChapterFour/1300~1399/1305.All-Elements-in-Two-Binary-Search-Trees.md" >}})|Medium||||79.8%| +|1600|Throne Inheritance|[Go]({{< relref "/ChapterFour/1600~1699/1600.Throne-Inheritance.md" >}})|Medium||||63.6%| +|1609|Even Odd Tree|[Go]({{< relref "/ChapterFour/1600~1699/1609.Even-Odd-Tree.md" >}})|Medium||||54.3%| +|2096|Step-By-Step Directions From a Binary Tree Node to Another|[Go]({{< relref "/ChapterFour/2000~2099/2096.Step-By-Step-Directions-From-a-Binary-Tree-Node-to-Another.md" >}})|Medium||||48.4%| |------------|-------------------------------------------------------|-------| ----------------| ---------------|-------------|-------------|-------------| diff --git a/website/content/ChapterTwo/Two_Pointers.md b/website/content/ChapterTwo/Two_Pointers.md index 2bc13de00..6959d5ff8 100644 --- a/website/content/ChapterTwo/Two_Pointers.md +++ b/website/content/ChapterTwo/Two_Pointers.md @@ -32,81 +32,82 @@ weight: 3 | No. | Title | Solution | Difficulty | TimeComplexity | SpaceComplexity |Favorite| Acceptance | |:--------:|:------- | :--------: | :----------: | :----: | :-----: | :-----: |:-----: | -|0011|Container With Most Water|[Go]({{< relref "/ChapterFour/0001~0099/0011.Container-With-Most-Water.md" >}})|Medium| O(n)| O(1)||53.9%| -|0015|3Sum|[Go]({{< relref "/ChapterFour/0001~0099/0015.3Sum.md" >}})|Medium| O(n^2)| O(n)|❤️|31.1%| -|0016|3Sum Closest|[Go]({{< relref "/ChapterFour/0001~0099/0016.3Sum-Closest.md" >}})|Medium| O(n^2)| O(1)|❤️|47.1%| -|0018|4Sum|[Go]({{< relref "/ChapterFour/0001~0099/0018.4Sum.md" >}})|Medium| O(n^3)| O(n^2)|❤️|37.3%| -|0019|Remove Nth Node From End of List|[Go]({{< relref "/ChapterFour/0001~0099/0019.Remove-Nth-Node-From-End-of-List.md" >}})|Medium| O(n)| O(1)||38.3%| -|0026|Remove Duplicates from Sorted Array|[Go]({{< relref "/ChapterFour/0001~0099/0026.Remove-Duplicates-from-Sorted-Array.md" >}})|Easy| O(n)| O(1)||48.9%| -|0027|Remove Element|[Go]({{< relref "/ChapterFour/0001~0099/0027.Remove-Element.md" >}})|Easy| O(n)| O(1)||51.2%| -|0028|Implement strStr()|[Go]({{< relref "/ChapterFour/0001~0099/0028.Implement-strStr.md" >}})|Easy| O(n)| O(1)||35.9%| -|0031|Next Permutation|[Go]({{< relref "/ChapterFour/0001~0099/0031.Next-Permutation.md" >}})|Medium||||36.4%| -|0042|Trapping Rain Water|[Go]({{< relref "/ChapterFour/0001~0099/0042.Trapping-Rain-Water.md" >}})|Hard| O(n)| O(1)|❤️|56.5%| -|0061|Rotate List|[Go]({{< relref "/ChapterFour/0001~0099/0061.Rotate-List.md" >}})|Medium| O(n)| O(1)||34.9%| -|0075|Sort Colors|[Go]({{< relref "/ChapterFour/0001~0099/0075.Sort-Colors.md" >}})|Medium| O(n)| O(1)|❤️|54.8%| -|0080|Remove Duplicates from Sorted Array II|[Go]({{< relref "/ChapterFour/0001~0099/0080.Remove-Duplicates-from-Sorted-Array-II.md" >}})|Medium| O(n)| O(1||50.5%| -|0082|Remove Duplicates from Sorted List II|[Go]({{< relref "/ChapterFour/0001~0099/0082.Remove-Duplicates-from-Sorted-List-II.md" >}})|Medium||||44.3%| -|0086|Partition List|[Go]({{< relref "/ChapterFour/0001~0099/0086.Partition-List.md" >}})|Medium| O(n)| O(1)|❤️|47.9%| -|0088|Merge Sorted Array|[Go]({{< relref "/ChapterFour/0001~0099/0088.Merge-Sorted-Array.md" >}})|Easy| O(n)| O(1)|❤️|43.9%| -|0125|Valid Palindrome|[Go]({{< relref "/ChapterFour/0100~0199/0125.Valid-Palindrome.md" >}})|Easy| O(n)| O(1)||41.7%| -|0141|Linked List Cycle|[Go]({{< relref "/ChapterFour/0100~0199/0141.Linked-List-Cycle.md" >}})|Easy| O(n)| O(1)|❤️|45.9%| -|0142|Linked List Cycle II|[Go]({{< relref "/ChapterFour/0100~0199/0142.Linked-List-Cycle-II.md" >}})|Medium| O(n)| O(1)|❤️|44.2%| -|0143|Reorder List|[Go]({{< relref "/ChapterFour/0100~0199/0143.Reorder-List.md" >}})|Medium||||47.9%| -|0148|Sort List|[Go]({{< relref "/ChapterFour/0100~0199/0148.Sort-List.md" >}})|Medium||||52.1%| -|0151|Reverse Words in a String|[Go]({{< relref "/ChapterFour/0100~0199/0151.Reverse-Words-in-a-String.md" >}})|Medium||||28.5%| -|0160|Intersection of Two Linked Lists|[Go]({{< relref "/ChapterFour/0100~0199/0160.Intersection-of-Two-Linked-Lists.md" >}})|Easy||||49.9%| -|0167|Two Sum II - Input Array Is Sorted|[Go]({{< relref "/ChapterFour/0100~0199/0167.Two-Sum-II-Input-Array-Is-Sorted.md" >}})|Medium| O(n)| O(1)||58.7%| -|0189|Rotate Array|[Go]({{< relref "/ChapterFour/0100~0199/0189.Rotate-Array.md" >}})|Medium||||38.6%| -|0202|Happy Number|[Go]({{< relref "/ChapterFour/0200~0299/0202.Happy-Number.md" >}})|Easy||||53.2%| -|0234|Palindrome Linked List|[Go]({{< relref "/ChapterFour/0200~0299/0234.Palindrome-Linked-List.md" >}})|Easy| O(n)| O(1)||46.6%| -|0283|Move Zeroes|[Go]({{< relref "/ChapterFour/0200~0299/0283.Move-Zeroes.md" >}})|Easy| O(n)| O(1)||60.6%| -|0287|Find the Duplicate Number|[Go]({{< relref "/ChapterFour/0200~0299/0287.Find-the-Duplicate-Number.md" >}})|Medium| O(n)| O(1)|❤️|58.8%| -|0344|Reverse String|[Go]({{< relref "/ChapterFour/0300~0399/0344.Reverse-String.md" >}})|Easy| O(n)| O(1)||74.9%| -|0345|Reverse Vowels of a String|[Go]({{< relref "/ChapterFour/0300~0399/0345.Reverse-Vowels-of-a-String.md" >}})|Easy| O(n)| O(1)||47.0%| -|0349|Intersection of Two Arrays|[Go]({{< relref "/ChapterFour/0300~0399/0349.Intersection-of-Two-Arrays.md" >}})|Easy| O(n)| O(n) ||69.1%| -|0350|Intersection of Two Arrays II|[Go]({{< relref "/ChapterFour/0300~0399/0350.Intersection-of-Two-Arrays-II.md" >}})|Easy| O(n)| O(n) ||54.9%| -|0392|Is Subsequence|[Go]({{< relref "/ChapterFour/0300~0399/0392.Is-Subsequence.md" >}})|Easy||||51.0%| -|0457|Circular Array Loop|[Go]({{< relref "/ChapterFour/0400~0499/0457.Circular-Array-Loop.md" >}})|Medium||||31.7%| -|0475|Heaters|[Go]({{< relref "/ChapterFour/0400~0499/0475.Heaters.md" >}})|Medium||||35.3%| -|0524|Longest Word in Dictionary through Deleting|[Go]({{< relref "/ChapterFour/0500~0599/0524.Longest-Word-in-Dictionary-through-Deleting.md" >}})|Medium| O(n)| O(1) ||50.9%| -|0532|K-diff Pairs in an Array|[Go]({{< relref "/ChapterFour/0500~0599/0532.K-diff-Pairs-in-an-Array.md" >}})|Medium| O(n)| O(n)||40.1%| -|0541|Reverse String II|[Go]({{< relref "/ChapterFour/0500~0599/0541.Reverse-String-II.md" >}})|Easy||||50.2%| -|0557|Reverse Words in a String III|[Go]({{< relref "/ChapterFour/0500~0599/0557.Reverse-Words-in-a-String-III.md" >}})|Easy||||78.7%| -|0567|Permutation in String|[Go]({{< relref "/ChapterFour/0500~0599/0567.Permutation-in-String.md" >}})|Medium| O(n)| O(1)|❤️|44.7%| -|0581|Shortest Unsorted Continuous Subarray|[Go]({{< relref "/ChapterFour/0500~0599/0581.Shortest-Unsorted-Continuous-Subarray.md" >}})|Medium||||35.9%| -|0611|Valid Triangle Number|[Go]({{< relref "/ChapterFour/0600~0699/0611.Valid-Triangle-Number.md" >}})|Medium||||49.8%| -|0633|Sum of Square Numbers|[Go]({{< relref "/ChapterFour/0600~0699/0633.Sum-of-Square-Numbers.md" >}})|Medium||||34.7%| -|0653|Two Sum IV - Input is a BST|[Go]({{< relref "/ChapterFour/0600~0699/0653.Two-Sum-IV-Input-is-a-BST.md" >}})|Easy||||58.8%| -|0658|Find K Closest Elements|[Go]({{< relref "/ChapterFour/0600~0699/0658.Find-K-Closest-Elements.md" >}})|Medium||||44.5%| -|0696|Count Binary Substrings|[Go]({{< relref "/ChapterFour/0600~0699/0696.Count-Binary-Substrings.md" >}})|Easy||||64.9%| -|0719|Find K-th Smallest Pair Distance|[Go]({{< relref "/ChapterFour/0700~0799/0719.Find-K-th-Smallest-Pair-Distance.md" >}})|Hard||||35.1%| -|0763|Partition Labels|[Go]({{< relref "/ChapterFour/0700~0799/0763.Partition-Labels.md" >}})|Medium| O(n)| O(1)|❤️|79.6%| -|0795|Number of Subarrays with Bounded Maximum|[Go]({{< relref "/ChapterFour/0700~0799/0795.Number-of-Subarrays-with-Bounded-Maximum.md" >}})|Medium||||52.4%| -|0821|Shortest Distance to a Character|[Go]({{< relref "/ChapterFour/0800~0899/0821.Shortest-Distance-to-a-Character.md" >}})|Easy||||71.0%| -|0825|Friends Of Appropriate Ages|[Go]({{< relref "/ChapterFour/0800~0899/0825.Friends-Of-Appropriate-Ages.md" >}})|Medium||||46.0%| -|0826|Most Profit Assigning Work|[Go]({{< relref "/ChapterFour/0800~0899/0826.Most-Profit-Assigning-Work.md" >}})|Medium| O(n log n)| O(n)||42.1%| -|0832|Flipping an Image|[Go]({{< relref "/ChapterFour/0800~0899/0832.Flipping-an-Image.md" >}})|Easy||||79.7%| -|0838|Push Dominoes|[Go]({{< relref "/ChapterFour/0800~0899/0838.Push-Dominoes.md" >}})|Medium| O(n)| O(n)||52.3%| -|0844|Backspace String Compare|[Go]({{< relref "/ChapterFour/0800~0899/0844.Backspace-String-Compare.md" >}})|Easy| O(n)| O(n) ||48.0%| -|0845|Longest Mountain in Array|[Go]({{< relref "/ChapterFour/0800~0899/0845.Longest-Mountain-in-Array.md" >}})|Medium| O(n)| O(1) ||39.8%| -|0876|Middle of the Linked List|[Go]({{< relref "/ChapterFour/0800~0899/0876.Middle-of-the-Linked-List.md" >}})|Easy||||72.6%| -|0881|Boats to Save People|[Go]({{< relref "/ChapterFour/0800~0899/0881.Boats-to-Save-People.md" >}})|Medium| O(n log n)| O(1) ||52.5%| -|0922|Sort Array By Parity II|[Go]({{< relref "/ChapterFour/0900~0999/0922.Sort-Array-By-Parity-II.md" >}})|Easy||||70.6%| -|0923|3Sum With Multiplicity|[Go]({{< relref "/ChapterFour/0900~0999/0923.3Sum-With-Multiplicity.md" >}})|Medium| O(n^2)| O(n) ||45.4%| -|0925|Long Pressed Name|[Go]({{< relref "/ChapterFour/0900~0999/0925.Long-Pressed-Name.md" >}})|Easy| O(n)| O(1)||34.6%| -|0942|DI String Match|[Go]({{< relref "/ChapterFour/0900~0999/0942.DI-String-Match.md" >}})|Easy||||75.9%| -|0969|Pancake Sorting|[Go]({{< relref "/ChapterFour/0900~0999/0969.Pancake-Sorting.md" >}})|Medium||||69.7%| -|0977|Squares of a Sorted Array|[Go]({{< relref "/ChapterFour/0900~0999/0977.Squares-of-a-Sorted-Array.md" >}})|Easy| O(n)| O(1)||71.6%| -|0986|Interval List Intersections|[Go]({{< relref "/ChapterFour/0900~0999/0986.Interval-List-Intersections.md" >}})|Medium| O(n)| O(1)||71.1%| -|1040|Moving Stones Until Consecutive II|[Go]({{< relref "/ChapterFour/1000~1099/1040.Moving-Stones-Until-Consecutive-II.md" >}})|Medium||||55.6%| -|1048|Longest String Chain|[Go]({{< relref "/ChapterFour/1000~1099/1048.Longest-String-Chain.md" >}})|Medium||||57.8%| -|1089|Duplicate Zeros|[Go]({{< relref "/ChapterFour/1000~1099/1089.Duplicate-Zeros.md" >}})|Easy||||51.1%| -|1093|Statistics from a Large Sample|[Go]({{< relref "/ChapterFour/1000~1099/1093.Statistics-from-a-Large-Sample.md" >}})|Medium| O(n)| O(1) ||45.8%| -|1332|Remove Palindromic Subsequences|[Go]({{< relref "/ChapterFour/1300~1399/1332.Remove-Palindromic-Subsequences.md" >}})|Easy||||69.6%| -|1385|Find the Distance Value Between Two Arrays|[Go]({{< relref "/ChapterFour/1300~1399/1385.Find-the-Distance-Value-Between-Two-Arrays.md" >}})|Easy||||65.9%| -|1679|Max Number of K-Sum Pairs|[Go]({{< relref "/ChapterFour/1600~1699/1679.Max-Number-of-K-Sum-Pairs.md" >}})|Medium||||57.7%| -|1721|Swapping Nodes in a Linked List|[Go]({{< relref "/ChapterFour/1700~1799/1721.Swapping-Nodes-in-a-Linked-List.md" >}})|Medium||||68.4%| -|1877|Minimize Maximum Pair Sum in Array|[Go]({{< relref "/ChapterFour/1800~1899/1877.Minimize-Maximum-Pair-Sum-in-Array.md" >}})|Medium||||80.7%| +|0011|Container With Most Water|[Go]({{< relref "/ChapterFour/0001~0099/0011.Container-With-Most-Water.md" >}})|Medium| O(n)| O(1)||54.0%| +|0015|3Sum|[Go]({{< relref "/ChapterFour/0001~0099/0015.3Sum.md" >}})|Medium| O(n^2)| O(n)|❤️|32.6%| +|0016|3Sum Closest|[Go]({{< relref "/ChapterFour/0001~0099/0016.3Sum-Closest.md" >}})|Medium| O(n^2)| O(1)|❤️|45.8%| +|0018|4Sum|[Go]({{< relref "/ChapterFour/0001~0099/0018.4Sum.md" >}})|Medium| O(n^3)| O(n^2)|❤️|35.9%| +|0019|Remove Nth Node From End of List|[Go]({{< relref "/ChapterFour/0001~0099/0019.Remove-Nth-Node-From-End-of-List.md" >}})|Medium| O(n)| O(1)||41.0%| +|0026|Remove Duplicates from Sorted Array|[Go]({{< relref "/ChapterFour/0001~0099/0026.Remove-Duplicates-from-Sorted-Array.md" >}})|Easy| O(n)| O(1)||51.5%| +|0027|Remove Element|[Go]({{< relref "/ChapterFour/0001~0099/0027.Remove-Element.md" >}})|Easy| O(n)| O(1)||53.0%| +|0028|Find the Index of the First Occurrence in a String|[Go]({{< relref "/ChapterFour/0001~0099/0028.Find-the-Index-of-the-First-Occurrence-in-a-String.md" >}})|Easy| O(n)| O(1)||39.0%| +|0031|Next Permutation|[Go]({{< relref "/ChapterFour/0001~0099/0031.Next-Permutation.md" >}})|Medium||||37.5%| +|0042|Trapping Rain Water|[Go]({{< relref "/ChapterFour/0001~0099/0042.Trapping-Rain-Water.md" >}})|Hard| O(n)| O(1)|❤️|59.2%| +|0061|Rotate List|[Go]({{< relref "/ChapterFour/0001~0099/0061.Rotate-List.md" >}})|Medium| O(n)| O(1)||36.1%| +|0075|Sort Colors|[Go]({{< relref "/ChapterFour/0001~0099/0075.Sort-Colors.md" >}})|Medium| O(n)| O(1)|❤️|58.5%| +|0080|Remove Duplicates from Sorted Array II|[Go]({{< relref "/ChapterFour/0001~0099/0080.Remove-Duplicates-from-Sorted-Array-II.md" >}})|Medium| O(n)| O(1||52.3%| +|0082|Remove Duplicates from Sorted List II|[Go]({{< relref "/ChapterFour/0001~0099/0082.Remove-Duplicates-from-Sorted-List-II.md" >}})|Medium||||45.9%| +|0086|Partition List|[Go]({{< relref "/ChapterFour/0001~0099/0086.Partition-List.md" >}})|Medium| O(n)| O(1)|❤️|52.0%| +|0088|Merge Sorted Array|[Go]({{< relref "/ChapterFour/0001~0099/0088.Merge-Sorted-Array.md" >}})|Easy| O(n)| O(1)|❤️|46.6%| +|0125|Valid Palindrome|[Go]({{< relref "/ChapterFour/0100~0199/0125.Valid-Palindrome.md" >}})|Easy| O(n)| O(1)||44.3%| +|0141|Linked List Cycle|[Go]({{< relref "/ChapterFour/0100~0199/0141.Linked-List-Cycle.md" >}})|Easy| O(n)| O(1)|❤️|47.4%| +|0142|Linked List Cycle II|[Go]({{< relref "/ChapterFour/0100~0199/0142.Linked-List-Cycle-II.md" >}})|Medium| O(n)| O(1)|❤️|48.7%| +|0143|Reorder List|[Go]({{< relref "/ChapterFour/0100~0199/0143.Reorder-List.md" >}})|Medium||||52.5%| +|0148|Sort List|[Go]({{< relref "/ChapterFour/0100~0199/0148.Sort-List.md" >}})|Medium||||55.1%| +|0151|Reverse Words in a String|[Go]({{< relref "/ChapterFour/0100~0199/0151.Reverse-Words-in-a-String.md" >}})|Medium||||32.7%| +|0160|Intersection of Two Linked Lists|[Go]({{< relref "/ChapterFour/0100~0199/0160.Intersection-of-Two-Linked-Lists.md" >}})|Easy||||54.3%| +|0167|Two Sum II - Input Array Is Sorted|[Go]({{< relref "/ChapterFour/0100~0199/0167.Two-Sum-II-Input-Array-Is-Sorted.md" >}})|Medium| O(n)| O(1)||60.0%| +|0189|Rotate Array|[Go]({{< relref "/ChapterFour/0100~0199/0189.Rotate-Array.md" >}})|Medium||||39.4%| +|0202|Happy Number|[Go]({{< relref "/ChapterFour/0200~0299/0202.Happy-Number.md" >}})|Easy||||54.8%| +|0234|Palindrome Linked List|[Go]({{< relref "/ChapterFour/0200~0299/0234.Palindrome-Linked-List.md" >}})|Easy| O(n)| O(1)||50.2%| +|0283|Move Zeroes|[Go]({{< relref "/ChapterFour/0200~0299/0283.Move-Zeroes.md" >}})|Easy| O(n)| O(1)||61.4%| +|0287|Find the Duplicate Number|[Go]({{< relref "/ChapterFour/0200~0299/0287.Find-the-Duplicate-Number.md" >}})|Medium| O(n)| O(1)|❤️|59.1%| +|0344|Reverse String|[Go]({{< relref "/ChapterFour/0300~0399/0344.Reverse-String.md" >}})|Easy| O(n)| O(1)||76.7%| +|0345|Reverse Vowels of a String|[Go]({{< relref "/ChapterFour/0300~0399/0345.Reverse-Vowels-of-a-String.md" >}})|Easy| O(n)| O(1)||50.1%| +|0349|Intersection of Two Arrays|[Go]({{< relref "/ChapterFour/0300~0399/0349.Intersection-of-Two-Arrays.md" >}})|Easy| O(n)| O(n) ||70.9%| +|0350|Intersection of Two Arrays II|[Go]({{< relref "/ChapterFour/0300~0399/0350.Intersection-of-Two-Arrays-II.md" >}})|Easy| O(n)| O(n) ||56.0%| +|0392|Is Subsequence|[Go]({{< relref "/ChapterFour/0300~0399/0392.Is-Subsequence.md" >}})|Easy||||47.6%| +|0455|Assign Cookies|[Go]({{< relref "/ChapterFour/0400~0499/0455.Assign-Cookies.md" >}})|Easy||||49.9%| +|0457|Circular Array Loop|[Go]({{< relref "/ChapterFour/0400~0499/0457.Circular-Array-Loop.md" >}})|Medium||||32.6%| +|0475|Heaters|[Go]({{< relref "/ChapterFour/0400~0499/0475.Heaters.md" >}})|Medium||||36.5%| +|0524|Longest Word in Dictionary through Deleting|[Go]({{< relref "/ChapterFour/0500~0599/0524.Longest-Word-in-Dictionary-through-Deleting.md" >}})|Medium| O(n)| O(1) ||51.0%| +|0532|K-diff Pairs in an Array|[Go]({{< relref "/ChapterFour/0500~0599/0532.K-diff-Pairs-in-an-Array.md" >}})|Medium| O(n)| O(n)||41.2%| +|0541|Reverse String II|[Go]({{< relref "/ChapterFour/0500~0599/0541.Reverse-String-II.md" >}})|Easy||||50.5%| +|0557|Reverse Words in a String III|[Go]({{< relref "/ChapterFour/0500~0599/0557.Reverse-Words-in-a-String-III.md" >}})|Easy||||81.9%| +|0567|Permutation in String|[Go]({{< relref "/ChapterFour/0500~0599/0567.Permutation-in-String.md" >}})|Medium| O(n)| O(1)|❤️|44.3%| +|0581|Shortest Unsorted Continuous Subarray|[Go]({{< relref "/ChapterFour/0500~0599/0581.Shortest-Unsorted-Continuous-Subarray.md" >}})|Medium||||36.4%| +|0611|Valid Triangle Number|[Go]({{< relref "/ChapterFour/0600~0699/0611.Valid-Triangle-Number.md" >}})|Medium||||50.5%| +|0633|Sum of Square Numbers|[Go]({{< relref "/ChapterFour/0600~0699/0633.Sum-of-Square-Numbers.md" >}})|Medium||||34.4%| +|0653|Two Sum IV - Input is a BST|[Go]({{< relref "/ChapterFour/0600~0699/0653.Two-Sum-IV-Input-is-a-BST.md" >}})|Easy||||61.0%| +|0658|Find K Closest Elements|[Go]({{< relref "/ChapterFour/0600~0699/0658.Find-K-Closest-Elements.md" >}})|Medium||||46.8%| +|0696|Count Binary Substrings|[Go]({{< relref "/ChapterFour/0600~0699/0696.Count-Binary-Substrings.md" >}})|Easy||||65.5%| +|0719|Find K-th Smallest Pair Distance|[Go]({{< relref "/ChapterFour/0700~0799/0719.Find-K-th-Smallest-Pair-Distance.md" >}})|Hard||||36.7%| +|0763|Partition Labels|[Go]({{< relref "/ChapterFour/0700~0799/0763.Partition-Labels.md" >}})|Medium| O(n)| O(1)|❤️|79.7%| +|0795|Number of Subarrays with Bounded Maximum|[Go]({{< relref "/ChapterFour/0700~0799/0795.Number-of-Subarrays-with-Bounded-Maximum.md" >}})|Medium||||52.8%| +|0821|Shortest Distance to a Character|[Go]({{< relref "/ChapterFour/0800~0899/0821.Shortest-Distance-to-a-Character.md" >}})|Easy||||71.3%| +|0825|Friends Of Appropriate Ages|[Go]({{< relref "/ChapterFour/0800~0899/0825.Friends-Of-Appropriate-Ages.md" >}})|Medium||||46.3%| +|0826|Most Profit Assigning Work|[Go]({{< relref "/ChapterFour/0800~0899/0826.Most-Profit-Assigning-Work.md" >}})|Medium| O(n log n)| O(n)||44.9%| +|0832|Flipping an Image|[Go]({{< relref "/ChapterFour/0800~0899/0832.Flipping-an-Image.md" >}})|Easy||||80.8%| +|0838|Push Dominoes|[Go]({{< relref "/ChapterFour/0800~0899/0838.Push-Dominoes.md" >}})|Medium| O(n)| O(n)||57.0%| +|0844|Backspace String Compare|[Go]({{< relref "/ChapterFour/0800~0899/0844.Backspace-String-Compare.md" >}})|Easy| O(n)| O(n) ||48.1%| +|0845|Longest Mountain in Array|[Go]({{< relref "/ChapterFour/0800~0899/0845.Longest-Mountain-in-Array.md" >}})|Medium| O(n)| O(1) ||40.2%| +|0870|Advantage Shuffle|[Go]({{< relref "/ChapterFour/0800~0899/0870.Advantage-Shuffle.md" >}})|Medium||||51.8%| +|0876|Middle of the Linked List|[Go]({{< relref "/ChapterFour/0800~0899/0876.Middle-of-the-Linked-List.md" >}})|Easy||||75.6%| +|0881|Boats to Save People|[Go]({{< relref "/ChapterFour/0800~0899/0881.Boats-to-Save-People.md" >}})|Medium| O(n log n)| O(1) ||53.1%| +|0922|Sort Array By Parity II|[Go]({{< relref "/ChapterFour/0900~0999/0922.Sort-Array-By-Parity-II.md" >}})|Easy||||70.7%| +|0923|3Sum With Multiplicity|[Go]({{< relref "/ChapterFour/0900~0999/0923.3Sum-With-Multiplicity.md" >}})|Medium| O(n^2)| O(n) ||45.3%| +|0925|Long Pressed Name|[Go]({{< relref "/ChapterFour/0900~0999/0925.Long-Pressed-Name.md" >}})|Easy| O(n)| O(1)||33.1%| +|0942|DI String Match|[Go]({{< relref "/ChapterFour/0900~0999/0942.DI-String-Match.md" >}})|Easy||||77.3%| +|0969|Pancake Sorting|[Go]({{< relref "/ChapterFour/0900~0999/0969.Pancake-Sorting.md" >}})|Medium||||70.1%| +|0977|Squares of a Sorted Array|[Go]({{< relref "/ChapterFour/0900~0999/0977.Squares-of-a-Sorted-Array.md" >}})|Easy| O(n)| O(1)||71.9%| +|0986|Interval List Intersections|[Go]({{< relref "/ChapterFour/0900~0999/0986.Interval-List-Intersections.md" >}})|Medium| O(n)| O(1)||71.3%| +|1040|Moving Stones Until Consecutive II|[Go]({{< relref "/ChapterFour/1000~1099/1040.Moving-Stones-Until-Consecutive-II.md" >}})|Medium||||55.9%| +|1048|Longest String Chain|[Go]({{< relref "/ChapterFour/1000~1099/1048.Longest-String-Chain.md" >}})|Medium||||59.2%| +|1089|Duplicate Zeros|[Go]({{< relref "/ChapterFour/1000~1099/1089.Duplicate-Zeros.md" >}})|Easy||||51.5%| +|1332|Remove Palindromic Subsequences|[Go]({{< relref "/ChapterFour/1300~1399/1332.Remove-Palindromic-Subsequences.md" >}})|Easy||||76.2%| +|1385|Find the Distance Value Between Two Arrays|[Go]({{< relref "/ChapterFour/1300~1399/1385.Find-the-Distance-Value-Between-Two-Arrays.md" >}})|Easy||||66.5%| +|1679|Max Number of K-Sum Pairs|[Go]({{< relref "/ChapterFour/1600~1699/1679.Max-Number-of-K-Sum-Pairs.md" >}})|Medium||||57.3%| +|1721|Swapping Nodes in a Linked List|[Go]({{< relref "/ChapterFour/1700~1799/1721.Swapping-Nodes-in-a-Linked-List.md" >}})|Medium||||67.2%| +|1877|Minimize Maximum Pair Sum in Array|[Go]({{< relref "/ChapterFour/1800~1899/1877.Minimize-Maximum-Pair-Sum-in-Array.md" >}})|Medium||||79.9%| |------------|-------------------------------------------------------|-------| ----------------| ---------------|-------------|-------------|-------------| diff --git a/website/content/ChapterTwo/Union_Find.md b/website/content/ChapterTwo/Union_Find.md index da69941c1..391edabe5 100644 --- a/website/content/ChapterTwo/Union_Find.md +++ b/website/content/ChapterTwo/Union_Find.md @@ -19,32 +19,32 @@ weight: 16 | No. | Title | Solution | Difficulty | TimeComplexity | SpaceComplexity |Favorite| Acceptance | |:--------:|:------- | :--------: | :----------: | :----: | :-----: | :-----: |:-----: | -|0128|Longest Consecutive Sequence|[Go]({{< relref "/ChapterFour/0100~0199/0128.Longest-Consecutive-Sequence.md" >}})|Medium| O(n)| O(n)|❤️|48.7%| -|0130|Surrounded Regions|[Go]({{< relref "/ChapterFour/0100~0199/0130.Surrounded-Regions.md" >}})|Medium| O(m\*n)| O(m\*n)||34.0%| -|0200|Number of Islands|[Go]({{< relref "/ChapterFour/0200~0299/0200.Number-of-Islands.md" >}})|Medium| O(m\*n)| O(m\*n)||53.9%| -|0399|Evaluate Division|[Go]({{< relref "/ChapterFour/0300~0399/0399.Evaluate-Division.md" >}})|Medium| O(n)| O(n)||58.6%| -|0547|Number of Provinces|[Go]({{< relref "/ChapterFour/0500~0599/0547.Number-of-Provinces.md" >}})|Medium| O(n^2)| O(n)||62.6%| -|0684|Redundant Connection|[Go]({{< relref "/ChapterFour/0600~0699/0684.Redundant-Connection.md" >}})|Medium| O(n)| O(n)||61.1%| -|0685|Redundant Connection II|[Go]({{< relref "/ChapterFour/0600~0699/0685.Redundant-Connection-II.md" >}})|Hard| O(n)| O(n)||33.8%| -|0695|Max Area of Island|[Go]({{< relref "/ChapterFour/0600~0699/0695.Max-Area-of-Island.md" >}})|Medium||||69.7%| -|0721|Accounts Merge|[Go]({{< relref "/ChapterFour/0700~0799/0721.Accounts-Merge.md" >}})|Medium| O(n)| O(n)|❤️|55.9%| -|0765|Couples Holding Hands|[Go]({{< relref "/ChapterFour/0700~0799/0765.Couples-Holding-Hands.md" >}})|Hard| O(n)| O(n)|❤️|56.5%| -|0778|Swim in Rising Water|[Go]({{< relref "/ChapterFour/0700~0799/0778.Swim-in-Rising-Water.md" >}})|Hard| O(n^2)| O(n)|❤️|58.7%| -|0785|Is Graph Bipartite?|[Go]({{< relref "/ChapterFour/0700~0799/0785.Is-Graph-Bipartite.md" >}})|Medium||||51.6%| -|0803|Bricks Falling When Hit|[Go]({{< relref "/ChapterFour/0800~0899/0803.Bricks-Falling-When-Hit.md" >}})|Hard| O(n^2)| O(n)|❤️|33.9%| -|0839|Similar String Groups|[Go]({{< relref "/ChapterFour/0800~0899/0839.Similar-String-Groups.md" >}})|Hard| O(n^2)| O(n)||45.5%| -|0924|Minimize Malware Spread|[Go]({{< relref "/ChapterFour/0900~0999/0924.Minimize-Malware-Spread.md" >}})|Hard| O(m\*n)| O(n)||41.9%| -|0928|Minimize Malware Spread II|[Go]({{< relref "/ChapterFour/0900~0999/0928.Minimize-Malware-Spread-II.md" >}})|Hard| O(m\*n)| O(n)|❤️|42.3%| -|0947|Most Stones Removed with Same Row or Column|[Go]({{< relref "/ChapterFour/0900~0999/0947.Most-Stones-Removed-with-Same-Row-or-Column.md" >}})|Medium| O(n)| O(n)||56.3%| -|0952|Largest Component Size by Common Factor|[Go]({{< relref "/ChapterFour/0900~0999/0952.Largest-Component-Size-by-Common-Factor.md" >}})|Hard| O(n)| O(n)|❤️|40.2%| -|0959|Regions Cut By Slashes|[Go]({{< relref "/ChapterFour/0900~0999/0959.Regions-Cut-By-Slashes.md" >}})|Medium| O(n^2)| O(n^2)|❤️|68.6%| -|0990|Satisfiability of Equality Equations|[Go]({{< relref "/ChapterFour/0900~0999/0990.Satisfiability-of-Equality-Equations.md" >}})|Medium| O(n)| O(n)||50.1%| -|1020|Number of Enclaves|[Go]({{< relref "/ChapterFour/1000~1099/1020.Number-of-Enclaves.md" >}})|Medium||||62.8%| -|1202|Smallest String With Swaps|[Go]({{< relref "/ChapterFour/1200~1299/1202.Smallest-String-With-Swaps.md" >}})|Medium||||57.1%| -|1254|Number of Closed Islands|[Go]({{< relref "/ChapterFour/1200~1299/1254.Number-of-Closed-Islands.md" >}})|Medium||||63.4%| -|1319|Number of Operations to Make Network Connected|[Go]({{< relref "/ChapterFour/1300~1399/1319.Number-of-Operations-to-Make-Network-Connected.md" >}})|Medium||||57.8%| -|1579|Remove Max Number of Edges to Keep Graph Fully Traversable|[Go]({{< relref "/ChapterFour/1500~1599/1579.Remove-Max-Number-of-Edges-to-Keep-Graph-Fully-Traversable.md" >}})|Hard||||51.1%| -|1631|Path With Minimum Effort|[Go]({{< relref "/ChapterFour/1600~1699/1631.Path-With-Minimum-Effort.md" >}})|Medium||||55.0%| +|0128|Longest Consecutive Sequence|[Go]({{< relref "/ChapterFour/0100~0199/0128.Longest-Consecutive-Sequence.md" >}})|Medium| O(n)| O(n)|❤️|48.5%| +|0130|Surrounded Regions|[Go]({{< relref "/ChapterFour/0100~0199/0130.Surrounded-Regions.md" >}})|Medium| O(m\*n)| O(m\*n)||36.7%| +|0200|Number of Islands|[Go]({{< relref "/ChapterFour/0200~0299/0200.Number-of-Islands.md" >}})|Medium| O(m\*n)| O(m\*n)||57.0%| +|0399|Evaluate Division|[Go]({{< relref "/ChapterFour/0300~0399/0399.Evaluate-Division.md" >}})|Medium| O(n)| O(n)||59.6%| +|0547|Number of Provinces|[Go]({{< relref "/ChapterFour/0500~0599/0547.Number-of-Provinces.md" >}})|Medium| O(n^2)| O(n)||63.7%| +|0684|Redundant Connection|[Go]({{< relref "/ChapterFour/0600~0699/0684.Redundant-Connection.md" >}})|Medium| O(n)| O(n)||62.2%| +|0685|Redundant Connection II|[Go]({{< relref "/ChapterFour/0600~0699/0685.Redundant-Connection-II.md" >}})|Hard| O(n)| O(n)||34.1%| +|0695|Max Area of Island|[Go]({{< relref "/ChapterFour/0600~0699/0695.Max-Area-of-Island.md" >}})|Medium||||71.8%| +|0721|Accounts Merge|[Go]({{< relref "/ChapterFour/0700~0799/0721.Accounts-Merge.md" >}})|Medium| O(n)| O(n)|❤️|56.3%| +|0765|Couples Holding Hands|[Go]({{< relref "/ChapterFour/0700~0799/0765.Couples-Holding-Hands.md" >}})|Hard| O(n)| O(n)|❤️|56.6%| +|0778|Swim in Rising Water|[Go]({{< relref "/ChapterFour/0700~0799/0778.Swim-in-Rising-Water.md" >}})|Hard| O(n^2)| O(n)|❤️|59.8%| +|0785|Is Graph Bipartite?|[Go]({{< relref "/ChapterFour/0700~0799/0785.Is-Graph-Bipartite.md" >}})|Medium||||53.1%| +|0803|Bricks Falling When Hit|[Go]({{< relref "/ChapterFour/0800~0899/0803.Bricks-Falling-When-Hit.md" >}})|Hard| O(n^2)| O(n)|❤️|34.4%| +|0839|Similar String Groups|[Go]({{< relref "/ChapterFour/0800~0899/0839.Similar-String-Groups.md" >}})|Hard| O(n^2)| O(n)||48.0%| +|0924|Minimize Malware Spread|[Go]({{< relref "/ChapterFour/0900~0999/0924.Minimize-Malware-Spread.md" >}})|Hard| O(m\*n)| O(n)||42.1%| +|0928|Minimize Malware Spread II|[Go]({{< relref "/ChapterFour/0900~0999/0928.Minimize-Malware-Spread-II.md" >}})|Hard| O(m\*n)| O(n)|❤️|42.7%| +|0947|Most Stones Removed with Same Row or Column|[Go]({{< relref "/ChapterFour/0900~0999/0947.Most-Stones-Removed-with-Same-Row-or-Column.md" >}})|Medium| O(n)| O(n)||58.9%| +|0952|Largest Component Size by Common Factor|[Go]({{< relref "/ChapterFour/0900~0999/0952.Largest-Component-Size-by-Common-Factor.md" >}})|Hard| O(n)| O(n)|❤️|40.0%| +|0959|Regions Cut By Slashes|[Go]({{< relref "/ChapterFour/0900~0999/0959.Regions-Cut-By-Slashes.md" >}})|Medium| O(n^2)| O(n^2)|❤️|69.1%| +|0990|Satisfiability of Equality Equations|[Go]({{< relref "/ChapterFour/0900~0999/0990.Satisfiability-of-Equality-Equations.md" >}})|Medium| O(n)| O(n)||50.5%| +|1020|Number of Enclaves|[Go]({{< relref "/ChapterFour/1000~1099/1020.Number-of-Enclaves.md" >}})|Medium||||65.5%| +|1202|Smallest String With Swaps|[Go]({{< relref "/ChapterFour/1200~1299/1202.Smallest-String-With-Swaps.md" >}})|Medium||||57.7%| +|1254|Number of Closed Islands|[Go]({{< relref "/ChapterFour/1200~1299/1254.Number-of-Closed-Islands.md" >}})|Medium||||64.1%| +|1319|Number of Operations to Make Network Connected|[Go]({{< relref "/ChapterFour/1300~1399/1319.Number-of-Operations-to-Make-Network-Connected.md" >}})|Medium||||62.1%| +|1579|Remove Max Number of Edges to Keep Graph Fully Traversable|[Go]({{< relref "/ChapterFour/1500~1599/1579.Remove-Max-Number-of-Edges-to-Keep-Graph-Fully-Traversable.md" >}})|Hard||||53.2%| +|1631|Path With Minimum Effort|[Go]({{< relref "/ChapterFour/1600~1699/1631.Path-With-Minimum-Effort.md" >}})|Medium||||55.7%| |------------|-------------------------------------------------------|-------| ----------------| ---------------|-------------|-------------|-------------| diff --git a/website/content/_index.md b/website/content/_index.md index e9a44e0b5..50500e868 100644 --- a/website/content/_index.md +++ b/website/content/_index.md @@ -34,7 +34,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 +48,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%。这题就如同没做一样。而且面试中如果给了这样的答案,面试官也不会满意,“还有没有更优解?”。如果通过自己的思考能给出更优解,面试官会更满意一些。