diff --git a/.gitignore b/.gitignore new file mode 100644 index 00000000..405ec2c3 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +*.toml diff --git a/README.md b/README.md index 3be41f97..4050896c 100755 --- a/README.md +++ b/README.md @@ -82,6 +82,9 @@ * [✅ Segment Tree](#segment-tree) * [✅ Binary Indexed Tree](#binary-indexed-tree) +
+
+ | 数据结构 | 变种 | 相关题目 | 讲解文章 | |:-------:|:-------|:------|:------| |顺序线性表:向量|||| @@ -118,9 +121,20 @@ ## LeetCode Problems -## 一. 目录 +## 一. 个人数据 -以下已经收录了 559 道题的题解,还有 11 道题在尝试优化到 beats 100% +| | Easy | Medium | Hard | Total | +|:--------:|:--------:|:--------:|:--------:|:--------:| +|Optimizing|39|44|15|98| +|Accepted|**249**|**314**|**95**|**658**| +|Total|457|901|365|1723| +|Perfection Rate|84.3%|86.0%|84.2%|85.1%| +|Completion Rate|54.5%|34.9%|26.0%|38.2%| +|------------|----------------------------|----------------------------|----------------------------|----------------------------| + +## 二. 目录 + +以下已经收录了 560 道题的题解,还有 11 道题在尝试优化到 beats 100% | No. | Title | Solution | Acceptance | Difficulty | Frequency | |:--------:|:--------------------------------------------------------------|:--------:|:--------:|:--------:|:--------:| @@ -134,9 +148,9 @@ |0008|String to Integer (atoi)||15.6%|Medium|| |0009|Palindrome Number|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0009.Palindrome-Number)|49.4%|Easy|| |0010|Regular Expression Matching||27.2%|Hard|| -|0011|Container With Most Water|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0011.Container-With-Most-Water)|52.1%|Medium|| +|0011|Container With Most Water|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0011.Container-With-Most-Water)|52.2%|Medium|| |0012|Integer to Roman||55.9%|Medium|| -|0013|Roman to Integer|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0013.Roman-to-Integer)|56.3%|Easy|| +|0013|Roman to Integer|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0013.Roman-to-Integer)|56.4%|Easy|| |0014|Longest Common Prefix||36.0%|Easy|| |0015|3Sum|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0015.3Sum)|27.7%|Medium|| |0016|3Sum Closest|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0016.3Sum-Closest)|46.2%|Medium|| @@ -159,7 +173,7 @@ |0033|Search in Rotated Sorted Array|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0033.Search-in-Rotated-Sorted-Array)|35.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)|37.1%|Medium|| |0035|Search Insert Position|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0035.Search-Insert-Position)|42.8%|Easy|| -|0036|Valid Sudoku|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0036.Valid-Sudoku)|50.1%|Medium|| +|0036|Valid Sudoku|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0036.Valid-Sudoku)|50.2%|Medium|| |0037|Sudoku Solver|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0037.Sudoku-Solver)|45.9%|Hard|| |0038|Count and Say||45.8%|Easy|| |0039|Combination Sum|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0039.Combination-Sum)|58.7%|Medium|| @@ -175,10 +189,10 @@ |0049|Group Anagrams|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0049.Group-Anagrams)|58.8%|Medium|| |0050|Pow(x, n)|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0050.Pow(x,-n))|30.8%|Medium|| |0051|N-Queens|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0051.N-Queens)|49.0%|Hard|| -|0052|N-Queens II|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0052.N-Queens-II)|59.6%|Hard|| +|0052|N-Queens II|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0052.N-Queens-II)|59.7%|Hard|| |0053|Maximum Subarray|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0053.Maximum-Subarray)|47.5%|Easy|| |0054|Spiral Matrix|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0054.Spiral-Matrix)|35.5%|Medium|| -|0055|Jump Game|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0055.Jump-Game)|35.0%|Medium|| +|0055|Jump Game|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0055.Jump-Game)|35.1%|Medium|| |0056|Merge Intervals|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0056.Merge-Intervals)|40.6%|Medium|| |0057|Insert Interval|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0057.Insert-Interval)|34.8%|Medium|| |0058|Length of Last Word||33.4%|Easy|| @@ -195,29 +209,29 @@ |0069|Sqrt(x)|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0069.Sqrt(x))|34.8%|Easy|| |0070|Climbing Stairs|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0070.Climbing-Stairs)|48.5%|Easy|| |0071|Simplify Path|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0071.Simplify-Path)|33.6%|Medium|| -|0072|Edit Distance||46.3%|Hard|| +|0072|Edit Distance||46.4%|Hard|| |0073|Set Matrix Zeroes||44.0%|Medium|| |0074|Search a 2D Matrix|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0074.Search-a-2D-Matrix)|37.3%|Medium|| |0075|Sort Colors|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0075.Sort-Colors)|48.9%|Medium|| |0076|Minimum Window Substring|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0076.Minimum-Window-Substring)|35.7%|Hard|| -|0077|Combinations|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0077.Combinations)|56.8%|Medium|| +|0077|Combinations|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0077.Combinations)|56.9%|Medium|| |0078|Subsets|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0078.Subsets)|64.4%|Medium|| |0079|Word Search|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0079.Word-Search)|36.5%|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)|45.8%|Medium|| -|0081|Search in Rotated Sorted Array II|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0081.Search-in-Rotated-Sorted-Array-II)|33.4%|Medium|| +|0081|Search in Rotated Sorted Array II|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0081.Search-in-Rotated-Sorted-Array-II)|33.5%|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)|38.9%|Medium|| |0083|Remove Duplicates from Sorted List|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0083.Remove-Duplicates-from-Sorted-List)|46.3%|Easy|| |0084|Largest Rectangle in Histogram|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0084.Largest-Rectangle-in-Histogram)|36.7%|Hard|| |0085|Maximal Rectangle||39.1%|Hard|| |0086|Partition List|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0086.Partition-List)|43.0%|Medium|| |0087|Scramble String||34.5%|Hard|| -|0088|Merge Sorted Array|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0088.Merge-Sorted-Array)|40.3%|Easy|| +|0088|Merge Sorted Array|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0088.Merge-Sorted-Array)|40.5%|Easy|| |0089|Gray Code|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0089.Gray-Code)|50.0%|Medium|| |0090|Subsets II|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0090.Subsets-II)|48.5%|Medium|| |0091|Decode Ways|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0091.Decode-Ways)|26.2%|Medium|| |0092|Reverse Linked List II|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0092.Reverse-Linked-List-II)|40.2%|Medium|| |0093|Restore IP Addresses|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0093.Restore-IP-Addresses)|37.2%|Medium|| -|0094|Binary Tree Inorder Traversal|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0094.Binary-Tree-Inorder-Traversal)|65.3%|Medium|| +|0094|Binary Tree Inorder Traversal|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0094.Binary-Tree-Inorder-Traversal)|65.4%|Medium|| |0095|Unique Binary Search Trees II|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0095.Unique-Binary-Search-Trees-II)|42.0%|Medium|| |0096|Unique Binary Search Trees|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0096.Unique-Binary-Search-Trees)|54.1%|Medium|| |0097|Interleaving String||32.4%|Hard|| @@ -228,7 +242,7 @@ |0102|Binary Tree Level Order Traversal|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0102.Binary-Tree-Level-Order-Traversal)|56.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)|49.7%|Medium|| |0104|Maximum Depth of Binary Tree|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0104.Maximum-Depth-of-Binary-Tree)|67.7%|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)|51.1%|Medium|| +|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)|51.2%|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)|49.1%|Medium|| |0107|Binary Tree Level Order Traversal II|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0107.Binary-Tree-Level-Order-Traversal-II)|54.8%|Easy|| |0108|Convert Sorted Array to Binary Search Tree|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0108.Convert-Sorted-Array-to-Binary-Search-Tree)|59.9%|Easy|| @@ -240,7 +254,7 @@ |0114|Flatten Binary Tree to Linked List|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0114.Flatten-Binary-Tree-to-Linked-List)|51.4%|Medium|| |0115|Distinct Subsequences||39.4%|Hard|| |0116|Populating Next Right Pointers in Each Node||48.4%|Medium|| -|0117|Populating Next Right Pointers in Each Node II||41.6%|Medium|| +|0117|Populating Next Right Pointers in Each Node II||41.7%|Medium|| |0118|Pascal's Triangle|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0118.Pascal's-Triangle)|54.3%|Easy|| |0119|Pascal's Triangle II||51.8%|Easy|| |0120|Triangle|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0120.Triangle)|45.4%|Medium|| @@ -254,7 +268,7 @@ |0128|Longest Consecutive Sequence|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0128.Longest-Consecutive-Sequence)|46.0%|Hard|| |0129|Sum Root to Leaf Numbers|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0129.Sum-Root-to-Leaf-Numbers)|50.5%|Medium|| |0130|Surrounded Regions|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0130.Surrounded-Regions)|29.1%|Medium|| -|0131|Palindrome Partitioning|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0131.Palindrome-Partitioning)|51.2%|Medium|| +|0131|Palindrome Partitioning|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0131.Palindrome-Partitioning)|51.3%|Medium|| |0132|Palindrome Partitioning II||31.0%|Hard|| |0133|Clone Graph||38.4%|Medium|| |0134|Gas Station||40.9%|Medium|| @@ -272,8 +286,8 @@ |0146|LRU Cache|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0146.LRU-Cache)|35.2%|Medium|| |0147|Insertion Sort List|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0147.Insertion-Sort-List)|44.1%|Medium|| |0148|Sort List|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0148.Sort-List)|45.8%|Medium|| -|0149|Max Points on a Line||17.2%|Hard|| -|0150|Evaluate Reverse Polish Notation|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0150.Evaluate-Reverse-Polish-Notation)|37.5%|Medium|| +|0149|Max Points on a Line||17.3%|Hard|| +|0150|Evaluate Reverse Polish Notation|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0150.Evaluate-Reverse-Polish-Notation)|37.6%|Medium|| |0151|Reverse Words in a String|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0151.Reverse-Words-in-a-String)|23.3%|Medium|| |0152|Maximum Product Subarray|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0152.Maximum-Product-Subarray)|32.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)|45.9%|Medium|| @@ -289,26 +303,26 @@ |0163|Missing Ranges||26.4%|Easy|| |0164|Maximum Gap|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0164.Maximum-Gap)|36.6%|Hard|| |0165|Compare Version Numbers||30.1%|Medium|| -|0166|Fraction to Recurring Decimal||22.1%|Medium|| +|0166|Fraction to Recurring Decimal||22.2%|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)|55.4%|Easy|| |0168|Excel Sheet Column Title|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0168.Excel-Sheet-Column-Title)|31.6%|Easy|| |0169|Majority Element|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0169.Majority-Element)|59.8%|Easy|| |0170|Two Sum III - Data structure design||34.7%|Easy|| |0171|Excel Sheet Column Number|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0171.Excel-Sheet-Column-Number)|56.7%|Easy|| |0172|Factorial Trailing Zeroes|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0172.Factorial-Trailing-Zeroes)|38.3%|Easy|| -|0173|Binary Search Tree Iterator|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0173.Binary-Search-Tree-Iterator)|59.5%|Medium|| +|0173|Binary Search Tree Iterator|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0173.Binary-Search-Tree-Iterator)|59.6%|Medium|| |0174|Dungeon Game|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0174.Dungeon-Game)|33.1%|Hard|| |0175|Combine Two Tables||63.4%|Easy|| |0176|Second Highest Salary||32.9%|Easy|| |0177|Nth Highest Salary||32.9%|Medium|| -|0178|Rank Scores||49.1%|Medium|| +|0178|Rank Scores||49.2%|Medium|| |0179|Largest Number|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0179.Largest-Number)|30.4%|Medium|| -|0180|Consecutive Numbers||41.6%|Medium|| -|0181|Employees Earning More Than Their Managers||59.5%|Easy|| +|0180|Consecutive Numbers||41.7%|Medium|| +|0181|Employees Earning More Than Their Managers||59.6%|Easy|| |0182|Duplicate Emails||64.0%|Easy|| |0183|Customers Who Never Order||56.1%|Easy|| |0184|Department Highest Salary||39.3%|Medium|| -|0185|Department Top Three Salaries||37.9%|Hard|| +|0185|Department Top Three Salaries||38.0%|Hard|| |0186|Reverse Words in a String II||45.0%|Medium|| |0187|Repeated DNA Sequences|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0187.Repeated-DNA-Sequences)|41.2%|Medium|| |0188|Best Time to Buy and Sell Stock IV||29.3%|Hard|| @@ -345,11 +359,11 @@ |0219|Contains Duplicate II|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0219.Contains-Duplicate-II)|38.5%|Easy|| |0220|Contains Duplicate III|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0220.Contains-Duplicate-III)|21.3%|Medium|| |0221|Maximal Square||38.7%|Medium|| -|0222|Count Complete Tree Nodes|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0222.Count-Complete-Tree-Nodes)|48.7%|Medium|| +|0222|Count Complete Tree Nodes|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0222.Count-Complete-Tree-Nodes)|48.8%|Medium|| |0223|Rectangle Area|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0223.Rectangle-Area)|38.1%|Medium|| |0224|Basic Calculator|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0224.Basic-Calculator)|38.0%|Hard|| |0225|Implement Stack using Queues|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0225.Implement-Stack-using-Queues)|46.9%|Easy|| -|0226|Invert Binary Tree|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0226.Invert-Binary-Tree)|66.5%|Easy|| +|0226|Invert Binary Tree|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0226.Invert-Binary-Tree)|66.6%|Easy|| |0227|Basic Calculator II||38.3%|Medium|| |0228|Summary Ranges|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0228.Summary-Ranges)|42.1%|Easy|| |0229|Majority Element II|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0229.Majority-Element-II)|38.5%|Medium|| @@ -373,10 +387,10 @@ |0247|Strobogrammatic Number II||48.3%|Medium|| |0248|Strobogrammatic Number III||40.1%|Hard|| |0249|Group Shifted Strings||57.6%|Medium|| -|0250|Count Univalue Subtrees||53.0%|Medium|| +|0250|Count Univalue Subtrees||53.1%|Medium|| |0251|Flatten 2D Vector||46.2%|Medium|| |0252|Meeting Rooms||55.3%|Easy|| -|0253|Meeting Rooms II||46.5%|Medium|| +|0253|Meeting Rooms II||46.6%|Medium|| |0254|Factor Combinations||47.2%|Medium|| |0255|Verify Preorder Sequence in Binary Search Tree||46.0%|Medium|| |0256|Paint House||53.2%|Medium|| @@ -394,7 +408,7 @@ |0268|Missing Number|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0268.Missing-Number)|53.3%|Easy|| |0269|Alien Dictionary||33.6%|Hard|| |0270|Closest Binary Search Tree Value||49.6%|Easy|| -|0271|Encode and Decode Strings||32.4%|Medium|| +|0271|Encode and Decode Strings||32.5%|Medium|| |0272|Closest Binary Search Tree Value II||51.9%|Hard|| |0273|Integer to English Words||27.9%|Hard|| |0274|H-Index|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0274.H-Index)|36.3%|Medium|| @@ -438,24 +452,24 @@ |0312|Burst Balloons||53.6%|Hard|| |0313|Super Ugly Number||45.9%|Medium|| |0314|Binary Tree Vertical Order Traversal||46.6%|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.5%|Hard|| +|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.6%|Hard|| |0316|Remove Duplicate Letters||38.8%|Medium|| -|0317|Shortest Distance from All Buildings||42.4%|Hard|| +|0317|Shortest Distance from All Buildings||42.5%|Hard|| |0318|Maximum Product of Word Lengths|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0318.Maximum-Product-of-Word-Lengths)|52.0%|Medium|| |0319|Bulb Switcher||45.3%|Medium|| |0320|Generalized Abbreviation||53.3%|Medium|| |0321|Create Maximum Number||27.4%|Hard|| |0322|Coin Change|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0322.Coin-Change)|36.9%|Medium|| -|0323|Number of Connected Components in an Undirected Graph||57.3%|Medium|| +|0323|Number of Connected Components in an Undirected Graph||57.4%|Medium|| |0324|Wiggle Sort II|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0324.Wiggle-Sort-II)|30.5%|Medium|| |0325|Maximum Size Subarray Sum Equals k||47.2%|Medium|| |0326|Power of Three|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0326.Power-of-Three)|42.1%|Easy|| |0327|Count of Range Sum|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0327.Count-of-Range-Sum)|35.9%|Hard|| -|0328|Odd Even Linked List|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0328.Odd-Even-Linked-List)|56.8%|Medium|| +|0328|Odd Even Linked List|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0328.Odd-Even-Linked-List)|56.9%|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)|44.4%|Hard|| |0330|Patching Array||34.9%|Hard|| |0331|Verify Preorder Serialization of a Binary Tree|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0331.Verify-Preorder-Serialization-of-a-Binary-Tree)|40.9%|Medium|| -|0332|Reconstruct Itinerary||37.6%|Medium|| +|0332|Reconstruct Itinerary||37.7%|Medium|| |0333|Largest BST Subtree||37.3%|Medium|| |0334|Increasing Triplet Subsequence||40.6%|Medium|| |0335|Self Crossing||28.5%|Hard|| @@ -467,12 +481,12 @@ |0341|Flatten Nested List Iterator||54.2%|Medium|| |0342|Power of Four|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0342.Power-of-Four)|41.6%|Easy|| |0343|Integer Break|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0343.Integer-Break)|51.0%|Medium|| -|0344|Reverse String|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0344.Reverse-String)|69.9%|Easy|| +|0344|Reverse String|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0344.Reverse-String)|70.0%|Easy|| |0345|Reverse Vowels of a String|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0345.Reverse-Vowels-of-a-String)|44.9%|Easy|| |0346|Moving Average from Data Stream||72.8%|Easy|| |0347|Top K Frequent Elements|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0347.Top-K-Frequent-Elements)|62.2%|Medium|| -|0348|Design Tic-Tac-Toe||55.3%|Medium|| -|0349|Intersection of Two Arrays|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0349.Intersection-of-Two-Arrays)|64.3%|Easy|| +|0348|Design Tic-Tac-Toe||55.4%|Medium|| +|0349|Intersection of Two Arrays|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0349.Intersection-of-Two-Arrays)|64.4%|Easy|| |0350|Intersection of Two Arrays II|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0350.Intersection-of-Two-Arrays-II)|51.9%|Easy|| |0351|Android Unlock Patterns||49.4%|Medium|| |0352|Data Stream as Disjoint Intervals||48.4%|Hard|| @@ -481,7 +495,7 @@ |0355|Design Twitter||31.1%|Medium|| |0356|Line Reflection||32.6%|Medium|| |0357|Count Numbers with Unique Digits|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0357.Count-Numbers-with-Unique-Digits)|48.7%|Medium|| -|0358|Rearrange String k Distance Apart||35.6%|Hard|| +|0358|Rearrange String k Distance Apart||35.5%|Hard|| |0359|Logger Rate Limiter||71.9%|Easy|| |0360|Sort Transformed Array||49.5%|Medium|| |0361|Bomb Enemy||46.5%|Medium|| @@ -498,7 +512,7 @@ |0372|Super Pow|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0372.Super-Pow)|36.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)|37.4%|Medium|| |0374|Guess Number Higher or Lower||44.3%|Easy|| -|0375|Guess Number Higher or Lower II||41.8%|Medium|| +|0375|Guess Number Higher or Lower II||41.9%|Medium|| |0376|Wiggle Subsequence||40.1%|Medium|| |0377|Combination Sum IV||45.9%|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)|55.8%|Medium|| @@ -522,14 +536,14 @@ |0396|Rotate Function||36.6%|Medium|| |0397|Integer Replacement|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0397.Integer-Replacement)|33.4%|Medium|| |0398|Random Pick Index||57.5%|Medium|| -|0399|Evaluate Division|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0399.Evaluate-Division)|53.9%|Medium|| +|0399|Evaluate Division|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0399.Evaluate-Division)|54.0%|Medium|| |0400|Nth Digit||32.3%|Medium|| |0401|Binary Watch|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0401.Binary-Watch)|48.3%|Easy|| |0402|Remove K Digits|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0402.Remove-K-Digits)|28.6%|Medium|| |0403|Frog Jump||41.1%|Hard|| |0404|Sum of Left Leaves|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0404.Sum-of-Left-Leaves)|52.2%|Easy|| |0405|Convert a Number to Hexadecimal|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0405.Convert-a-Number-to-Hexadecimal)|44.3%|Easy|| -|0406|Queue Reconstruction by Height||68.0%|Medium|| +|0406|Queue Reconstruction by Height||68.1%|Medium|| |0407|Trapping Rain Water II||43.8%|Hard|| |0408|Valid Word Abbreviation||31.3%|Easy|| |0409|Longest Palindrome|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0409.Longest-Palindrome)|52.1%|Easy|| @@ -549,10 +563,10 @@ |0423|Reconstruct Original Digits from English||47.4%|Medium|| |0424|Longest Repeating Character Replacement|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0424.Longest-Repeating-Character-Replacement)|48.0%|Medium|| |0425|Word Squares||49.9%|Hard|| -|0426|Convert Binary Search Tree to Sorted Doubly Linked List||60.7%|Medium|| +|0426|Convert Binary Search Tree to Sorted Doubly Linked List||60.8%|Medium|| |0427|Construct Quad Tree||62.4%|Medium|| |0428|Serialize and Deserialize N-ary Tree||61.1%|Hard|| -|0429|N-ary Tree Level Order Traversal||66.3%|Medium|| +|0429|N-ary Tree Level Order Traversal||66.4%|Medium|| |0430|Flatten a Multilevel Doubly Linked List||56.6%|Medium|| |0431|Encode N-ary Tree to Binary Tree||74.4%|Hard|| |0432|All O`one Data Structure||33.0%|Hard|| @@ -562,7 +576,7 @@ |0436|Find Right Interval|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0436.Find-Right-Interval)|48.4%|Medium|| |0437|Path Sum III|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0437.Path-Sum-III)|47.9%|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)|44.6%|Medium|| -|0439|Ternary Expression Parser||56.5%|Medium|| +|0439|Ternary Expression Parser||56.6%|Medium|| |0440|K-th Smallest in Lexicographical Order||29.7%|Hard|| |0441|Arranging Coins|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0441.Arranging-Coins)|42.3%|Easy|| |0442|Find All Duplicates in an Array||68.7%|Medium|| @@ -582,7 +596,7 @@ |0456|132 Pattern|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0456.132-Pattern)|30.6%|Medium|| |0457|Circular Array Loop|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0457.Circular-Array-Loop)|30.0%|Medium|| |0458|Poor Pigs||54.4%|Hard|| -|0459|Repeated Substring Pattern||43.2%|Easy|| +|0459|Repeated Substring Pattern||43.3%|Easy|| |0460|LFU Cache|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0460.LFU-Cache)|35.7%|Hard|| |0461|Hamming Distance|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0461.Hamming-Distance)|73.1%|Easy|| |0462|Minimum Moves to Equal Array Elements II||54.3%|Medium|| @@ -607,10 +621,10 @@ |0481|Magical String||48.0%|Medium|| |0482|License Key Formatting||43.0%|Easy|| |0483|Smallest Good Base|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0483.Smallest-Good-Base)|36.2%|Hard|| -|0484|Find Permutation||64.0%|Medium|| +|0484|Find Permutation||64.1%|Medium|| |0485|Max Consecutive Ones|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0485.Max-Consecutive-Ones)|53.2%|Easy|| |0486|Predict the Winner||48.4%|Medium|| -|0487|Max Consecutive Ones II||47.8%|Medium|| +|0487|Max Consecutive Ones II||47.9%|Medium|| |0488|Zuma Game||38.6%|Hard|| |0489|Robot Room Cleaner||72.1%|Hard|| |0490|The Maze||52.5%|Medium|| @@ -642,7 +656,7 @@ |0516|Longest Palindromic Subsequence||54.9%|Medium|| |0517|Super Washing Machines||38.5%|Hard|| |0518|Coin Change 2||51.4%|Medium|| -|0519|Random Flip Matrix||37.6%|Medium|| +|0519|Random Flip Matrix||37.7%|Medium|| |0520|Detect Capital||53.9%|Easy|| |0521|Longest Uncommon Subsequence I||58.4%|Easy|| |0522|Longest Uncommon Subsequence II||34.1%|Medium|| @@ -670,18 +684,18 @@ |0544|Output Contest Matches||75.7%|Medium|| |0545|Boundary of Binary Tree||39.4%|Medium|| |0546|Remove Boxes||44.2%|Hard|| -|0547|Number of Provinces|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0547.Number-of-Provinces)|60.0%|Medium|| -|0548|Split Array with Equal Sum||47.6%|Medium|| +|0547|Number of Provinces|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0547.Number-of-Provinces)|60.1%|Medium|| +|0548|Split Array with Equal Sum||47.7%|Medium|| |0549|Binary Tree Longest Consecutive Sequence II||47.2%|Medium|| -|0550|Game Play Analysis IV||46.1%|Medium|| +|0550|Game Play Analysis IV||46.0%|Medium|| |0551|Student Attendance Record I||46.0%|Easy|| |0552|Student Attendance Record II||37.2%|Hard|| |0553|Optimal Division||57.3%|Medium|| |0554|Brick Wall||50.6%|Medium|| -|0555|Split Concatenated Strings||42.7%|Medium|| +|0555|Split Concatenated Strings||42.8%|Medium|| |0556|Next Greater Element III||33.5%|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)|71.5%|Easy|| -|0558|Logical OR of Two Binary Grids Represented as Quad-Trees||45.5%|Medium|| +|0558|Logical OR of Two Binary Grids Represented as Quad-Trees||45.4%|Medium|| |0559|Maximum Depth of N-ary Tree||69.4%|Easy|| |0560|Subarray Sum Equals K||43.9%|Medium|| |0561|Array Partition I|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0561.Array-Partition-I)|72.8%|Easy|| @@ -694,7 +708,7 @@ |0568|Maximum Vacation Days||41.4%|Hard|| |0569|Median Employee Salary||60.9%|Hard|| |0570|Managers with at Least 5 Direct Reports||66.6%|Medium|| -|0571|Find Median Given Frequency of Numbers||45.4%|Hard|| +|0571|Find Median Given Frequency of Numbers||45.5%|Hard|| |0572|Subtree of Another Tree|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0572.Subtree-of-Another-Tree)|44.4%|Easy|| |0573|Squirrel Simulation||56.0%|Medium|| |0574|Winning Candidate||51.2%|Medium|| @@ -713,28 +727,28 @@ |0587|Erect the Fence||36.3%|Hard|| |0588|Design In-Memory File System||46.5%|Hard|| |0589|N-ary Tree Preorder Traversal||73.1%|Easy|| -|0590|N-ary Tree Postorder Traversal||73.2%|Easy|| +|0590|N-ary Tree Postorder Traversal||73.1%|Easy|| |0591|Tag Validator||34.6%|Hard|| |0592|Fraction Addition and Subtraction||50.0%|Medium|| |0593|Valid Square||43.3%|Medium|| |0594|Longest Harmonious Subsequence|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0594.Longest-Harmonious-Subsequence)|47.7%|Easy|| |0595|Big Countries||78.2%|Easy|| -|0596|Classes More Than 5 Students||38.7%|Easy|| -|0597|Friend Requests I: Overall Acceptance Rate||41.6%|Easy|| +|0596|Classes More Than 5 Students||38.6%|Easy|| +|0597|Friend Requests I: Overall Acceptance Rate||41.7%|Easy|| |0598|Range Addition II|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0598.Range-Addition-II)|50.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)|51.5%|Easy|| |0600|Non-negative Integers without Consecutive Ones||34.5%|Hard|| |0601|Human Traffic of Stadium||44.3%|Hard|| |0602|Friend Requests II: Who Has the Most Friends||56.6%|Medium|| |0603|Consecutive Available Seats||65.6%|Easy|| -|0604|Design Compressed String Iterator||38.0%|Easy|| +|0604|Design Compressed String Iterator||38.1%|Easy|| |0605|Can Place Flowers|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0605.Can-Place-Flowers)|31.9%|Easy|| |0606|Construct String from Binary Tree||55.0%|Easy|| |0607|Sales Person||64.6%|Easy|| |0608|Tree Node||69.0%|Medium|| |0609|Find Duplicate File in System||60.8%|Medium|| |0610|Triangle Judgement||67.9%|Easy|| -|0611|Valid Triangle Number||49.0%|Medium|| +|0611|Valid Triangle Number||49.1%|Medium|| |0612|Shortest Distance in a Plane||60.9%|Medium|| |0613|Shortest Distance in a Line||79.1%|Easy|| |0614|Second Degree Follower||32.1%|Medium|| @@ -742,15 +756,15 @@ |0616|Add Bold Tag in String||44.4%|Medium|| |0617|Merge Two Binary Trees||75.1%|Easy|| |0618|Students Report By Geography||58.7%|Hard|| -|0619|Biggest Single Number||44.5%|Easy|| +|0619|Biggest Single Number||44.6%|Easy|| |0620|Not Boring Movies||69.3%|Easy|| -|0621|Task Scheduler||51.4%|Medium|| +|0621|Task Scheduler||51.5%|Medium|| |0622|Design Circular Queue||45.0%|Medium|| -|0623|Add One Row to Tree||50.2%|Medium|| +|0623|Add One Row to Tree||50.3%|Medium|| |0624|Maximum Distance in Arrays||39.4%|Medium|| |0625|Minimum Factorization||32.9%|Medium|| |0626|Exchange Seats||64.9%|Medium|| -|0627|Swap Salary||77.1%|Easy|| +|0627|Swap Salary||77.2%|Easy|| |0628|Maximum Product of Three Numbers|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0628.Maximum-Product-of-Three-Numbers)|47.0%|Easy|| |0629|K Inverse Pairs Array||31.6%|Hard|| |0630|Course Schedule III||33.7%|Hard|| @@ -758,13 +772,13 @@ |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)|53.9%|Hard|| |0633|Sum of Square Numbers|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0633.Sum-of-Square-Numbers)|32.4%|Medium|| |0634|Find the Derangement of An Array||40.4%|Medium|| -|0635|Design Log Storage System||59.3%|Medium|| +|0635|Design Log Storage System||59.4%|Medium|| |0636|Exclusive Time of Functions|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0636.Exclusive-Time-of-Functions)|53.9%|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)|64.4%|Easy|| +|0637|Average of Levels in Binary Tree|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0637.Average-of-Levels-in-Binary-Tree)|64.5%|Easy|| |0638|Shopping Offers|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0638.Shopping-Offers)|52.5%|Medium|| |0639|Decode Ways II||27.4%|Hard|| |0640|Solve the Equation||42.6%|Medium|| -|0641|Design Circular Deque||54.6%|Medium|| +|0641|Design Circular Deque||54.5%|Medium|| |0642|Design Search Autocomplete System||45.9%|Hard|| |0643|Maximum Average Subarray I||42.0%|Easy|| |0644|Maximum Average Subarray II||33.9%|Hard|| @@ -777,7 +791,7 @@ |0651|4 Keys Keyboard||52.9%|Medium|| |0652|Find Duplicate Subtrees||51.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)|56.1%|Easy|| -|0654|Maximum Binary Tree||80.8%|Medium|| +|0654|Maximum Binary Tree||80.9%|Medium|| |0655|Print Binary Tree||55.8%|Medium|| |0656|Coin Path||29.5%|Hard|| |0657|Robot Return to Origin||73.6%|Easy|| @@ -794,7 +808,7 @@ |0668|Kth Smallest Number in Multiplication Table|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0668.Kth-Smallest-Number-in-Multiplication-Table)|47.6%|Hard|| |0669|Trim a Binary Search Tree||63.3%|Easy|| |0670|Maximum Swap||44.9%|Medium|| -|0671|Second Minimum Node In a Binary Tree||42.7%|Easy|| +|0671|Second Minimum Node In a Binary Tree||42.8%|Easy|| |0672|Bulb Switcher II||51.0%|Medium|| |0673|Number of Longest Increasing Subsequence||38.4%|Medium|| |0674|Longest Continuous Increasing Subsequence||46.0%|Easy|| @@ -802,7 +816,7 @@ |0676|Implement Magic Dictionary|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0676.Implement-Magic-Dictionary)|55.1%|Medium|| |0677|Map Sum Pairs||53.9%|Medium|| |0678|Valid Parenthesis String||31.5%|Medium|| -|0679|24 Game||47.0%|Hard|| +|0679|24 Game||47.1%|Hard|| |0680|Valid Palindrome II||37.0%|Easy|| |0681|Next Closest Time||45.7%|Medium|| |0682|Baseball Game|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0682.Baseball-Game)|66.0%|Easy|| @@ -838,7 +852,7 @@ |0712|Minimum ASCII Delete Sum for Two Strings||59.3%|Medium|| |0713|Subarray Product Less Than K|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0713.Subarray-Product-Less-Than-K)|40.4%|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)|55.8%|Medium|| -|0715|Range Module|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0715.Range-Module)|39.9%|Hard|| +|0715|Range Module|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0715.Range-Module)|40.0%|Hard|| |0716|Max Stack||42.9%|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)|47.6%|Easy|| |0718|Maximum Length of Repeated Subarray|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0718.Maximum-Length-of-Repeated-Subarray)|50.1%|Medium|| @@ -846,7 +860,7 @@ |0720|Longest Word in Dictionary|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0720.Longest-Word-in-Dictionary)|49.0%|Easy|| |0721|Accounts Merge|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0721.Accounts-Merge)|51.1%|Medium|| |0722|Remove Comments||35.8%|Medium|| -|0723|Candy Crush||72.2%|Medium|| +|0723|Candy Crush||72.3%|Medium|| |0724|Find Pivot Index|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0724.Find-Pivot-Index)|45.0%|Easy|| |0725|Split Linked List in Parts|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0725.Split-Linked-List-in-Parts)|52.7%|Medium|| |0726|Number of Atoms|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0726.Number-of-Atoms)|51.0%|Hard|| @@ -858,7 +872,7 @@ |0732|My Calendar III|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0732.My-Calendar-III)|61.4%|Hard|| |0733|Flood Fill|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0733.Flood-Fill)|55.8%|Easy|| |0734|Sentence Similarity||42.3%|Easy|| -|0735|Asteroid Collision|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0735.Asteroid-Collision)|43.1%|Medium|| +|0735|Asteroid Collision|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0735.Asteroid-Collision)|43.2%|Medium|| |0736|Parse Lisp Expression||49.8%|Hard|| |0737|Sentence Similarity II||46.4%|Medium|| |0738|Monotone Increasing Digits||45.5%|Medium|| @@ -869,7 +883,7 @@ |0743|Network Delay Time||45.3%|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.6%|Easy|| |0745|Prefix and Suffix Search|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0745.Prefix-and-Suffix-Search)|35.1%|Hard|| -|0746|Min Cost Climbing Stairs|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0746.Min-Cost-Climbing-Stairs)|50.8%|Easy|| +|0746|Min Cost Climbing Stairs|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0746.Min-Cost-Climbing-Stairs)|50.9%|Easy|| |0747|Largest Number At Least Twice of Others||42.8%|Easy|| |0748|Shortest Completing Word|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0748.Shortest-Completing-Word)|57.4%|Easy|| |0749|Contain Virus||47.8%|Hard|| @@ -902,7 +916,7 @@ |0776|Split BST||56.5%|Medium|| |0777|Swap Adjacent in LR String||35.5%|Medium|| |0778|Swim in Rising Water|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0778.Swim-in-Rising-Water)|54.3%|Hard|| -|0779|K-th Symbol in Grammar||38.4%|Medium|| +|0779|K-th Symbol in Grammar||38.5%|Medium|| |0780|Reaching Points||30.2%|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||46.8%|Hard|| @@ -951,7 +965,7 @@ |0825|Friends Of Appropriate Ages||43.8%|Medium|| |0826|Most Profit Assigning Work|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0826.Most-Profit-Assigning-Work)|38.9%|Medium|| |0827|Making A Large Island||47.1%|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)|46.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)|46.7%|Hard|| |0829|Consecutive Numbers Sum||39.3%|Hard|| |0830|Positions of Large Groups|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0830.Positions-of-Large-Groups)|50.2%|Easy|| |0831|Masking Personal Information||44.7%|Medium|| @@ -962,7 +976,7 @@ |0836|Rectangle Overlap|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0836.Rectangle-Overlap)|45.2%|Easy|| |0837|New 21 Game||35.3%|Medium|| |0838|Push Dominoes|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0838.Push-Dominoes)|49.6%|Medium|| -|0839|Similar String Groups|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0839.Similar-String-Groups)|39.9%|Hard|| +|0839|Similar String Groups|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0839.Similar-String-Groups)|40.0%|Hard|| |0840|Magic Squares In Grid||37.8%|Medium|| |0841|Keys and Rooms|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0841.Keys-and-Rooms)|65.2%|Medium|| |0842|Split Array into Fibonacci Sequence|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0842.Split-Array-into-Fibonacci-Sequence)|36.6%|Medium|| @@ -979,14 +993,14 @@ |0853|Car Fleet|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0853.Car-Fleet)|43.5%|Medium|| |0854|K-Similar Strings||38.7%|Hard|| |0855|Exam Room||43.4%|Medium|| -|0856|Score of Parentheses|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0856.Score-of-Parentheses)|62.1%|Medium|| +|0856|Score of Parentheses|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0856.Score-of-Parentheses)|62.2%|Medium|| |0857|Minimum Cost to Hire K Workers||50.3%|Hard|| |0858|Mirror Reflection||59.5%|Medium|| |0859|Buddy Strings||29.7%|Easy|| |0860|Lemonade Change||51.9%|Easy|| |0861|Score After Flipping Matrix||73.4%|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)|25.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)|57.4%|Medium|| +|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)|57.5%|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)|41.5%|Hard|| |0865|Smallest Subtree with all the Deepest Nodes||64.6%|Medium|| |0866|Prime Palindrome||25.1%|Medium|| @@ -1026,8 +1040,8 @@ |0900|RLE Iterator||55.1%|Medium|| |0901|Online Stock Span|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0901.Online-Stock-Span)|61.1%|Medium|| |0902|Numbers At Most N Given Digit Set||36.1%|Hard|| -|0903|Valid Permutations for DI Sequence||54.2%|Hard|| -|0904|Fruit Into Baskets|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0904.Fruit-Into-Baskets)|42.9%|Medium|| +|0903|Valid Permutations for DI Sequence||54.1%|Hard|| +|0904|Fruit Into Baskets|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0904.Fruit-Into-Baskets)|42.8%|Medium|| |0905|Sort Array By Parity||74.9%|Easy|| |0906|Super Palindromes||32.9%|Hard|| |0907|Sum of Subarray Minimums|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0907.Sum-of-Subarray-Minimums)|33.2%|Medium|| @@ -1035,7 +1049,7 @@ |0909|Snakes and Ladders||39.1%|Medium|| |0910|Smallest Range II|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0910.Smallest-Range-II)|31.2%|Medium|| |0911|Online Election|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0911.Online-Election)|51.2%|Medium|| -|0912|Sort an Array||64.4%|Medium|| +|0912|Sort an Array||64.5%|Medium|| |0913|Cat and Mouse||33.8%|Hard|| |0914|X of a Kind in a Deck of Cards|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0914.X-of-a-Kind-in-a-Deck-of-Cards)|34.4%|Easy|| |0915|Partition Array into Disjoint Intervals||45.9%|Medium|| @@ -1043,7 +1057,7 @@ |0917|Reverse Only Letters||58.6%|Easy|| |0918|Maximum Sum Circular Subarray|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0918.Maximum-Sum-Circular-Subarray)|34.0%|Medium|| |0919|Complete Binary Tree Inserter||58.6%|Medium|| -|0920|Number of Music Playlists|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0920.Number-of-Music-Playlists)|47.7%|Hard|| +|0920|Number of Music Playlists|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0920.Number-of-Music-Playlists)|47.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)|74.6%|Medium|| |0922|Sort Array By Parity II|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0922.Sort-Array-By-Parity-II)|70.2%|Easy|| |0923|3Sum With Multiplicity|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0923.3Sum-With-Multiplicity)|36.0%|Medium|| @@ -1055,9 +1069,9 @@ |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)|44.2%|Medium|| |0931|Minimum Falling Path Sum||63.2%|Medium|| -|0932|Beautiful Array||61.1%|Medium|| +|0932|Beautiful Array||61.0%|Medium|| |0933|Number of Recent Calls|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0933.Number-of-Recent-Calls)|72.0%|Easy|| -|0934|Shortest Bridge||49.3%|Medium|| +|0934|Shortest Bridge||49.4%|Medium|| |0935|Knight Dialer||46.1%|Medium|| |0936|Stamping The Sequence||47.2%|Hard|| |0937|Reorder Data in Log Files||54.3%|Easy|| @@ -1066,7 +1080,7 @@ |0940|Distinct Subsequences II||41.6%|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)|73.4%|Easy|| -|0943|Find the Shortest Superstring||43.4%|Hard|| +|0943|Find the Shortest Superstring||43.5%|Hard|| |0944|Delete Columns to Make Sorted||71.0%|Easy|| |0945|Minimum Increment to Make Array Unique||46.6%|Medium|| |0946|Validate Stack Sequences|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0946.Validate-Stack-Sequences)|63.4%|Medium|| @@ -1089,15 +1103,15 @@ |0963|Minimum Area Rectangle II||51.7%|Medium|| |0964|Least Operators to Express Number||44.8%|Hard|| |0965|Univalued Binary Tree||67.7%|Easy|| -|0966|Vowel Spellchecker||47.6%|Medium|| +|0966|Vowel Spellchecker||47.7%|Medium|| |0967|Numbers With Same Consecutive Differences||44.5%|Medium|| |0968|Binary Tree Cameras|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0968.Binary-Tree-Cameras)|38.5%|Hard|| |0969|Pancake Sorting|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0969.Pancake-Sorting)|68.5%|Medium|| -|0970|Powerful Integers|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0970.Powerful-Integers)|40.0%|Easy|| +|0970|Powerful Integers|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0970.Powerful-Integers)|39.9%|Easy|| |0971|Flip Binary Tree To Match Preorder Traversal||46.2%|Medium|| |0972|Equal Rational Numbers||41.9%|Hard|| |0973|K Closest Points to Origin|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0973.K-Closest-Points-to-Origin)|64.5%|Medium|| -|0974|Subarray Sums Divisible by K||50.5%|Medium|| +|0974|Subarray Sums Divisible by K||50.6%|Medium|| |0975|Odd Even Jump||41.5%|Hard|| |0976|Largest Perimeter Triangle|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0976.Largest-Perimeter-Triangle)|58.5%|Easy|| |0977|Squares of a Sorted Array|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0977.Squares-of-a-Sorted-Array)|72.3%|Easy|| @@ -1110,7 +1124,7 @@ |0984|String Without AAA or BBB|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0984.String-Without-AAA-or-BBB)|38.4%|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)|60.8%|Easy|| |0986|Interval List Intersections|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0986.Interval-List-Intersections)|68.1%|Medium|| -|0987|Vertical Order Traversal of a Binary Tree||37.5%|Medium|| +|0987|Vertical Order Traversal of a Binary Tree||37.6%|Medium|| |0988|Smallest String Starting From Leaf||46.6%|Medium|| |0989|Add to Array-Form of Integer||44.7%|Easy|| |0990|Satisfiability of Equality Equations|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0990.Satisfiability-of-Equality-Equations)|46.4%|Medium|| @@ -1118,19 +1132,19 @@ |0992|Subarrays with K Different Integers|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0992.Subarrays-with-K-Different-Integers)|50.4%|Hard|| |0993|Cousins in Binary Tree|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0993.Cousins-in-Binary-Tree)|52.2%|Easy|| |0994|Rotting Oranges||49.5%|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)|49.5%|Hard|| +|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)|49.6%|Hard|| |0996|Number of Squareful Arrays|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0996.Number-of-Squareful-Arrays)|47.9%|Hard|| |0997|Find the Town Judge||49.8%|Easy|| |0998|Maximum Binary Tree II||63.6%|Medium|| |0999|Available Captures for Rook|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0999.Available-Captures-for-Rook)|66.8%|Easy|| |1000|Minimum Cost to Merge Stones||40.4%|Hard|| -|1001|Grid Illumination||36.5%|Hard|| +|1001|Grid Illumination||36.6%|Hard|| |1002|Find Common Characters|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1002.Find-Common-Characters)|68.1%|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)|56.0%|Medium|| |1004|Max Consecutive Ones III|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1004.Max-Consecutive-Ones-III)|60.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)|52.2%|Easy|| |1006|Clumsy Factorial||53.6%|Medium|| -|1007|Minimum Domino Rotations For Equal Row||50.9%|Medium|| +|1007|Minimum Domino Rotations For Equal Row||51.0%|Medium|| |1008|Construct Binary Search Tree from Preorder Traversal||78.7%|Medium|| |1009|Complement of Base 10 Integer||61.5%|Easy|| |1010|Pairs of Songs With Total Durations Divisible by 60||49.7%|Medium|| @@ -1140,14 +1154,14 @@ |1014|Best Sightseeing Pair||52.8%|Medium|| |1015|Smallest Integer Divisible by K||41.8%|Medium|| |1016|Binary String With Substrings Representing 1 To N||59.1%|Medium|| -|1017|Convert to Base -2|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1017.Convert-to-Base--2)|59.5%|Medium|| +|1017|Convert to Base -2|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1017.Convert-to-Base--2)|59.6%|Medium|| |1018|Binary Prefix Divisible By 5||47.8%|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)|58.2%|Medium|| |1020|Number of Enclaves|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1020.Number-of-Enclaves)|58.7%|Medium|| |1021|Remove Outermost Parentheses|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1021.Remove-Outermost-Parentheses)|78.7%|Easy|| |1022|Sum of Root To Leaf Binary Numbers||71.4%|Easy|| |1023|Camelcase Matching||57.3%|Medium|| -|1024|Video Stitching||49.2%|Medium|| +|1024|Video Stitching||49.1%|Medium|| |1025|Divisor Game|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1025.Divisor-Game)|66.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)|69.1%|Medium|| |1027|Longest Arithmetic Subsequence||49.9%|Medium|| @@ -1163,11 +1177,11 @@ |1037|Valid Boomerang|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1037.Valid-Boomerang)|37.8%|Easy|| |1038|Binary Search Tree to Greater Sum Tree||82.0%|Medium|| |1039|Minimum Score Triangulation of Polygon||50.0%|Medium|| -|1040|Moving Stones Until Consecutive II|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1040.Moving-Stones-Until-Consecutive-II)|53.9%|Medium|| +|1040|Moving Stones Until Consecutive II|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1040.Moving-Stones-Until-Consecutive-II)|54.0%|Medium|| |1041|Robot Bounded In Circle||54.7%|Medium|| |1042|Flower Planting With No Adjacent||48.7%|Medium|| |1043|Partition Array for Maximum Sum||66.7%|Medium|| -|1044|Longest Duplicate Substring||31.6%|Hard|| +|1044|Longest Duplicate Substring||31.5%|Hard|| |1045|Customers Who Bought All Products||68.2%|Medium|| |1046|Last Stone Weight||62.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)|70.2%|Easy|| @@ -1176,7 +1190,7 @@ |1050|Actors and Directors Who Cooperated At Least Three Times||72.2%|Easy|| |1051|Height Checker|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1051.Height-Checker)|71.9%|Easy|| |1052|Grumpy Bookstore Owner|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1052.Grumpy-Bookstore-Owner)|55.7%|Medium|| -|1053|Previous Permutation With One Swap||50.8%|Medium|| +|1053|Previous Permutation With One Swap||50.7%|Medium|| |1054|Distant Barcodes|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1054.Distant-Barcodes)|44.1%|Medium|| |1055|Shortest Way to Form String||57.1%|Medium|| |1056|Confusing Number||47.2%|Easy|| @@ -1184,14 +1198,14 @@ |1058|Minimize Rounding Error to Meet Target||43.1%|Medium|| |1059|All Paths from Source Lead to Destination||43.4%|Medium|| |1060|Missing Element in Sorted Array||54.7%|Medium|| -|1061|Lexicographically Smallest Equivalent String||66.7%|Medium|| +|1061|Lexicographically Smallest Equivalent String||66.6%|Medium|| |1062|Longest Repeating Substring||58.0%|Medium|| |1063|Number of Valid Subarrays||72.1%|Hard|| |1064|Fixed Point||65.5%|Easy|| -|1065|Index Pairs of a String||60.9%|Easy|| +|1065|Index Pairs of a String||61.0%|Easy|| |1066|Campus Bikes II||54.0%|Medium|| |1067|Digit Count in Range||41.1%|Hard|| -|1068|Product Sales Analysis I||82.5%|Easy|| +|1068|Product Sales Analysis I||82.4%|Easy|| |1069|Product Sales Analysis II||83.2%|Easy|| |1070|Product Sales Analysis III||49.6%|Medium|| |1071|Greatest Common Divisor of Strings||51.4%|Easy|| @@ -1205,9 +1219,9 @@ |1079|Letter Tile Possibilities|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1079.Letter-Tile-Possibilities)|75.8%|Medium|| |1080|Insufficient Nodes in Root to Leaf Paths||49.7%|Medium|| |1081|Smallest Subsequence of Distinct Characters||53.4%|Medium|| -|1082|Sales Analysis I||73.2%|Easy|| -|1083|Sales Analysis II||50.8%|Easy|| -|1084|Sales Analysis III||54.7%|Easy|| +|1082|Sales Analysis I||73.3%|Easy|| +|1083|Sales Analysis II||50.7%|Easy|| +|1084|Sales Analysis III||54.6%|Easy|| |1085|Sum of Digits in the Minimum Number||75.0%|Easy|| |1086|High Five||78.8%|Easy|| |1087|Brace Expansion||63.1%|Medium|| @@ -1215,12 +1229,12 @@ |1089|Duplicate Zeros|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1089.Duplicate-Zeros)|52.0%|Easy|| |1090|Largest Values From Labels||60.0%|Medium|| |1091|Shortest Path in Binary Matrix||39.0%|Medium|| -|1092|Shortest Common Supersequence ||52.7%|Hard|| +|1092|Shortest Common Supersequence ||52.8%|Hard|| |1093|Statistics from a Large Sample|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1093.Statistics-from-a-Large-Sample)|49.3%|Medium|| -|1094|Car Pooling||59.0%|Medium|| +|1094|Car Pooling||59.1%|Medium|| |1095|Find in Mountain Array||35.9%|Hard|| |1096|Brace Expansion II||62.4%|Hard|| -|1097|Game Play Analysis V||56.3%|Hard|| +|1097|Game Play Analysis V||56.4%|Hard|| |1098|Unpopular Books||45.6%|Medium|| |1099|Two Sum Less Than K||60.8%|Easy|| |1100|Find K-Length Substrings With No Repeated Characters||73.3%|Medium|| @@ -1236,7 +1250,7 @@ |1110|Delete Nodes And Return Forest|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1110.Delete-Nodes-And-Return-Forest)|67.6%|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)|72.4%|Medium|| |1112|Highest Grade For Each Student||71.7%|Medium|| -|1113|Reported Posts||65.3%|Easy|| +|1113|Reported Posts||65.4%|Easy|| |1114|Print in Order||66.9%|Easy|| |1115|Print FooBar Alternately||59.1%|Medium|| |1116|Print Zero Even Odd||57.6%|Medium|| @@ -1248,11 +1262,11 @@ |1122|Relative Sort Array|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1122.Relative-Sort-Array)|67.7%|Easy|| |1123|Lowest Common Ancestor of Deepest Leaves|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1123.Lowest-Common-Ancestor-of-Deepest-Leaves)|67.8%|Medium|| |1124|Longest Well-Performing Interval||33.2%|Medium|| -|1125|Smallest Sufficient Team||46.9%|Hard|| +|1125|Smallest Sufficient Team||47.0%|Hard|| |1126|Active Businesses||68.7%|Medium|| |1127|User Purchase Platform||50.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.6%|Easy|| -|1129|Shortest Path with Alternating Colors||40.0%|Medium|| +|1129|Shortest Path with Alternating Colors||40.1%|Medium|| |1130|Minimum Cost Tree From Leaf Values||67.1%|Medium|| |1131|Maximum of Absolute Value Expression||52.1%|Medium|| |1132|Reported Posts II||34.6%|Medium|| @@ -1262,26 +1276,26 @@ |1136|Parallel Courses||61.2%|Hard|| |1137|N-th Tribonacci Number|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1137.N-th-Tribonacci-Number)|56.1%|Easy|| |1138|Alphabet Board Path||50.6%|Medium|| -|1139|Largest 1-Bordered Square||48.4%|Medium|| +|1139|Largest 1-Bordered Square||48.5%|Medium|| |1140|Stone Game II||64.8%|Medium|| -|1141|User Activity for the Past 30 Days I||54.4%|Easy|| -|1142|User Activity for the Past 30 Days II||35.2%|Easy|| +|1141|User Activity for the Past 30 Days I||54.3%|Easy|| +|1142|User Activity for the Past 30 Days II||35.3%|Easy|| |1143|Longest Common Subsequence||58.6%|Medium|| |1144|Decrease Elements To Make Array Zigzag||46.0%|Medium|| |1145|Binary Tree Coloring Game|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1145.Binary-Tree-Coloring-Game)|51.4%|Medium|| |1146|Snapshot Array||36.8%|Medium|| |1147|Longest Chunked Palindrome Decomposition||59.4%|Hard|| -|1148|Article Views I||77.0%|Easy|| +|1148|Article Views I||76.9%|Easy|| |1149|Article Views II||48.4%|Medium|| |1150|Check If a Number Is Majority Element in a Sorted Array||58.0%|Easy|| |1151|Minimum Swaps to Group All 1's Together||58.2%|Medium|| |1152|Analyze User Website Visit Pattern||43.4%|Medium|| |1153|String Transforms Into Another String||36.0%|Hard|| |1154|Day of the Year|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1154.Day-of-the-Year)|49.3%|Easy|| -|1155|Number of Dice Rolls With Target Sum||47.5%|Medium|| +|1155|Number of Dice Rolls With Target Sum||47.6%|Medium|| |1156|Swap For Longest Repeated Character Substring||47.5%|Medium|| |1157|Online Majority Element In Subarray|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1157.Online-Majority-Element-In-Subarray)|39.5%|Hard|| -|1158|Market Analysis I||63.4%|Medium|| +|1158|Market Analysis I||63.5%|Medium|| |1159|Market Analysis II||55.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.5%|Easy|| |1161|Maximum Level Sum of a Binary Tree||70.1%|Medium|| @@ -1296,7 +1310,7 @@ |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)|59.5%|Easy|| |1171|Remove Zero Sum Consecutive Nodes from Linked List|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1171.Remove-Zero-Sum-Consecutive-Nodes-from-Linked-List)|41.4%|Medium|| |1172|Dinner Plate Stacks||37.8%|Hard|| -|1173|Immediate Food Delivery I||82.3%|Easy|| +|1173|Immediate Food Delivery I||82.2%|Easy|| |1174|Immediate Food Delivery II||60.9%|Medium|| |1175|Prime Arrangements|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1175.Prime-Arrangements)|51.8%|Easy|| |1176|Diet Plan Performance||54.0%|Easy|| @@ -1306,50 +1320,50 @@ |1180|Count Substrings with Only One Distinct Letter||77.5%|Easy|| |1181|Before and After Puzzle||44.5%|Medium|| |1182|Shortest Distance to Target Color||53.4%|Medium|| -|1183|Maximum Number of Ones||56.6%|Hard|| +|1183|Maximum Number of Ones||56.7%|Hard|| |1184|Distance Between Bus Stops|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1184.Distance-Between-Bus-Stops)|54.2%|Easy|| |1185|Day of the Week|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1185.Day-of-the-Week)|62.0%|Easy|| -|1186|Maximum Subarray Sum with One Deletion||38.4%|Medium|| +|1186|Maximum Subarray Sum with One Deletion||38.5%|Medium|| |1187|Make Array Strictly Increasing||41.6%|Hard|| |1188|Design Bounded Blocking Queue||72.7%|Medium|| |1189|Maximum Number of Balloons|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1189.Maximum-Number-of-Balloons)|61.8%|Easy|| |1190|Reverse Substrings Between Each Pair of Parentheses||64.0%|Medium|| -|1191|K-Concatenation Maximum Sum||25.5%|Medium|| +|1191|K-Concatenation Maximum Sum||25.4%|Medium|| |1192|Critical Connections in a Network||49.8%|Hard|| |1193|Monthly Transactions I||69.0%|Medium|| -|1194|Tournament Winners||52.0%|Hard|| +|1194|Tournament Winners||52.1%|Hard|| |1195|Fizz Buzz Multithreaded||70.4%|Medium|| |1196|How Many Apples Can You Put into the Basket||68.1%|Easy|| |1197|Minimum Knight Moves||37.0%|Medium|| |1198|Find Smallest Common Element in All Rows||75.3%|Medium|| -|1199|Minimum Time to Build Blocks||38.5%|Hard|| +|1199|Minimum Time to Build Blocks||38.4%|Hard|| |1200|Minimum Absolute Difference|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1200.Minimum-Absolute-Difference)|66.8%|Easy|| |1201|Ugly Number III|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1201.Ugly-Number-III)|26.4%|Medium|| -|1202|Smallest String With Swaps|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1202.Smallest-String-With-Swaps)|48.2%|Medium|| -|1203|Sort Items by Groups Respecting Dependencies||48.9%|Hard|| +|1202|Smallest String With Swaps|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1202.Smallest-String-With-Swaps)|48.3%|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.0%|Hard|| |1204|Last Person to Fit in the Elevator||71.4%|Medium|| |1205|Monthly Transactions II||46.1%|Medium|| -|1206|Design Skiplist||58.8%|Hard|| +|1206|Design Skiplist||58.9%|Hard|| |1207|Unique Number of Occurrences|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1207.Unique-Number-of-Occurrences)|71.6%|Easy|| |1208|Get Equal Substrings Within Budget|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1208.Get-Equal-Substrings-Within-Budget)|43.6%|Medium|| -|1209|Remove All Adjacent Duplicates in String II||57.4%|Medium|| +|1209|Remove All Adjacent Duplicates in String II||57.5%|Medium|| |1210|Minimum Moves to Reach Target with Rotations||46.2%|Hard|| |1211|Queries Quality and Percentage||70.0%|Easy|| |1212|Team Scores in Football Tournament||56.7%|Medium|| |1213|Intersection of Three Sorted Arrays||79.2%|Easy|| |1214|Two Sum BSTs||67.7%|Medium|| |1215|Stepping Numbers||43.1%|Medium|| -|1216|Valid Palindrome III||49.4%|Hard|| +|1216|Valid Palindrome III||49.5%|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)|71.2%|Easy|| |1218|Longest Arithmetic Subsequence of Given Difference||46.4%|Medium|| |1219|Path with Maximum Gold||65.5%|Medium|| -|1220|Count Vowels Permutation||54.1%|Hard|| +|1220|Count Vowels Permutation||54.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.0%|Easy|| |1222|Queens That Can Attack the King||69.3%|Medium|| -|1223|Dice Roll Simulation||46.7%|Medium|| -|1224|Maximum Equal Frequency||34.4%|Hard|| -|1225|Report Contiguous Dates||62.3%|Hard|| -|1226|The Dining Philosophers||58.7%|Medium|| +|1223|Dice Roll Simulation||46.6%|Medium|| +|1224|Maximum Equal Frequency||34.5%|Hard|| +|1225|Report Contiguous Dates||62.4%|Hard|| +|1226|The Dining Philosophers||58.3%|Medium|| |1227|Airplane Seat Assignment Probability||62.0%|Medium|| |1228|Missing Number In Arithmetic Progression||51.7%|Easy|| |1229|Meeting Scheduler||54.2%|Medium|| @@ -1358,30 +1372,30 @@ |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)|43.9%|Easy|| |1233|Remove Sub-Folders from the Filesystem||61.6%|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)|34.3%|Medium|| -|1235|Maximum Profit in Job Scheduling|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1235.Maximum-Profit-in-Job-Scheduling)|46.8%|Hard|| +|1235|Maximum Profit in Job Scheduling|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1235.Maximum-Profit-in-Job-Scheduling)|46.9%|Hard|| |1236|Web Crawler||64.5%|Medium|| |1237|Find Positive Integer Solution for a Given Equation||69.7%|Easy|| -|1238|Circular Permutation in Binary Representation||65.9%|Medium|| +|1238|Circular Permutation in Binary Representation||65.8%|Medium|| |1239|Maximum Length of a Concatenated String with Unique Characters||49.2%|Medium|| |1240|Tiling a Rectangle with the Fewest Squares||52.4%|Hard|| |1241|Number of Comments per Post||67.5%|Easy|| -|1242|Web Crawler Multithreaded||47.8%|Medium|| +|1242|Web Crawler Multithreaded||47.9%|Medium|| |1243|Array Transformation||50.3%|Easy|| |1244|Design A Leaderboard||65.7%|Medium|| |1245|Tree Diameter||61.2%|Medium|| |1246|Palindrome Removal||45.7%|Hard|| |1247|Minimum Swaps to Make Strings Equal||62.3%|Medium|| -|1248|Count Number of Nice Subarrays||56.5%|Medium|| +|1248|Count Number of Nice Subarrays||56.4%|Medium|| |1249|Minimum Remove to Make Valid Parentheses||63.5%|Medium|| |1250|Check If It Is a Good Array||56.3%|Hard|| |1251|Average Selling Price||82.5%|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||41.3%|Medium|| -|1254|Number of Closed Islands|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1254.Number-of-Closed-Islands)|61.4%|Medium|| +|1253|Reconstruct a 2-Row Binary Matrix||41.4%|Medium|| +|1254|Number of Closed Islands|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1254.Number-of-Closed-Islands)|61.5%|Medium|| |1255|Maximum Score Words Formed by Letters||69.8%|Hard|| |1256|Encode Number||67.4%|Medium|| |1257|Smallest Common Region||60.3%|Medium|| -|1258|Synonymous Sentences||65.4%|Medium|| +|1258|Synonymous Sentences||65.3%|Medium|| |1259|Handshakes That Don't Cross||54.1%|Hard|| |1260|Shift 2D Grid|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1260.Shift-2D-Grid)|61.8%|Easy|| |1261|Find Elements in a Contaminated Binary Tree||74.4%|Medium|| @@ -1396,14 +1410,14 @@ |1270|All People Report to the Given Manager||88.3%|Medium|| |1271|Hexspeak||55.2%|Easy|| |1272|Remove Interval||57.8%|Medium|| -|1273|Delete Tree Nodes||62.6%|Medium|| -|1274|Number of Ships in a Rectangle||66.1%|Hard|| +|1273|Delete Tree Nodes||62.5%|Medium|| +|1274|Number of Ships in a Rectangle||66.2%|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)|53.0%|Easy|| -|1276|Number of Burgers with No Waste of Ingredients||49.9%|Medium|| +|1276|Number of Burgers with No Waste of Ingredients||50.0%|Medium|| |1277|Count Square Submatrices with All Ones||72.9%|Medium|| |1278|Palindrome Partitioning III||60.6%|Hard|| |1279|Traffic Light Controlled Intersection||75.6%|Easy|| -|1280|Students and Examinations||74.2%|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)|85.6%|Easy|| |1282|Group the People Given the Group Size They Belong To||84.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)|49.1%|Medium|| @@ -1415,9 +1429,9 @@ |1289|Minimum Falling Path Sum II||62.2%|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)|81.6%|Easy|| |1291|Sequential Digits||57.4%|Medium|| -|1292|Maximum Side Length of a Square with Sum Less than or Equal to Threshold||50.4%|Medium|| +|1292|Maximum Side Length of a Square with Sum Less than or Equal to Threshold||50.5%|Medium|| |1293|Shortest Path in a Grid with Obstacles Elimination||42.9%|Hard|| -|1294|Weather Type in Each Country||66.1%|Easy|| +|1294|Weather Type in Each Country||66.0%|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)|79.4%|Easy|| |1296|Divide Array in Sets of K Consecutive Numbers||55.3%|Medium|| |1297|Maximum Number of Occurrences of a Substring||49.3%|Medium|| @@ -1431,8 +1445,8 @@ |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)|77.8%|Medium|| |1306|Jump Game III|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1306.Jump-Game-III)|62.6%|Medium|| |1307|Verbal Arithmetic Puzzle||37.2%|Hard|| -|1308|Running Total for Different Genders||87.0%|Medium|| -|1309|Decrypt String from Alphabet to Integer Mapping||77.3%|Easy|| +|1308|Running Total for Different Genders||87.1%|Medium|| +|1309|Decrypt String from Alphabet to Integer Mapping||77.2%|Easy|| |1310|XOR Queries of a Subarray||69.2%|Medium|| |1311|Get Watched Videos by Your Friends||44.1%|Medium|| |1312|Minimum Insertion Steps to Make a String Palindrome||59.2%|Hard|| @@ -1440,19 +1454,19 @@ |1314|Matrix Block Sum||73.7%|Medium|| |1315|Sum of Nodes with Even-Valued Grandparent||84.1%|Medium|| |1316|Distinct Echo Substrings||49.6%|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.8%|Easy|| +|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||63.7%|Medium|| |1319|Number of Operations to Make Network Connected||54.7%|Medium|| |1320|Minimum Distance to Type a Word Using Two Fingers||62.8%|Hard|| -|1321|Restaurant Growth||70.5%|Medium|| +|1321|Restaurant Growth||70.4%|Medium|| |1322|Ads Performance||57.9%|Easy|| -|1323|Maximum 69 Number||77.9%|Easy|| +|1323|Maximum 69 Number||78.0%|Easy|| |1324|Print Words Vertically||58.6%|Medium|| |1325|Delete Leaves With a Given Value||73.5%|Medium|| |1326|Minimum Number of Taps to Open to Water a Garden||46.1%|Hard|| |1327|List the Products Ordered in a Period||77.5%|Easy|| |1328|Break a Palindrome||45.5%|Medium|| -|1329|Sort the Matrix Diagonally||79.3%|Medium|| +|1329|Sort the Matrix Diagonally||79.4%|Medium|| |1330|Reverse Subarray To Maximize Array Value||36.4%|Hard|| |1331|Rank Transform of an Array||57.7%|Easy|| |1332|Remove Palindromic Subsequences||62.8%|Easy|| @@ -1466,7 +1480,7 @@ |1340|Jump Game V||58.9%|Hard|| |1341|Movie Rating||58.4%|Medium|| |1342|Number of Steps to Reduce a Number to Zero||85.7%|Easy|| -|1343|Number of Sub-arrays of Size K and Average Greater than or Equal to Threshold||64.5%|Medium|| +|1343|Number of Sub-arrays of Size K and Average Greater than or Equal to Threshold||64.6%|Medium|| |1344|Angle Between Hands of a Clock||61.3%|Medium|| |1345|Jump Game IV||41.9%|Hard|| |1346|Check If N and Its Double Exist||36.5%|Easy|| @@ -1480,19 +1494,19 @@ |1354|Construct Target Array With Multiple Sums||31.3%|Hard|| |1355|Activity Participants||74.0%|Medium|| |1356|Sort Integers by The Number of 1 Bits||69.6%|Easy|| -|1357|Apply Discount Every n Orders||66.5%|Medium|| +|1357|Apply Discount Every n Orders||66.6%|Medium|| |1358|Number of Substrings Containing All Three Characters||60.3%|Medium|| |1359|Count All Valid Pickup and Delivery Options||56.9%|Hard|| -|1360|Number of Days Between Two Dates||47.0%|Easy|| +|1360|Number of Days Between Two Dates||46.9%|Easy|| |1361|Validate Binary Tree Nodes||44.3%|Medium|| -|1362|Closest Divisors||57.5%|Medium|| +|1362|Closest Divisors||57.6%|Medium|| |1363|Largest Multiple of Three||33.9%|Hard|| -|1364|Number of Trusted Contacts of a Customer||78.0%|Medium|| +|1364|Number of Trusted Contacts of a Customer||77.9%|Medium|| |1365|How Many Numbers Are Smaller Than the Current Number||85.9%|Easy|| |1366|Rank Teams by Votes||55.0%|Medium|| |1367|Linked List in Binary Tree||41.1%|Medium|| |1368|Minimum Cost to Make at Least One Valid Path in a Grid||56.8%|Hard|| -|1369|Get the Second Most Recent Activity||68.4%|Hard|| +|1369|Get the Second Most Recent Activity||68.5%|Hard|| |1370|Increasing Decreasing String||76.3%|Easy|| |1371|Find the Longest Substring Containing Vowels in Even Counts||61.3%|Medium|| |1372|Longest ZigZag Path in a Binary Tree||54.6%|Medium|| @@ -1500,8 +1514,8 @@ |1374|Generate a String With Characters That Have Odd Counts||76.2%|Easy|| |1375|Bulb Switcher III||64.1%|Medium|| |1376|Time Needed to Inform All Employees||56.3%|Medium|| -|1377|Frog Position After T Seconds||34.7%|Hard|| -|1378|Replace Employee ID With The Unique Identifier||89.7%|Easy|| +|1377|Frog Position After T Seconds||34.8%|Hard|| +|1378|Replace Employee ID With The Unique Identifier||89.8%|Easy|| |1379|Find a Corresponding Node of a Binary Tree in a Clone of That Tree||85.2%|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||75.8%|Medium|| @@ -1511,18 +1525,18 @@ |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)|66.4%|Easy|| |1386|Cinema Seat Allocation||35.5%|Medium|| |1387|Sort Integers by The Power Value||70.5%|Medium|| -|1388|Pizza With 3n Slices||45.4%|Hard|| +|1388|Pizza With 3n Slices||45.3%|Hard|| |1389|Create Target Array in the Given Order|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1389.Create-Target-Array-in-the-Given-Order)|84.8%|Easy|| |1390|Four Divisors||39.0%|Medium|| |1391|Check if There is a Valid Path in a Grid||44.9%|Medium|| |1392|Longest Happy Prefix||41.3%|Hard|| |1393|Capital Gain/Loss||90.6%|Medium|| |1394|Find Lucky Integer in an Array||63.2%|Easy|| -|1395|Count Number of Teams||81.9%|Medium|| +|1395|Count Number of Teams||81.8%|Medium|| |1396|Design Underground System||68.8%|Medium|| -|1397|Find All Good Strings||37.9%|Hard|| +|1397|Find All Good Strings||38.0%|Hard|| |1398|Customers Who Bought Products A and B but Not C||82.0%|Medium|| -|1399|Count Largest Group||65.3%|Easy|| +|1399|Count Largest Group||65.4%|Easy|| |1400|Construct K Palindrome Strings||62.8%|Medium|| |1401|Circle and Rectangle Overlapping||42.3%|Medium|| |1402|Reducing Dishes||72.3%|Hard|| @@ -1534,7 +1548,7 @@ |1408|String Matching in an Array||62.7%|Easy|| |1409|Queries on a Permutation With Key||81.4%|Medium|| |1410|HTML Entity Parser||54.4%|Medium|| -|1411|Number of Ways to Paint N × 3 Grid||60.5%|Hard|| +|1411|Number of Ways to Paint N × 3 Grid||60.4%|Hard|| |1412|Find the Quiet Students in All Exams||65.5%|Hard|| |1413|Minimum Value to Get Positive Step by Step Sum||65.3%|Easy|| |1414|Find the Minimum Number of Fibonacci Numbers Whose Sum Is K||63.8%|Medium|| @@ -1551,7 +1565,7 @@ |1425|Constrained Subsequence Sum||44.9%|Hard|| |1426|Counting Elements||59.0%|Easy|| |1427|Perform String Shifts||53.4%|Easy|| -|1428|Leftmost Column with at Least a One||48.7%|Medium|| +|1428|Leftmost Column with at Least a One||48.8%|Medium|| |1429|First Unique Number||49.0%|Medium|| |1430|Check If a String Is a Valid Sequence from Root to Leaves Path in a Binary Tree||45.1%|Medium|| |1431|Kids With the Greatest Number of Candies||88.6%|Easy|| @@ -1562,15 +1576,15 @@ |1436|Destination City||77.1%|Easy|| |1437|Check If All 1's Are at Least Length K Places Away||61.8%|Medium|| |1438|Longest Continuous Subarray With Absolute Diff Less Than or Equal to Limit||43.9%|Medium|| -|1439|Find the Kth Smallest Sum of a Matrix With Sorted Rows||60.0%|Hard|| -|1440|Evaluate Boolean Expression||74.4%|Medium|| +|1439|Find the Kth Smallest Sum of a Matrix With Sorted Rows||59.9%|Hard|| +|1440|Evaluate Boolean Expression||74.5%|Medium|| |1441|Build an Array With Stack Operations||69.0%|Easy|| |1442|Count Triplets That Can Form Two Arrays of Equal XOR||70.9%|Medium|| |1443|Minimum Time to Collect All Apples in a Tree||54.6%|Medium|| |1444|Number of Ways of Cutting a Pizza||53.7%|Hard|| -|1445|Apples & Oranges||90.6%|Medium|| +|1445|Apples & Oranges||90.7%|Medium|| |1446|Consecutive Characters||61.1%|Easy|| -|1447|Simplified Fractions||62.1%|Medium|| +|1447|Simplified Fractions||62.2%|Medium|| |1448|Count Good Nodes in Binary Tree||70.3%|Medium|| |1449|Form Largest Integer With Digits That Add up to Target||43.7%|Hard|| |1450|Number of Students Doing Homework at a Given Time||76.9%|Easy|| @@ -1581,18 +1595,18 @@ |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.8%|Easy|| |1456|Maximum Number of Vowels in a Substring of Given Length||54.3%|Medium|| |1457|Pseudo-Palindromic Paths in a Binary Tree||71.4%|Medium|| -|1458|Max Dot Product of Two Subsequences||42.8%|Hard|| +|1458|Max Dot Product of Two Subsequences||42.9%|Hard|| |1459|Rectangles Area||64.3%|Medium|| |1460|Make Two Arrays Equal by Reversing Sub-arrays||72.1%|Easy|| |1461|Check If a String Contains All Binary Codes of Size K||46.9%|Medium|| |1462|Course Schedule IV||44.3%|Medium|| -|1463|Cherry Pickup II||69.5%|Hard|| +|1463|Cherry Pickup II||69.4%|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)|76.9%|Easy|| |1465|Maximum Area of a Piece of Cake After Horizontal and Vertical Cuts||31.7%|Medium|| |1466|Reorder Routes to Make All Paths Lead to the City Zero||61.3%|Medium|| |1467|Probability of a Two Boxes Having The Same Number of Distinct Balls||61.0%|Hard|| |1468|Calculate Salaries||81.1%|Medium|| -|1469|Find All The Lonely Nodes||80.6%|Easy|| +|1469|Find All The Lonely Nodes||80.5%|Easy|| |1470|Shuffle the Array|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1470.Shuffle-the-Array)|88.5%|Easy|| |1471|The k Strongest Values in an Array||58.4%|Medium|| |1472|Design Browser History||70.2%|Medium|| @@ -1600,41 +1614,41 @@ |1474|Delete N Nodes After M Nodes of a Linked List||74.6%|Easy|| |1475|Final Prices With a Special Discount in a Shop||74.7%|Easy|| |1476|Subrectangle Queries||88.6%|Medium|| -|1477|Find Two Non-overlapping Sub-arrays Each With Target Sum||34.0%|Medium|| -|1478|Allocate Mailboxes||54.4%|Hard|| +|1477|Find Two Non-overlapping Sub-arrays Each With Target Sum||34.1%|Medium|| +|1478|Allocate Mailboxes||54.2%|Hard|| |1479|Sales by Day of the Week||83.6%|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||55.5%|Medium|| |1482|Minimum Number of Days to Make m Bouquets||49.7%|Medium|| |1483|Kth Ancestor of a Tree Node||30.2%|Hard|| |1484|Group Sold Products By The Date||86.0%|Easy|| -|1485|Clone Binary Tree With Random Pointer||79.7%|Medium|| +|1485|Clone Binary Tree With Random Pointer||79.5%|Medium|| |1486|XOR Operation in an Array||84.0%|Easy|| -|1487|Making File Names Unique||30.4%|Medium|| +|1487|Making File Names Unique||30.5%|Medium|| |1488|Avoid Flood in The City||24.7%|Medium|| -|1489|Find Critical and Pseudo-Critical Edges in Minimum Spanning Tree||52.4%|Hard|| -|1490|Clone N-ary Tree||83.5%|Medium|| +|1489|Find Critical and Pseudo-Critical Edges in Minimum Spanning Tree||52.3%|Hard|| +|1490|Clone N-ary Tree||83.4%|Medium|| |1491|Average Salary Excluding the Minimum and Maximum Salary||68.5%|Easy|| |1492|The kth Factor of n||63.4%|Medium|| |1493|Longest Subarray of 1's After Deleting One Element||58.2%|Medium|| |1494|Parallel Courses II||31.3%|Hard|| |1495|Friendly Movies Streamed Last Month||51.3%|Easy|| -|1496|Path Crossing||55.5%|Easy|| +|1496|Path Crossing||55.4%|Easy|| |1497|Check If Array Pairs Are Divisible by k||40.6%|Medium|| |1498|Number of Subsequences That Satisfy the Given Sum Condition||38.2%|Medium|| -|1499|Max Value of Equation||45.3%|Hard|| +|1499|Max Value of Equation||45.2%|Hard|| |1500|Design a File Sharing System||46.0%|Medium|| |1501|Countries You Can Safely Invest In||60.0%|Medium|| |1502|Can Make Arithmetic Progression From Sequence||70.8%|Easy|| |1503|Last Moment Before All Ants Fall Out of a Plank||53.0%|Medium|| |1504|Count Submatrices With All Ones||61.0%|Medium|| |1505|Minimum Possible Integer After at Most K Adjacent Swaps On Digits||36.2%|Hard|| -|1506|Find Root of N-Ary Tree||81.0%|Medium|| +|1506|Find Root of N-Ary Tree||80.8%|Medium|| |1507|Reformat Date||60.3%|Easy|| |1508|Range Sum of Sorted Subarray Sums||62.1%|Medium|| |1509|Minimum Difference Between Largest and Smallest Value in Three Moves||51.8%|Medium|| |1510|Stone Game IV||58.7%|Hard|| -|1511|Customer Order Frequency||73.6%|Easy|| +|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)|87.9%|Easy|| |1513|Number of Substrings With Only 1s||41.4%|Medium|| |1514|Path with Maximum Probability||39.3%|Medium|| @@ -1647,14 +1661,14 @@ |1521|Find a Value of a Mysterious Function Closest to Target||44.4%|Hard|| |1522|Diameter of N-Ary Tree||68.8%|Medium|| |1523|Count Odd Numbers in an Interval Range||55.2%|Easy|| -|1524|Number of Sub-arrays With Odd Sum||39.4%|Medium|| +|1524|Number of Sub-arrays With Odd Sum||39.5%|Medium|| |1525|Number of Good Ways to Split a String||66.9%|Medium|| |1526|Minimum Number of Increments on Subarrays to Form a Target Array||59.7%|Hard|| -|1527|Patients With a Condition||76.7%|Easy|| +|1527|Patients With a Condition||76.4%|Easy|| |1528|Shuffle String||85.8%|Easy|| |1529|Bulb Switcher IV||70.8%|Medium|| |1530|Number of Good Leaf Nodes Pairs||55.8%|Medium|| -|1531|String Compression II||33.2%|Hard|| +|1531|String Compression II||33.3%|Hard|| |1532|The Most Recent Three Orders||73.0%|Medium|| |1533|Find the Index of the Large Integer||54.7%|Medium|| |1534|Count Good Triplets||80.2%|Easy|| @@ -1664,189 +1678,189 @@ |1538|Guess the Majority in a Hidden Array||61.4%|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||30.5%|Medium|| -|1541|Minimum Insertions to Balance a Parentheses String||42.5%|Medium|| +|1541|Minimum Insertions to Balance a Parentheses String||42.4%|Medium|| |1542|Find Longest Awesome Substring||36.5%|Hard|| |1543|Fix Product Name Format||68.0%|Easy|| |1544|Make The String Great||55.1%|Easy|| -|1545|Find Kth Bit in Nth Binary String||57.2%|Medium|| +|1545|Find Kth Bit in Nth Binary String||57.3%|Medium|| |1546|Maximum Number of Non-Overlapping Subarrays With Sum Equals Target||43.7%|Medium|| |1547|Minimum Cost to Cut a Stick||52.0%|Hard|| -|1548|The Most Similar Path in a Graph||54.1%|Hard|| +|1548|The Most Similar Path in a Graph||54.2%|Hard|| |1549|The Most Recent Orders for Each Product||66.2%|Medium|| |1550|Three Consecutive Odds||65.3%|Easy|| |1551|Minimum Operations to Make Array Equal||77.8%|Medium|| |1552|Magnetic Force Between Two Balls||48.6%|Medium|| |1553|Minimum Number of Days to Eat N Oranges||29.1%|Hard|| -|1554|Strings Differ by One Character||63.7%|Medium|| +|1554|Strings Differ by One Character||63.5%|Medium|| |1555|Bank Account Summary||52.6%|Medium|| |1556|Thousand Separator||58.2%|Easy|| |1557|Minimum Number of Vertices to Reach All Nodes||75.3%|Medium|| |1558|Minimum Numbers of Function Calls to Make Target Array||62.5%|Medium|| |1559|Detect Cycles in 2D Grid||44.7%|Hard|| -|1560|Most Visited Sector in a Circular Track||56.9%|Easy|| -|1561|Maximum Number of Coins You Can Get||78.0%|Medium|| +|1560|Most Visited Sector in a Circular Track||57.1%|Easy|| +|1561|Maximum Number of Coins You Can Get||78.1%|Medium|| |1562|Find Latest Group of Size M||39.4%|Medium|| -|1563|Stone Game V||40.1%|Hard|| -|1564|Put Boxes Into the Warehouse I||66.1%|Medium|| +|1563|Stone Game V||40.0%|Hard|| +|1564|Put Boxes Into the Warehouse I||66.2%|Medium|| |1565|Unique Orders and Customers Per Month||83.8%|Easy|| -|1566|Detect Pattern of Length M Repeated K or More Times||42.2%|Easy|| +|1566|Detect Pattern of Length M Repeated K or More Times||42.3%|Easy|| |1567|Maximum Length of Subarray With Positive Product||36.4%|Medium|| -|1568|Minimum Number of Days to Disconnect Island||50.5%|Hard|| -|1569|Number of Ways to Reorder Array to Get Same BST||50.1%|Hard|| +|1568|Minimum Number of Days to Disconnect Island||50.4%|Hard|| +|1569|Number of Ways to Reorder Array to Get Same BST||50.0%|Hard|| |1570|Dot Product of Two Sparse Vectors||91.5%|Medium|| -|1571|Warehouse Manager||90.0%|Easy|| +|1571|Warehouse Manager||89.9%|Easy|| |1572|Matrix Diagonal Sum||78.2%|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)|30.8%|Medium|| -|1574|Shortest Subarray to be Removed to Make Array Sorted||32.9%|Medium|| +|1574|Shortest Subarray to be Removed to Make Array Sorted||33.0%|Medium|| |1575|Count All Possible Routes||57.5%|Hard|| |1576|Replace All ?'s to Avoid Consecutive Repeating Characters||48.1%|Easy|| |1577|Number of Ways Where Square of Number Is Equal to Product of Two Numbers||37.2%|Medium|| |1578|Minimum Deletion Cost to Avoid Repeating Letters||60.3%|Medium|| -|1579|Remove Max Number of Edges to Keep Graph Fully Traversable||45.7%|Hard|| +|1579|Remove Max Number of Edges to Keep Graph Fully Traversable||45.8%|Hard|| |1580|Put Boxes Into the Warehouse II||62.2%|Medium|| -|1581|Customer Who Visited but Did Not Make Any Transactions||90.3%|Easy|| +|1581|Customer Who Visited but Did Not Make Any Transactions||90.2%|Easy|| |1582|Special Positions in a Binary Matrix||64.2%|Easy|| -|1583|Count Unhappy Friends||53.6%|Medium|| +|1583|Count Unhappy Friends||53.7%|Medium|| |1584|Min Cost to Connect All Points||50.2%|Medium|| |1585|Check If String Is Transformable With Substring Sort Operations||48.3%|Hard|| |1586|Binary Search Tree Iterator II||66.5%|Medium|| -|1587|Bank Account Summary II||90.3%|Easy|| +|1587|Bank Account Summary II||90.2%|Easy|| |1588|Sum of All Odd Length Subarrays||82.1%|Easy|| |1589|Maximum Sum Obtained of Any Permutation||34.6%|Medium|| |1590|Make Sum Divisible by P||27.2%|Medium|| |1591|Strange Printer II||55.4%|Hard|| -|1592|Rearrange Spaces Between Words||43.7%|Easy|| +|1592|Rearrange Spaces Between Words||43.8%|Easy|| |1593|Split a String Into the Max Number of Unique Substrings||48.3%|Medium|| |1594|Maximum Non Negative Product in a Matrix||31.9%|Medium|| |1595|Minimum Cost to Connect Two Groups of Points||42.7%|Hard|| |1596|The Most Frequently Ordered Products for Each Customer||84.4%|Medium|| -|1597|Build Binary Expression Tree From Infix Expression||65.5%|Hard|| +|1597|Build Binary Expression Tree From Infix Expression||65.4%|Hard|| |1598|Crawler Log Folder||64.3%|Easy|| |1599|Maximum Profit of Operating a Centennial Wheel||43.4%|Medium|| -|1600|Throne Inheritance||59.7%|Medium|| +|1600|Throne Inheritance||59.8%|Medium|| |1601|Maximum Number of Achievable Transfer Requests||47.4%|Hard|| |1602|Find Nearest Right Node in Binary Tree||74.1%|Medium|| |1603|Design Parking System||86.8%|Easy|| |1604|Alert Using Same Key-Card Three or More Times in a One Hour Period||42.1%|Medium|| -|1605|Find Valid Matrix Given Row and Column Sums||77.6%|Medium|| -|1606|Find Servers That Handled Most Number of Requests||36.7%|Hard|| +|1605|Find Valid Matrix Given Row and Column Sums||77.7%|Medium|| +|1606|Find Servers That Handled Most Number of Requests||36.8%|Hard|| |1607|Sellers With No Sales||56.0%|Easy|| |1608|Special Array With X Elements Greater Than or Equal X||61.8%|Easy|| -|1609|Even Odd Tree||53.3%|Medium|| +|1609|Even Odd Tree||53.2%|Medium|| |1610|Maximum Number of Visible Points||28.5%|Hard|| |1611|Minimum One Bit Operations to Make Integers Zero||57.0%|Hard|| |1612|Check If Two Expression Trees are Equivalent||69.8%|Medium|| |1613|Find the Missing IDs||72.1%|Medium|| -|1614|Maximum Nesting Depth of the Parentheses||83.5%|Easy|| -|1615|Maximal Network Rank||51.6%|Medium|| -|1616|Split Two Strings to Make Palindrome||36.5%|Medium|| +|1614|Maximum Nesting Depth of the Parentheses||83.6%|Easy|| +|1615|Maximal Network Rank||51.7%|Medium|| +|1616|Split Two Strings to Make Palindrome||36.4%|Medium|| |1617|Count Subtrees With Max Distance Between Cities||63.5%|Hard|| |1618|Maximum Font to Fit a Sentence in a Screen||58.1%|Medium|| -|1619|Mean of Array After Removing Some Elements||65.5%|Easy|| -|1620|Coordinate With Maximum Network Quality||37.1%|Medium|| +|1619|Mean of Array After Removing Some Elements||65.6%|Easy|| +|1620|Coordinate With Maximum Network Quality||37.0%|Medium|| |1621|Number of Sets of K Non-Overlapping Line Segments||41.2%|Medium|| -|1622|Fancy Sequence||15.5%|Hard|| +|1622|Fancy Sequence||15.6%|Hard|| |1623|All Valid Triplets That Can Represent a Country||89.1%|Easy|| -|1624|Largest Substring Between Two Equal Characters||59.1%|Easy|| -|1625|Lexicographically Smallest String After Applying Operations||63.3%|Medium|| -|1626|Best Team With No Conflicts||37.2%|Medium|| -|1627|Graph Connectivity With Threshold||38.1%|Hard|| -|1628|Design an Expression Tree With Evaluate Function||80.7%|Medium|| +|1624|Largest Substring Between Two Equal Characters||59.2%|Easy|| +|1625|Lexicographically Smallest String After Applying Operations||63.4%|Medium|| +|1626|Best Team With No Conflicts||37.1%|Medium|| +|1627|Graph Connectivity With Threshold||38.2%|Hard|| +|1628|Design an Expression Tree With Evaluate Function||80.5%|Medium|| |1629|Slowest Key||59.0%|Easy|| -|1630|Arithmetic Subarrays||77.8%|Medium|| -|1631|Path With Minimum Effort||43.2%|Medium|| +|1630|Arithmetic Subarrays||77.7%|Medium|| +|1631|Path With Minimum Effort||43.3%|Medium|| |1632|Rank Transform of a Matrix||30.3%|Hard|| -|1633|Percentage of Users Attended a Contest||72.9%|Easy|| -|1634|Add Two Polynomials Represented as Linked Lists||56.3%|Medium|| -|1635|Hopper Company Queries I||56.3%|Hard|| -|1636|Sort Array by Increasing Frequency||66.5%|Easy|| -|1637|Widest Vertical Area Between Two Points Containing No Points||83.9%|Medium|| +|1633|Percentage of Users Attended a Contest||73.1%|Easy|| +|1634|Add Two Polynomials Represented as Linked Lists||56.0%|Medium|| +|1635|Hopper Company Queries I||56.0%|Hard|| +|1636|Sort Array by Increasing Frequency||66.6%|Easy|| +|1637|Widest Vertical Area Between Two Points Containing No Points||83.8%|Medium|| |1638|Count Substrings That Differ by One Character||67.8%|Medium|| |1639|Number of Ways to Form a Target String Given a Dictionary||39.3%|Hard|| -|1640|Check Array Formation Through Concatenation|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1640.Check-Array-Formation-Through-Concatenation)|63.1%|Easy|| -|1641|Count Sorted Vowel Strings||74.7%|Medium|| +|1640|Check Array Formation Through Concatenation|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1640.Check-Array-Formation-Through-Concatenation)|62.8%|Easy|| +|1641|Count Sorted Vowel Strings||74.6%|Medium|| |1642|Furthest Building You Can Reach||51.5%|Medium|| |1643|Kth Smallest Instructions||42.8%|Hard|| |1644|Lowest Common Ancestor of a Binary Tree II||57.5%|Medium|| -|1645|Hopper Company Queries II||41.1%|Hard|| +|1645|Hopper Company Queries II||41.3%|Hard|| |1646|Get Maximum in Generated Array|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1646.Get-Maximum-in-Generated-Array)|48.4%|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)|53.8%|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|| -|1649|Create Sorted Array through Instructions|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1649.Create-Sorted-Array-through-Instructions)|36.9%|Hard|| -|1650|Lowest Common Ancestor of a Binary Tree III||77.3%|Medium|| -|1651|Hopper Company Queries III||67.0%|Hard|| -|1652|Defuse the Bomb|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1652.Defuse-the-Bomb)|64.5%|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)|49.5%|Medium|| -|1654|Minimum Jumps to Reach Home|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1654.Minimum-Jumps-to-Reach-Home)|26.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.9%|Medium|| +|1649|Create Sorted Array through Instructions|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1649.Create-Sorted-Array-through-Instructions)|36.5%|Hard|| +|1650|Lowest Common Ancestor of a Binary Tree III||77.4%|Medium|| +|1651|Hopper Company Queries III||66.8%|Hard|| +|1652|Defuse the Bomb|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1652.Defuse-the-Bomb)|64.4%|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)|49.6%|Medium|| +|1654|Minimum Jumps to Reach Home|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1654.Minimum-Jumps-to-Reach-Home)|26.4%|Medium|| |1655|Distribute Repeating Integers|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1655.Distribute-Repeating-Integers)|40.6%|Hard|| |1656|Design an Ordered Stream|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1656.Design-an-Ordered-Stream)|82.5%|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)|51.3%|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)|30.7%|Medium|| -|1659|Maximize Grid Happiness|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1659.Maximize-Grid-Happiness)|35.2%|Hard|| -|1660|Correct a Binary Tree||78.8%|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)|83.9%|Easy|| +|1659|Maximize Grid Happiness|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1659.Maximize-Grid-Happiness)|35.1%|Hard|| +|1660|Correct a Binary Tree||78.9%|Medium|| +|1661|Average Time of Process per Machine||79.5%|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)|83.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)|60.1%|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)|60.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)|68.4%|Hard|| -|1666|Change the Root of a Binary Tree||68.5%|Medium|| -|1667|Fix Names in a Table||64.1%|Easy|| +|1665|Minimum Initial Energy to Finish Tasks|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1665.Minimum-Initial-Energy-to-Finish-Tasks)|68.3%|Hard|| +|1666|Change the Root of a Binary Tree||68.7%|Medium|| +|1667|Fix Names in a Table||63.9%|Easy|| |1668|Maximum Repeating Substring|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1668.Maximum-Repeating-Substring)|38.7%|Easy|| -|1669|Merge In Between Linked Lists|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1669.Merge-In-Between-Linked-Lists)|78.4%|Medium|| -|1670|Design Front Middle Back Queue|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1670.Design-Front-Middle-Back-Queue)|54.5%|Medium|| +|1669|Merge In Between Linked Lists|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1669.Merge-In-Between-Linked-Lists)|78.3%|Medium|| +|1670|Design Front Middle Back Queue|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1670.Design-Front-Middle-Back-Queue)|54.6%|Medium|| |1671|Minimum Number of Removals to Make Mountain Array||45.8%|Hard|| |1672|Richest Customer Wealth|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1672.Richest-Customer-Wealth)|88.8%|Easy|| -|1673|Find the Most Competitive Subsequence|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1673.Find-the-Most-Competitive-Subsequence)|38.0%|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)|34.2%|Medium|| -|1675|Minimize Deviation in Array||44.8%|Hard|| +|1673|Find the Most Competitive Subsequence|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1673.Find-the-Most-Competitive-Subsequence)|38.1%|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)|34.3%|Medium|| +|1675|Minimize Deviation in Array||44.9%|Hard|| |1676|Lowest Common Ancestor of a Binary Tree IV||77.8%|Medium|| -|1677|Product's Worth Over Invoices||74.6%|Easy|| -|1678|Goal Parser Interpretation|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1678.Goal-Parser-Interpretation)|86.9%|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)|52.1%|Medium|| +|1677|Product's Worth Over Invoices||74.7%|Easy|| +|1678|Goal Parser Interpretation|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1678.Goal-Parser-Interpretation)|86.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)|52.0%|Medium|| |1680|Concatenation of Consecutive Binary Numbers|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1680.Concatenation-of-Consecutive-Binary-Numbers)|45.1%|Medium|| |1681|Minimum Incompatibility|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1681.Minimum-Incompatibility)|34.8%|Hard|| -|1682|Longest Palindromic Subsequence II||51.8%|Medium|| +|1682|Longest Palindromic Subsequence II||52.0%|Medium|| |1683|Invalid Tweets||91.7%|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)|84.3%|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)|61.8%|Medium|| -|1686|Stone Game VI||48.9%|Medium|| -|1687|Delivering Boxes from Storage to Ports||34.6%|Hard|| +|1686|Stone Game VI||48.8%|Medium|| +|1687|Delivering Boxes from Storage to Ports||34.7%|Hard|| |1688|Count of Matches in Tournament|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1688.Count-of-Matches-in-Tournament)|83.4%|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)|88.5%|Medium|| +|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)|88.4%|Medium|| |1690|Stone Game VII|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1690.Stone-Game-VII)|46.5%|Medium|| -|1691|Maximum Height by Stacking Cuboids ||49.5%|Hard|| -|1692|Count Ways to Distribute Candies||62.1%|Hard|| -|1693|Daily Leads and Partners||91.6%|Easy|| -|1694|Reformat Phone Number|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1694.Reformat-Phone-Number)|67.3%|Easy|| +|1691|Maximum Height by Stacking Cuboids ||49.7%|Hard|| +|1692|Count Ways to Distribute Candies||62.7%|Hard|| +|1693|Daily Leads and Partners||91.3%|Easy|| +|1694|Reformat Phone Number|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1694.Reformat-Phone-Number)|67.1%|Easy|| |1695|Maximum Erasure Value|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1695.Maximum-Erasure-Value)|49.5%|Medium|| |1696|Jump Game VI||56.3%|Medium|| -|1697|Checking Existence of Edge Length Limited Paths||56.0%|Hard|| -|1698|Number of Distinct Substrings in a String||55.0%|Medium|| -|1699|Number of Calls Between Two Persons||85.6%|Medium|| +|1697|Checking Existence of Edge Length Limited Paths||55.9%|Hard|| +|1698|Number of Distinct Substrings in a String||55.3%|Medium|| +|1699|Number of Calls Between Two Persons||85.8%|Medium|| |1700|Number of Students Unable to Eat Lunch||70.1%|Easy|| |1701|Average Waiting Time||61.8%|Medium|| |1702|Maximum Binary String After Change||61.9%|Medium|| -|1703|Minimum Adjacent Swaps for K Consecutive Ones||40.5%|Hard|| -|1704|Determine if String Halves Are Alike||78.4%|Easy|| +|1703|Minimum Adjacent Swaps for K Consecutive Ones||40.6%|Hard|| +|1704|Determine if String Halves Are Alike||78.2%|Easy|| |1705|Maximum Number of Eaten Apples||42.5%|Medium|| -|1706|Where Will the Ball Fall||57.9%|Medium|| -|1707|Maximum XOR With an Element From Array||48.6%|Hard|| -|1708|Largest Subarray Length K||64.6%|Easy|| -|1709|Biggest Window Between Visits||81.2%|Medium|| -|1710|Maximum Units on a Truck||72.4%|Easy|| +|1706|Where Will the Ball Fall||58.1%|Medium|| +|1707|Maximum XOR With an Element From Array||48.5%|Hard|| +|1708|Largest Subarray Length K||64.5%|Easy|| +|1709|Biggest Window Between Visits||81.1%|Medium|| +|1710|Maximum Units on a Truck||72.3%|Easy|| |1711|Count Good Meals||25.5%|Medium|| |1712|Ways to Split Array Into Three Subarrays||29.8%|Medium|| -|1713|Minimum Operations to Make a Subsequence||45.0%|Hard|| -|1714|Sum Of Special Evenly-Spaced Elements In Array||44.2%|Hard|| -|1715|Count Apples and Oranges||78.6%|Medium|| -|1716|Calculate Money in Leetcode Bank||70.6%|Easy|| -|1717|Maximum Score From Removing Substrings||35.2%|Medium|| -|1718|Construct the Lexicographically Largest Valid Sequence||38.5%|Medium|| -|1719|Number Of Ways To Reconstruct A Tree||33.0%|Hard|| -|1720|Decode XORed Array||86.1%|Easy|| -|1721|Swapping Nodes in a Linked List||64.8%|Medium|| -|1722|Minimize Hamming Distance After Swap Operations||41.9%|Medium|| -|1723|Find Minimum Time to Finish All Jobs||35.3%|Hard|| +|1713|Minimum Operations to Make a Subsequence||45.3%|Hard|| +|1714|Sum Of Special Evenly-Spaced Elements In Array||44.8%|Hard|| +|1715|Count Apples and Oranges||77.2%|Medium|| +|1716|Calculate Money in Leetcode Bank||70.5%|Easy|| +|1717|Maximum Score From Removing Substrings||36.3%|Medium|| +|1718|Construct the Lexicographically Largest Valid Sequence||40.6%|Medium|| +|1719|Number Of Ways To Reconstruct A Tree||34.9%|Hard|| +|1720|Decode XORed Array||86.5%|Easy|| +|1721|Swapping Nodes in a Linked List||65.3%|Medium|| +|1722|Minimize Hamming Distance After Swap Operations||43.2%|Medium|| +|1723|Find Minimum Time to Finish All Jobs||37.8%|Hard|| |------------|-------------------------------------------------------|-------| ----------------| ---------------|-------------| ------------------------------------------------------------------ @@ -1858,7 +1872,7 @@ ------------------------------------------------------------------ -## 二.分类 +## 三.分类 ## Array diff --git a/automation/models/lcproblems.go b/automation/models/lcproblems.go deleted file mode 100644 index 5efb9962..00000000 --- a/automation/models/lcproblems.go +++ /dev/null @@ -1,43 +0,0 @@ -package models - -type LeetCodeProblemAll struct { - UserName string `json:"user_name"` - NumSolved int32 `json:"num_solved"` - NumTotal int32 `json:"num_total"` - AcEasy int32 `json:"ac_easy"` - AcMedium int32 `json:"ac_medium"` - AcHard int32 `json:"ac_hard"` - StatStatusPairs []StatStatusPairs `json:"stat_status_pairs"` - FrequencyHigh int32 `json:"frequency_high"` - FrequencyMid int32 `json:"frequency_mid"` - CategorySlug string `json:"category_slug"` -} - -type StatStatusPairs struct { - Stat Stat `json:"stat"` - Difficulty Difficulty `json:"difficulty"` - PaidOnly bool `json:"paid_only"` - IsFavor bool `json:"is_favor"` - Frequency float64 `json:"frequency"` - Progress float64 `json:"progress"` -} - -type Stat struct { - QuestionTitle string `json:"question__title"` - QuestionTitleSlug string `json:"question__title_slug"` - TotalAcs float64 `json:"total_acs"` - TotalSubmitted float64 `json:"total_submitted"` - Acceptance string - Difficulty string - FrontendQuestionId int32 `json:"frontend_question_id"` -} - -type Difficulty struct { - Level int32 `json:"level"` -} - -var DifficultyMap = map[int32]string{ - 1: "Easy", - 2: "Medium", - 3: "Hard", -} diff --git a/automation/render.go b/automation/render.go deleted file mode 100644 index 263d121e..00000000 --- a/automation/render.go +++ /dev/null @@ -1,190 +0,0 @@ -package main - -import ( - "bufio" - "bytes" - "encoding/json" - "fmt" - m "github.com/halfrost/LeetCode-Go/automation/models" - "html/template" - "io" - "io/ioutil" - "net/http" - "os" - "regexp" - "sort" - "strconv" - "strings" -) - -var try int - -func main() { - var ( - result []m.StatStatusPairs - lpa m.LeetCodeProblemAll - ) - - body := getProblemAllList() - err := json.Unmarshal(body, &lpa) - if err != nil { - fmt.Println(err) - return - } - result = lpa.StatStatusPairs - mdrows := []m.Mdrow{} - for i := 0; i < len(result); i++ { - mdrows = append(mdrows, convertModel(result[i])) - } - sort.Sort(m.SortByQuestionId(mdrows)) - solutionIds := loadSolutionsDir() - generateMdRows(solutionIds, mdrows) - // res, _ := json.Marshal(mdrows) - //writeFile("leetcode_problem", res) - mds := m.Mdrows{Mdrows: mdrows} - res, err := readFile("./template.markdown", "{{.AvailableTable}}", len(solutionIds), try, mds) - if err != nil { - fmt.Println(err) - return - } - writeFile("../README.md", res) - //makeReadmeFile(mds) -} - -func getProblemAllList() []byte { - resp, err := http.Get("https://leetcode.com/api/problems/all/") - if err != nil { - fmt.Println(err) - return []byte{} - } - defer resp.Body.Close() - - body, err := ioutil.ReadAll(resp.Body) - if err != nil { - fmt.Println(err) - return []byte{} - } - if resp.StatusCode == 200 { - fmt.Println("ok") - } - return body -} - -func writeFile(fileName string, content []byte) { - file, err := os.OpenFile(fileName, os.O_RDWR|os.O_CREATE, 0777) - if err != nil { - fmt.Println(err) - } - defer file.Close() - - _, err = file.Write(content) - if err != nil { - fmt.Println(err) - } - fmt.Println("write file successful") -} - -func convertModel(ssp m.StatStatusPairs) m.Mdrow { - res := m.Mdrow{} - res.FrontendQuestionId = ssp.Stat.FrontendQuestionId - res.QuestionTitle = ssp.Stat.QuestionTitle - res.QuestionTitleSlug = ssp.Stat.QuestionTitleSlug - res.Acceptance = fmt.Sprintf("%.1f%%", (ssp.Stat.TotalAcs/ssp.Stat.TotalSubmitted)*100) - res.Difficulty = m.DifficultyMap[ssp.Difficulty.Level] - res.Frequency = fmt.Sprintf("%f", ssp.Frequency) - return res -} - -func loadSolutionsDir() []int { - files, err := ioutil.ReadDir("../leetcode/") - if err != nil { - fmt.Println(err) - } - solutionIds := []int{} - for _, f := range files { - if f.Name()[4] == '.' { - tmp, err := strconv.Atoi(f.Name()[:4]) - if err != nil { - fmt.Println(err) - } - solutionIds = append(solutionIds, tmp) - } - } - sort.Ints(solutionIds) - try = len(files) - len(solutionIds) - fmt.Printf("读取了 %v 道题的题解,当前目录下有 %v 个文件(可能包含 .DS_Store),有 %v 道题在尝试中\n", len(solutionIds), len(files), len(files)-len(solutionIds)) - return solutionIds -} - -func generateMdRows(solutionIds []int, mdrows []m.Mdrow) { - for i := 0; i < len(solutionIds); i++ { - id := mdrows[solutionIds[i]-1].FrontendQuestionId - if solutionIds[i] == int(id) { - //fmt.Printf("id = %v i = %v solutionIds = %v\n", id, i, solutionIds[i]) - mdrows[id-1].SolutionPath = fmt.Sprintf("[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/%v)", fmt.Sprintf("%04d.%v", id, strings.Replace(mdrows[id-1].QuestionTitle, " ", "-", -1))) - } else { - fmt.Printf("序号出错了 solutionIds = %v id = %v\n", solutionIds[i], id) - } - } - fmt.Printf("") -} - -func makeReadmeFile(mdrows m.Mdrows) { - file := "./README.md" - os.Remove(file) - var b bytes.Buffer - tmpl := template.Must(template.New("readme").Parse(readTMPL("template.markdown"))) - err := tmpl.Execute(&b, mdrows) - if err != nil { - fmt.Println(err) - } - // 保存 README.md 文件 - writeFile(file, b.Bytes()) -} - -func readTMPL(path string) string { - file, err := os.Open(path) - if err != nil { - fmt.Println(err) - } - defer file.Close() - - data, err := ioutil.ReadAll(file) - if err != nil { - fmt.Println(err) - } - return string(data) -} - -func readFile(filePath, template string, total, try int, mdrows m.Mdrows) ([]byte, error) { - f, err := os.OpenFile(filePath, os.O_RDONLY, 0644) - if err != nil { - return nil, err - } - defer f.Close() - reader, output := bufio.NewReader(f), []byte{} - - for { - line, _, err := reader.ReadLine() - if err != nil { - if err == io.EOF { - return output, nil - } - return nil, err - } - if ok, _ := regexp.Match(template, line); ok { - reg := regexp.MustCompile(template) - newByte := reg.ReplaceAll(line, []byte(mdrows.AvailableTable())) - output = append(output, newByte...) - output = append(output, []byte("\n")...) - } else if ok, _ := regexp.Match("{{.TotalNum}}", line); ok { - reg := regexp.MustCompile("{{.TotalNum}}") - newByte := reg.ReplaceAll(line, []byte(fmt.Sprintf("以下已经收录了 %v 道题的题解,还有 %v 道题在尝试优化到 beats 100%%", total, try))) - output = append(output, newByte...) - output = append(output, []byte("\n")...) - } else { - output = append(output, line...) - output = append(output, []byte("\n")...) - } - } -} diff --git a/ctl/config.go b/ctl/config.go new file mode 100644 index 00000000..8743ad75 --- /dev/null +++ b/ctl/config.go @@ -0,0 +1,31 @@ +package main + +import ( + "fmt" + "log" + + "github.com/BurntSushi/toml" +) + +const ( + configTOML = "config.toml" +) + +type config struct { + Username string + Password string + Cookie string +} + +func (c config) String() string { + return fmt.Sprintf("Username: %s, Password: %s", c.Username, c.Password) +} + +func getConfig() *config { + cfg := new(config) + if _, err := toml.DecodeFile(configTOML, &cfg); err != nil { + log.Panicf(err.Error()) + } + // log.Printf("get config: %s", cfg) + return cfg +} diff --git a/ctl/models/lcproblems.go b/ctl/models/lcproblems.go new file mode 100644 index 00000000..aad80cd1 --- /dev/null +++ b/ctl/models/lcproblems.go @@ -0,0 +1,103 @@ +package models + +import ( + "fmt" +) + +// LeetCodeProblemAll define +type LeetCodeProblemAll struct { + UserName string `json:"user_name"` + NumSolved int32 `json:"num_solved"` + NumTotal int32 `json:"num_total"` + AcEasy int32 `json:"ac_easy"` + AcMedium int32 `json:"ac_medium"` + AcHard int32 `json:"ac_hard"` + StatStatusPairs []StatStatusPairs `json:"stat_status_pairs"` + FrequencyHigh int32 `json:"frequency_high"` + FrequencyMid int32 `json:"frequency_mid"` + CategorySlug string `json:"category_slug"` + AcEasyTotal int32 + AcMediumTotal int32 + AcHardTotal int32 +} + +// ConvertUserInfoModel define +func ConvertUserInfoModel(lpa LeetCodeProblemAll) UserInfo { + info := UserInfo{} + info.UserName = lpa.UserName + info.NumSolved = lpa.NumSolved + info.NumTotal = lpa.NumTotal + info.AcEasy = lpa.AcEasy + info.AcMedium = lpa.AcMedium + info.AcHard = lpa.AcHard + info.FrequencyHigh = lpa.FrequencyHigh + info.FrequencyMid = lpa.FrequencyMid + info.CategorySlug = lpa.CategorySlug + return info +} + +// StatStatusPairs define +type StatStatusPairs struct { + Stat Stat `json:"stat"` + Status string `json:"status"` + Difficulty Difficulty `json:"difficulty"` + PaidOnly bool `json:"paid_only"` + IsFavor bool `json:"is_favor"` + Frequency float64 `json:"frequency"` + Progress float64 `json:"progress"` +} + +// ConvertMdModel define +func ConvertMdModel(problems []StatStatusPairs) []Mdrow { + mdrows := []Mdrow{} + for _, problem := range problems { + res := Mdrow{} + res.FrontendQuestionID = problem.Stat.FrontendQuestionID + res.QuestionTitle = problem.Stat.QuestionTitle + res.QuestionTitleSlug = problem.Stat.QuestionTitleSlug + res.Acceptance = fmt.Sprintf("%.1f%%", (problem.Stat.TotalAcs/problem.Stat.TotalSubmitted)*100) + res.Difficulty = DifficultyMap[problem.Difficulty.Level] + res.Frequency = fmt.Sprintf("%f", problem.Frequency) + mdrows = append(mdrows, res) + } + return mdrows +} + +// ConvertMdModelFromIds define +func ConvertMdModelFromIds(problemsMap map[int]StatStatusPairs, ids []int) []Mdrow { + mdrows := []Mdrow{} + for _, v := range ids { + res, problem := Mdrow{}, problemsMap[v] + res.FrontendQuestionID = problem.Stat.FrontendQuestionID + res.QuestionTitle = problem.Stat.QuestionTitle + res.QuestionTitleSlug = problem.Stat.QuestionTitleSlug + res.Acceptance = fmt.Sprintf("%.1f%%", (problem.Stat.TotalAcs/problem.Stat.TotalSubmitted)*100) + res.Difficulty = DifficultyMap[problem.Difficulty.Level] + res.Frequency = fmt.Sprintf("%f", problem.Frequency) + mdrows = append(mdrows, res) + } + return mdrows +} + +// Stat define +type Stat struct { + QuestionTitle string `json:"question__title"` + QuestionTitleSlug string `json:"question__title_slug"` + TotalAcs float64 `json:"total_acs"` + TotalSubmitted float64 `json:"total_submitted"` + Acceptance string + Difficulty string + FrontendQuestionID int32 `json:"frontend_question_id"` +} + +// Difficulty define +type Difficulty struct { + Level int32 `json:"level"` +} + +// DifficultyMap define +var DifficultyMap = map[int32]string{ + 1: "Easy", + 2: "Medium", + 3: "Hard", +} diff --git a/automation/models/mdrow.go b/ctl/models/mdrow.go similarity index 75% rename from automation/models/mdrow.go rename to ctl/models/mdrow.go index 8070df19..8b6b6bbc 100644 --- a/automation/models/mdrow.go +++ b/ctl/models/mdrow.go @@ -4,8 +4,9 @@ import ( "fmt" ) +// Mdrow define type Mdrow struct { - FrontendQuestionId int32 `json:"question_id"` + FrontendQuestionID int32 `json:"question_id"` QuestionTitle string `json:"question__title"` QuestionTitleSlug string `json:"question__title_slug"` SolutionPath string `json:"solution_path"` @@ -16,18 +17,19 @@ type Mdrow struct { // | 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) + return fmt.Sprintf("|%04d|%v|%v|%v|%v||\n", m.FrontendQuestionID, m.QuestionTitle, m.SolutionPath, m.Acceptance, m.Difficulty) } -// SortByQuestionId define -type SortByQuestionId []Mdrow +// SortByQuestionID define +type SortByQuestionID []Mdrow -func (a SortByQuestionId) Len() int { return len(a) } -func (a SortByQuestionId) Swap(i, j int) { a[i], a[j] = a[j], a[i] } -func (a SortByQuestionId) Less(i, j int) bool { - return a[i].FrontendQuestionId < a[j].FrontendQuestionId +func (a SortByQuestionID) Len() int { return len(a) } +func (a SortByQuestionID) Swap(i, j int) { a[i], a[j] = a[j], a[i] } +func (a SortByQuestionID) Less(i, j int) bool { + return a[i].FrontendQuestionID < a[j].FrontendQuestionID } +// Mdrows define type Mdrows struct { Mdrows []Mdrow } @@ -45,6 +47,7 @@ func (mds Mdrows) table() string { return res } +// AvailableTable define func (mds Mdrows) AvailableTable() string { return mds.table() } diff --git a/ctl/models/user.go b/ctl/models/user.go new file mode 100644 index 00000000..2f296458 --- /dev/null +++ b/ctl/models/user.go @@ -0,0 +1,44 @@ +package models + +import ( + "fmt" +) + +// UserInfo define +type UserInfo struct { + UserName string `json:"user_name"` + NumSolved int32 `json:"num_solved"` + NumTotal int32 `json:"num_total"` + AcEasy int32 `json:"ac_easy"` + AcMedium int32 `json:"ac_medium"` + AcHard int32 `json:"ac_hard"` + EasyTotal int32 + MediumTotal int32 + HardTotal int32 + OptimizingEasy int32 + OptimizingMedium int32 + OptimizingHard int32 + FrequencyHigh int32 `json:"frequency_high"` + FrequencyMid int32 `json:"frequency_mid"` + CategorySlug string `json:"category_slug"` +} + +// | | Easy | Medium | Hard | Total | optimizing | +// |:--------:|:--------------------------------------------------------------|:--------:|:--------:|:--------:|:--------:| +func (ui UserInfo) table() string { + res := "| | Easy | Medium | Hard | Total |\n" + res += "|:--------:|:--------:|:--------:|:--------:|:--------:|\n" + res += fmt.Sprintf("|Optimizing|%v|%v|%v|%v|\n", ui.OptimizingEasy, ui.OptimizingMedium, ui.OptimizingHard, ui.OptimizingEasy+ui.OptimizingMedium+ui.OptimizingHard) + res += fmt.Sprintf("|Accepted|**%v**|**%v**|**%v**|**%v**|\n", ui.AcEasy, ui.AcMedium, ui.AcHard, ui.AcEasy+ui.AcMedium+ui.AcHard) + res += fmt.Sprintf("|Total|%v|%v|%v|%v|\n", ui.EasyTotal, ui.MediumTotal, ui.HardTotal, ui.EasyTotal+ui.MediumTotal+ui.HardTotal) + res += fmt.Sprintf("|Perfection Rate|%.1f%%|%.1f%%|%.1f%%|%.1f%%|\n", (1-float64(ui.OptimizingEasy)/float64(ui.AcEasy))*100, (1-float64(ui.OptimizingMedium)/float64(ui.AcMedium))*100, (1-float64(ui.OptimizingHard)/float64(ui.AcHard))*100, (1-float64(ui.OptimizingEasy+ui.OptimizingMedium+ui.OptimizingHard)/float64(ui.AcEasy+ui.AcMedium+ui.AcHard))*100) + res += fmt.Sprintf("|Completion Rate|%.1f%%|%.1f%%|%.1f%%|%.1f%%|\n", float64(ui.AcEasy)/float64(ui.EasyTotal)*100, float64(ui.AcMedium)/float64(ui.MediumTotal)*100, float64(ui.AcHard)/float64(ui.HardTotal)*100, float64(ui.AcEasy+ui.AcMedium+ui.AcHard)/float64(ui.EasyTotal+ui.MediumTotal+ui.HardTotal)*100) + // 加这一行是为了撑开整个表格 + res += "|------------|----------------------------|----------------------------|----------------------------|----------------------------|" + return res +} + +// PersonalData define +func (ui UserInfo) PersonalData() string { + return ui.table() +} diff --git a/ctl/rangking.go b/ctl/rangking.go new file mode 100644 index 00000000..3e819691 --- /dev/null +++ b/ctl/rangking.go @@ -0,0 +1,36 @@ +package main + +import ( + "fmt" + "strconv" + "strings" +) + +// getRanking 让这个方法优雅一点 +func getRanking() int { + // 获取网页数据 + URL := fmt.Sprintf("https://leetcode.com/%s/", getConfig().Username) + data := getRaw(URL) + str := string(data) + // 通过不断裁剪 str 获取排名信息 + fmt.Println(str) + i := strings.Index(str, "ng-init") + j := i + strings.Index(str[i:], "ng-cloak") + str = str[i:j] + i = strings.Index(str, "(") + j = strings.Index(str, ")") + str = str[i:j] + // fmt.Println("2\n", str) + strs := strings.Split(str, ",") + str = strs[6] + // fmt.Println("1\n", str) + i = strings.Index(str, "'") + j = 2 + strings.Index(str[2:], "'") + // fmt.Println("0\n", str) + str = str[i+1 : j] + r, err := strconv.Atoi(str) + if err != nil { + fmt.Printf("无法把 %s 转换成数字Ranking", str) + } + return r +} diff --git a/ctl/render.go b/ctl/render.go new file mode 100644 index 00000000..55fbfe73 --- /dev/null +++ b/ctl/render.go @@ -0,0 +1,108 @@ +package main + +import ( + "bufio" + "encoding/json" + "fmt" + m "github.com/halfrost/LeetCode-Go/ctl/models" + "io" + "os" + "regexp" + "sort" + "strings" +) + +func main() { + var ( + problems []m.StatStatusPairs + lpa m.LeetCodeProblemAll + info m.UserInfo + ) + // 请求所有题目信息 + body := getProblemAllList(AllProblemURL) + problemsMap, optimizingIds := map[int]m.StatStatusPairs{}, []int{} + err := json.Unmarshal(body, &lpa) + if err != nil { + fmt.Println(err) + return + } + //writeFile("leetcode_problem.json", body) + + // 拼凑 README 需要渲染的数据 + problems = lpa.StatStatusPairs + info = m.ConvertUserInfoModel(lpa) + for _, v := range problems { + problemsMap[int(v.Stat.FrontendQuestionID)] = v + } + mdrows := m.ConvertMdModel(problems) + sort.Sort(m.SortByQuestionID(mdrows)) + solutionIds, try := loadSolutionsDir() + generateMdRows(solutionIds, mdrows) + info.EasyTotal, info.MediumTotal, info.HardTotal, info.OptimizingEasy, info.OptimizingMedium, info.OptimizingHard, optimizingIds = statisticalData(problemsMap, solutionIds) + omdrows := m.ConvertMdModelFromIds(problemsMap, optimizingIds) + sort.Sort(m.SortByQuestionID(omdrows)) + + // 按照模板渲染 README + res, err := renderReadme("./template.markdown", len(solutionIds), try, m.Mdrows{Mdrows: mdrows}, m.Mdrows{Mdrows: omdrows}, info) + if err != nil { + fmt.Println(err) + return + } + writeFile("../README.md", res) + //makeReadmeFile(mds) +} + +func generateMdRows(solutionIds []int, mdrows []m.Mdrow) { + for i := 0; i < len(solutionIds); i++ { + id := mdrows[solutionIds[i]-1].FrontendQuestionID + if solutionIds[i] == int(id) { + //fmt.Printf("id = %v i = %v solutionIds = %v\n", id, i, solutionIds[i]) + mdrows[id-1].SolutionPath = fmt.Sprintf("[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/%v)", fmt.Sprintf("%04d.%v", id, strings.Replace(mdrows[id-1].QuestionTitle, " ", "-", -1))) + } else { + fmt.Printf("序号出错了 solutionIds = %v id = %v\n", solutionIds[i], id) + } + } +} + +func renderReadme(filePath string, total, try int, mdrows, omdrows m.Mdrows, user m.UserInfo) ([]byte, error) { + f, err := os.OpenFile(filePath, os.O_RDONLY, 0644) + if err != nil { + return nil, err + } + defer f.Close() + reader, output := bufio.NewReader(f), []byte{} + + for { + line, _, err := reader.ReadLine() + if err != nil { + if err == io.EOF { + return output, nil + } + return nil, err + } + if ok, _ := regexp.Match("{{.AvailableTable}}", line); ok { + reg := regexp.MustCompile("{{.AvailableTable}}") + newByte := reg.ReplaceAll(line, []byte(mdrows.AvailableTable())) + output = append(output, newByte...) + output = append(output, []byte("\n")...) + } else if ok, _ := regexp.Match("{{.TotalNum}}", line); ok { + reg := regexp.MustCompile("{{.TotalNum}}") + newByte := reg.ReplaceAll(line, []byte(fmt.Sprintf("以下已经收录了 %v 道题的题解,还有 %v 道题在尝试优化到 beats 100%%", total, try))) + output = append(output, newByte...) + output = append(output, []byte("\n")...) + } else if ok, _ := regexp.Match("{{.PersonalData}}", line); ok { + reg := regexp.MustCompile("{{.PersonalData}}") + newByte := reg.ReplaceAll(line, []byte(user.PersonalData())) + output = append(output, newByte...) + output = append(output, []byte("\n")...) + } else if ok, _ := regexp.Match("{{.OptimizingTable}}", line); ok { + reg := regexp.MustCompile("{{.OptimizingTable}}") + newByte := reg.ReplaceAll(line, []byte(fmt.Sprintf("以下 %v 道题还需要优化到 100%% 的题目列表\n\n%v", (user.OptimizingEasy+user.OptimizingMedium+user.OptimizingHard), omdrows.AvailableTable()))) + output = append(output, newByte...) + output = append(output, []byte("\n")...) + } else { + output = append(output, line...) + output = append(output, []byte("\n")...) + } + } +} diff --git a/ctl/request.go b/ctl/request.go new file mode 100644 index 00000000..3b876595 --- /dev/null +++ b/ctl/request.go @@ -0,0 +1,72 @@ +package main + +import ( + "fmt" + "github.com/mozillazg/request" + "io/ioutil" + "net/http" +) + +const ( + // AllProblemURL define + AllProblemURL = "https://leetcode.com/api/problems/all/" + // LoginPageURL define + LoginPageURL = "https://leetcode.com/accounts/login/" + // AlgorithmsURL define + AlgorithmsURL = "https://leetcode.com/api/problems/Algorithms/" +) + +var req *request.Request + +func newReq() *request.Request { + if req == nil { + req = signin() + } + return req +} + +func signin() *request.Request { + cfg := getConfig() + req := request.NewRequest(new(http.Client)) + req.Headers = map[string]string{ + "Content-Type": "application/json", + "Accept-Encoding": "", + "cookie": cfg.Cookie, + "Referer": "https://leetcode.com/accounts/login/", + "origin": "https://leetcode.com", + } + return req +} + +func getRaw(URL string) []byte { + req := newReq() + resp, err := req.Get(URL) + if err != nil { + fmt.Printf("getRaw: Get Error: " + err.Error()) + } + body, err := ioutil.ReadAll(resp.Body) + if err != nil { + fmt.Printf("getRaw: Read Error: " + err.Error()) + } + return body +} + +func getProblemAllList(URL string) []byte { + req := newReq() + resp, err := req.Get(URL) + if err != nil { + fmt.Println(err) + return []byte{} + } + defer resp.Body.Close() + + body, err := ioutil.ReadAll(resp.Body) + if err != nil { + fmt.Println(err) + return []byte{} + } + if resp.StatusCode == 200 { + fmt.Println("ok") + } + return body +} diff --git a/ctl/statistic.go b/ctl/statistic.go new file mode 100644 index 00000000..036204a2 --- /dev/null +++ b/ctl/statistic.go @@ -0,0 +1,40 @@ +package main + +import ( + m "github.com/halfrost/LeetCode-Go/ctl/models" + "sort" +) + +func statisticalData(problemsMap map[int]m.StatStatusPairs, solutionIds []int) (easyTotal, mediumTotal, hardTotal, optimizingEasy, optimizingMedium, optimizingHard int32, optimizingIds []int) { + easyTotal, mediumTotal, hardTotal, optimizingEasy, optimizingMedium, optimizingHard, optimizingIds = 0, 0, 0, 0, 0, 0, []int{} + for _, v := range problemsMap { + switch m.DifficultyMap[v.Difficulty.Level] { + case "Easy": + { + easyTotal++ + if v.Status == "ac" && binarySearch(solutionIds, int(v.Stat.FrontendQuestionID)) == -1 { + optimizingEasy++ + optimizingIds = append(optimizingIds, int(v.Stat.FrontendQuestionID)) + } + } + case "Medium": + { + mediumTotal++ + if v.Status == "ac" && binarySearch(solutionIds, int(v.Stat.FrontendQuestionID)) == -1 { + optimizingMedium++ + optimizingIds = append(optimizingIds, int(v.Stat.FrontendQuestionID)) + } + } + case "Hard": + { + hardTotal++ + if v.Status == "ac" && binarySearch(solutionIds, int(v.Stat.FrontendQuestionID)) == -1 { + optimizingHard++ + optimizingIds = append(optimizingIds, int(v.Stat.FrontendQuestionID)) + } + } + } + } + sort.Ints(optimizingIds) + return easyTotal, mediumTotal, hardTotal, optimizingEasy, optimizingMedium, optimizingHard, optimizingIds +} diff --git a/automation/template.markdown b/ctl/template.markdown similarity index 99% rename from automation/template.markdown rename to ctl/template.markdown index 5562ab4a..34939dea 100644 --- a/automation/template.markdown +++ b/ctl/template.markdown @@ -82,6 +82,9 @@ * [✅ Segment Tree](#segment-tree) * [✅ Binary Indexed Tree](#binary-indexed-tree) +
+
+ | 数据结构 | 变种 | 相关题目 | 讲解文章 | |:-------:|:-------|:------|:------| |顺序线性表:向量|||| @@ -118,7 +121,11 @@ ## LeetCode Problems -## 一. 目录 +## 一. 个人数据 + +{{.PersonalData}} + +## 二. 目录 {{.TotalNum}} @@ -133,7 +140,7 @@ ------------------------------------------------------------------ -## 二.分类 +## 三.分类 ## Array diff --git a/ctl/template_render.go b/ctl/template_render.go new file mode 100644 index 00000000..ed3d123f --- /dev/null +++ b/ctl/template_render.go @@ -0,0 +1,37 @@ +package main + +import ( + "bytes" + "fmt" + m "github.com/halfrost/LeetCode-Go/ctl/models" + "html/template" + "io/ioutil" + "os" +) + +func makeReadmeFile(mdrows m.Mdrows) { + file := "./README.md" + os.Remove(file) + var b bytes.Buffer + tmpl := template.Must(template.New("readme").Parse(readTMPL("template.markdown"))) + err := tmpl.Execute(&b, mdrows) + if err != nil { + fmt.Println(err) + } + // 保存 README.md 文件 + writeFile(file, b.Bytes()) +} + +func readTMPL(path string) string { + file, err := os.Open(path) + if err != nil { + fmt.Println(err) + } + defer file.Close() + + data, err := ioutil.ReadAll(file) + if err != nil { + fmt.Println(err) + } + return string(data) +} diff --git a/ctl/util.go b/ctl/util.go new file mode 100644 index 00000000..d33ea074 --- /dev/null +++ b/ctl/util.go @@ -0,0 +1,58 @@ +package main + +import ( + "fmt" + "io/ioutil" + "os" + "sort" + "strconv" +) + +func loadSolutionsDir() ([]int, int) { + files, err := ioutil.ReadDir("../leetcode/") + if err != nil { + fmt.Println(err) + } + solutionIds := []int{} + for _, f := range files { + if f.Name()[4] == '.' { + tmp, err := strconv.Atoi(f.Name()[:4]) + if err != nil { + fmt.Println(err) + } + solutionIds = append(solutionIds, tmp) + } + } + sort.Ints(solutionIds) + fmt.Printf("读取了 %v 道题的题解,当前目录下有 %v 个文件(可能包含 .DS_Store),目录中有 %v 道题在尝试中\n", len(solutionIds), len(files), len(files)-len(solutionIds)) + return solutionIds, len(files) - len(solutionIds) +} + +func writeFile(fileName string, content []byte) { + file, err := os.OpenFile(fileName, os.O_RDWR|os.O_CREATE, 0777) + if err != nil { + fmt.Println(err) + } + defer file.Close() + + _, err = file.Write(content) + if err != nil { + fmt.Println(err) + } + fmt.Println("write file successful") +} + +func binarySearch(nums []int, target int) int { + low, high := 0, len(nums)-1 + for low <= high { + mid := low + (high-low)>>1 + if nums[mid] == target { + return mid + } else if nums[mid] > target { + high = mid - 1 + } else { + low = mid + 1 + } + } + return -1 +}