diff --git a/README.md b/README.md index 36a514b6..a6b4d862 100755 --- a/README.md +++ b/README.md @@ -126,15 +126,15 @@ | | Easy | Medium | Hard | Total | |:--------:|:--------:|:--------:|:--------:|:--------:| |Optimizing|36|43|16|95| -|Accepted|**272**|**340**|**103**|**715**| -|Total|466|942|379|1787| -|Perfection Rate|86.8%|87.4%|84.5%|86.7%| -|Completion Rate|58.4%|36.1%|27.2%|40.0%| +|Accepted|**272**|**343**|**103**|**718**| +|Total|466|943|378|1787| +|Perfection Rate|86.8%|87.5%|84.5%|86.8%| +|Completion Rate|58.4%|36.4%|27.2%|40.2%| |------------|----------------------------|----------------------------|----------------------------|----------------------------| ## 二. 目录 -以下已经收录了 620 道题的题解,还有 12 道题在尝试优化到 beats 100% +以下已经收录了 623 道题的题解,还有 12 道题在尝试优化到 beats 100% | No. | Title | Solution | Acceptance | Difficulty | Frequency | |:--------:|:--------------------------------------------------------------|:--------:|:--------:|:--------:|:--------:| @@ -143,13 +143,13 @@ |0003|Longest Substring Without Repeating Characters|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0003.Longest-Substring-Without-Repeating-Characters)|31.5%|Medium|| |0004|Median of Two Sorted Arrays|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0004.Median-of-Two-Sorted-Arrays)|31.1%|Hard|| |0005|Longest Palindromic Substring|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0005.Longest-Palindromic-Substring)|30.5%|Medium|| -|0006|ZigZag Conversion||38.0%|Medium|| +|0006|ZigZag Conversion|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0006.ZigZag-Conversion)|38.0%|Medium|| |0007|Reverse Integer|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0007.Reverse-Integer)|25.9%|Easy|| -|0008|String to Integer (atoi)||15.7%|Medium|| +|0008|String to Integer (atoi)|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0008.String-to-Integer-(atoi))|15.7%|Medium|| |0009|Palindrome Number|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0009.Palindrome-Number)|49.8%|Easy|| |0010|Regular Expression Matching||27.4%|Hard|| |0011|Container With Most Water|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0011.Container-With-Most-Water)|52.8%|Medium|| -|0012|Integer to Roman||56.3%|Medium|| +|0012|Integer to Roman|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0012.Integer-to-Roman)|56.6%|Medium|| |0013|Roman to Integer|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0013.Roman-to-Integer)|56.9%|Easy|| |0014|Longest Common Prefix||36.1%|Easy|| |0015|3Sum|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0015.3Sum)|28.1%|Medium|| @@ -182,14 +182,14 @@ |0042|Trapping Rain Water|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0042.Trapping-Rain-Water)|51.3%|Hard|| |0043|Multiply Strings||35.0%|Medium|| |0044|Wildcard Matching||25.4%|Hard|| -|0045|Jump Game II||31.4%|Hard|| +|0045|Jump Game II||31.4%|Medium|| |0046|Permutations|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0046.Permutations)|66.7%|Medium|| |0047|Permutations II|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0047.Permutations-II)|49.5%|Medium|| |0048|Rotate Image|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0048.Rotate-Image)|60.1%|Medium|| |0049|Group Anagrams|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0049.Group-Anagrams)|59.4%|Medium|| |0050|Pow(x, n)|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0050.Pow(x,-n))|31.0%|Medium|| |0051|N-Queens|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0051.N-Queens)|49.8%|Hard|| -|0052|N-Queens II|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0052.N-Queens-II)|60.2%|Hard|| +|0052|N-Queens II|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0052.N-Queens-II)|60.3%|Hard|| |0053|Maximum Subarray|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0053.Maximum-Subarray)|47.8%|Easy|| |0054|Spiral Matrix|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0054.Spiral-Matrix)|36.1%|Medium|| |0055|Jump Game|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0055.Jump-Game)|35.2%|Medium|| @@ -228,9 +228,9 @@ |0088|Merge Sorted Array|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0088.Merge-Sorted-Array)|40.8%|Easy|| |0089|Gray Code|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0089.Gray-Code)|50.5%|Medium|| |0090|Subsets II|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0090.Subsets-II)|48.9%|Medium|| -|0091|Decode Ways|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0091.Decode-Ways)|26.6%|Medium|| +|0091|Decode Ways|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0091.Decode-Ways)|26.7%|Medium|| |0092|Reverse Linked List II|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0092.Reverse-Linked-List-II)|40.6%|Medium|| -|0093|Restore IP Addresses|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0093.Restore-IP-Addresses)|37.6%|Medium|| +|0093|Restore IP Addresses|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0093.Restore-IP-Addresses)|37.7%|Medium|| |0094|Binary Tree Inorder Traversal|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0094.Binary-Tree-Inorder-Traversal)|66.0%|Medium|| |0095|Unique Binary Search Trees II|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0095.Unique-Binary-Search-Trees-II)|42.7%|Medium|| |0096|Unique Binary Search Trees|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0096.Unique-Binary-Search-Trees)|54.5%|Medium|| @@ -245,7 +245,7 @@ |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)|52.0%|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.8%|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)|55.3%|Medium|| -|0108|Convert Sorted Array to Binary Search Tree|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0108.Convert-Sorted-Array-to-Binary-Search-Tree)|60.5%|Easy|| +|0108|Convert Sorted Array to Binary Search Tree|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0108.Convert-Sorted-Array-to-Binary-Search-Tree)|60.6%|Easy|| |0109|Convert Sorted List to Binary Search Tree|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0109.Convert-Sorted-List-to-Binary-Search-Tree)|50.3%|Medium|| |0110|Balanced Binary Tree|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0110.Balanced-Binary-Tree)|44.7%|Easy|| |0111|Minimum Depth of Binary Tree|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0111.Minimum-Depth-of-Binary-Tree)|39.6%|Easy|| @@ -276,7 +276,7 @@ |0136|Single Number|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0136.Single-Number)|66.6%|Easy|| |0137|Single Number II|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0137.Single-Number-II)|53.9%|Medium|| |0138|Copy List with Random Pointer|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0138.Copy-List-with-Random-Pointer)|41.0%|Medium|| -|0139|Word Break||41.7%|Medium|| +|0139|Word Break||41.8%|Medium|| |0140|Word Break II||34.8%|Hard|| |0141|Linked List Cycle|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0141.Linked-List-Cycle)|42.9%|Easy|| |0142|Linked List Cycle II|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0142.Linked-List-Cycle-II)|39.8%|Medium|| @@ -286,14 +286,14 @@ |0146|LRU Cache|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0146.LRU-Cache)|35.9%|Medium|| |0147|Insertion Sort List|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0147.Insertion-Sort-List)|44.5%|Medium|| |0148|Sort List|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0148.Sort-List)|46.4%|Medium|| -|0149|Max Points on a Line||17.4%|Hard|| +|0149|Max Points on a Line||17.5%|Hard|| |0150|Evaluate Reverse Polish Notation|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0150.Evaluate-Reverse-Polish-Notation)|38.0%|Medium|| |0151|Reverse Words in a String|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0151.Reverse-Words-in-a-String)|23.8%|Medium|| |0152|Maximum Product Subarray|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0152.Maximum-Product-Subarray)|32.8%|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)|46.2%|Medium|| |0154|Find Minimum in Rotated Sorted Array II|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0154.Find-Minimum-in-Rotated-Sorted-Array-II)|42.0%|Hard|| |0155|Min Stack|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0155.Min-Stack)|46.5%|Easy|| -|0156|Binary Tree Upside Down||56.4%|Medium|| +|0156|Binary Tree Upside Down||56.5%|Medium|| |0157|Read N Characters Given Read4||37.4%|Easy|| |0158|Read N Characters Given Read4 II - Call multiple times||37.0%|Hard|| |0159|Longest Substring with At Most Two Distinct Characters||50.5%|Medium|| @@ -323,7 +323,7 @@ |0183|Customers Who Never Order||57.0%|Easy|| |0184|Department Highest Salary||40.3%|Medium|| |0185|Department Top Three Salaries||39.2%|Hard|| -|0186|Reverse Words in a String II||45.6%|Medium|| +|0186|Reverse Words in a String II||45.7%|Medium|| |0187|Repeated DNA Sequences|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0187.Repeated-DNA-Sequences)|41.5%|Medium|| |0188|Best Time to Buy and Sell Stock IV||29.8%|Hard|| |0189|Rotate Array|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0189.Rotate-Array)|36.6%|Medium|| @@ -346,7 +346,7 @@ |0206|Reverse Linked List|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0206.Reverse-Linked-List)|65.4%|Easy|| |0207|Course Schedule|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0207.Course-Schedule)|44.3%|Medium|| |0208|Implement Trie (Prefix Tree)|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0208.Implement-Trie-(Prefix-Tree))|52.2%|Medium|| -|0209|Minimum Size Subarray Sum|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0209.Minimum-Size-Subarray-Sum)|39.5%|Medium|| +|0209|Minimum Size Subarray Sum|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0209.Minimum-Size-Subarray-Sum)|39.6%|Medium|| |0210|Course Schedule II|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0210.Course-Schedule-II)|42.7%|Medium|| |0211|Design Add and Search Words Data Structure|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0211.Design-Add-and-Search-Words-Data-Structure)|40.3%|Medium|| |0212|Word Search II|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0212.Word-Search-II)|37.2%|Hard|| @@ -360,7 +360,7 @@ |0220|Contains Duplicate III|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0220.Contains-Duplicate-III)|21.3%|Medium|| |0221|Maximal Square||39.3%|Medium|| |0222|Count Complete Tree Nodes|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0222.Count-Complete-Tree-Nodes)|49.4%|Medium|| -|0223|Rectangle Area|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0223.Rectangle-Area)|38.2%|Medium|| +|0223|Rectangle Area|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0223.Rectangle-Area)|38.3%|Medium|| |0224|Basic Calculator|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0224.Basic-Calculator)|38.2%|Hard|| |0225|Implement Stack using Queues|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0225.Implement-Stack-using-Queues)|47.6%|Easy|| |0226|Invert Binary Tree|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0226.Invert-Binary-Tree)|67.1%|Easy|| @@ -369,13 +369,13 @@ |0229|Majority Element II|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0229.Majority-Element-II)|38.8%|Medium|| |0230|Kth Smallest Element in a BST|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0230.Kth-Smallest-Element-in-a-BST)|62.7%|Medium|| |0231|Power of Two|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0231.Power-of-Two)|43.8%|Easy|| -|0232|Implement Queue using Stacks|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0232.Implement-Queue-using-Stacks)|52.3%|Easy|| +|0232|Implement Queue using Stacks|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0232.Implement-Queue-using-Stacks)|52.4%|Easy|| |0233|Number of Digit One||31.8%|Hard|| |0234|Palindrome Linked List|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0234.Palindrome-Linked-List)|40.6%|Easy|| -|0235|Lowest Common Ancestor of a Binary Search Tree|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0235.Lowest-Common-Ancestor-of-a-Binary-Search-Tree)|51.8%|Easy|| +|0235|Lowest Common Ancestor of a Binary Search Tree|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0235.Lowest-Common-Ancestor-of-a-Binary-Search-Tree)|51.9%|Easy|| |0236|Lowest Common Ancestor of a Binary Tree|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0236.Lowest-Common-Ancestor-of-a-Binary-Tree)|48.9%|Medium|| |0237|Delete Node in a Linked List|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0237.Delete-Node-in-a-Linked-List)|67.0%|Easy|| -|0238|Product of Array Except Self||61.4%|Medium|| +|0238|Product of Array Except Self||61.5%|Medium|| |0239|Sliding Window Maximum|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0239.Sliding-Window-Maximum)|44.7%|Hard|| |0240|Search a 2D Matrix II|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0240.Search-a-2D-Matrix-II)|45.2%|Medium|| |0241|Different Ways to Add Parentheses||57.3%|Medium|| @@ -385,7 +385,7 @@ |0245|Shortest Word Distance III||56.0%|Medium|| |0246|Strobogrammatic Number||46.3%|Easy|| |0247|Strobogrammatic Number II||48.6%|Medium|| -|0248|Strobogrammatic Number III||40.3%|Hard|| +|0248|Strobogrammatic Number III||40.2%|Hard|| |0249|Group Shifted Strings||58.2%|Medium|| |0250|Count Univalue Subtrees||53.4%|Medium|| |0251|Flatten 2D Vector||46.4%|Medium|| @@ -393,7 +393,7 @@ |0253|Meeting Rooms II||46.9%|Medium|| |0254|Factor Combinations||47.4%|Medium|| |0255|Verify Preorder Sequence in Binary Search Tree||46.2%|Medium|| -|0256|Paint House||53.6%|Medium|| +|0256|Paint House||53.7%|Medium|| |0257|Binary Tree Paths|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0257.Binary-Tree-Paths)|53.7%|Easy|| |0258|Add Digits|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0258.Add-Digits)|58.5%|Easy|| |0259|3Sum Smaller||49.0%|Medium|| @@ -410,7 +410,7 @@ |0270|Closest Binary Search Tree Value||50.0%|Easy|| |0271|Encode and Decode Strings||32.8%|Medium|| |0272|Closest Binary Search Tree Value II||52.4%|Hard|| -|0273|Integer to English Words||28.1%|Hard|| +|0273|Integer to English Words||28.2%|Hard|| |0274|H-Index|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0274.H-Index)|36.4%|Medium|| |0275|H-Index II|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0275.H-Index-II)|36.3%|Medium|| |0276|Paint Fence||39.1%|Medium|| @@ -437,7 +437,7 @@ |0297|Serialize and Deserialize Binary Tree||49.9%|Hard|| |0298|Binary Tree Longest Consecutive Sequence||48.0%|Medium|| |0299|Bulls and Cows||44.5%|Medium|| -|0300|Longest Increasing Subsequence|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0300.Longest-Increasing-Subsequence)|44.1%|Medium|| +|0300|Longest Increasing Subsequence|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0300.Longest-Increasing-Subsequence)|44.2%|Medium|| |0301|Remove Invalid Parentheses||44.7%|Hard|| |0302|Smallest Rectangle Enclosing Black Pixels||52.5%|Hard|| |0303|Range Sum Query - Immutable|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0303.Range-Sum-Query---Immutable)|47.8%|Easy|| @@ -445,7 +445,7 @@ |0305|Number of Islands II||39.6%|Hard|| |0306|Additive Number|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0306.Additive-Number)|29.7%|Medium|| |0307|Range Sum Query - Mutable|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0307.Range-Sum-Query---Mutable)|36.8%|Medium|| -|0308|Range Sum Query 2D - Mutable||37.7%|Hard|| +|0308|Range Sum Query 2D - Mutable||37.8%|Hard|| |0309|Best Time to Buy and Sell Stock with Cooldown|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0309.Best-Time-to-Buy-and-Sell-Stock-with-Cooldown)|48.2%|Medium|| |0310|Minimum Height Trees||34.7%|Medium|| |0311|Sparse Matrix Multiplication||64.0%|Medium|| @@ -460,7 +460,7 @@ |0320|Generalized Abbreviation||53.8%|Medium|| |0321|Create Maximum Number||27.6%|Hard|| |0322|Coin Change|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0322.Coin-Change)|37.3%|Medium|| -|0323|Number of Connected Components in an Undirected Graph||57.8%|Medium|| +|0323|Number of Connected Components in an Undirected Graph||57.9%|Medium|| |0324|Wiggle Sort II|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0324.Wiggle-Sort-II)|30.7%|Medium|| |0325|Maximum Size Subarray Sum Equals k||47.4%|Medium|| |0326|Power of Three|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0326.Power-of-Three)|42.1%|Easy|| @@ -472,7 +472,7 @@ |0332|Reconstruct Itinerary||37.9%|Medium|| |0333|Largest BST Subtree||38.0%|Medium|| |0334|Increasing Triplet Subsequence||40.8%|Medium|| -|0335|Self Crossing||28.6%|Hard|| +|0335|Self Crossing||28.7%|Hard|| |0336|Palindrome Pairs||34.7%|Hard|| |0337|House Robber III|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0337.House-Robber-III)|51.9%|Medium|| |0338|Counting Bits|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0338.Counting-Bits)|70.4%|Medium|| @@ -492,8 +492,8 @@ |0352|Data Stream as Disjoint Intervals||48.7%|Hard|| |0353|Design Snake Game||35.9%|Medium|| |0354|Russian Doll Envelopes|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0354.Russian-Doll-Envelopes)|36.4%|Hard|| -|0355|Design Twitter||31.4%|Medium|| -|0356|Line Reflection||33.0%|Medium|| +|0355|Design Twitter||31.5%|Medium|| +|0356|Line Reflection||32.9%|Medium|| |0357|Count Numbers with Unique Digits|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0357.Count-Numbers-with-Unique-Digits)|48.9%|Medium|| |0358|Rearrange String k Distance Apart||35.7%|Hard|| |0359|Logger Rate Limiter||72.3%|Easy|| @@ -576,13 +576,13 @@ |0436|Find Right Interval|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0436.Find-Right-Interval)|48.5%|Medium|| |0437|Path Sum III|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0437.Path-Sum-III)|48.2%|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)|45.0%|Medium|| -|0439|Ternary Expression Parser||56.7%|Medium|| +|0439|Ternary Expression Parser||56.8%|Medium|| |0440|K-th Smallest in Lexicographical Order||29.8%|Hard|| |0441|Arranging Coins|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0441.Arranging-Coins)|42.4%|Easy|| |0442|Find All Duplicates in an Array||69.0%|Medium|| |0443|String Compression||43.7%|Medium|| |0444|Sequence Reconstruction||23.6%|Medium|| -|0445|Add Two Numbers II|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0445.Add-Two-Numbers-II)|56.3%|Medium|| +|0445|Add Two Numbers II|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0445.Add-Two-Numbers-II)|56.4%|Medium|| |0446|Arithmetic Slices II - Subsequence||33.5%|Hard|| |0447|Number of Boomerangs|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0447.Number-of-Boomerangs)|52.5%|Medium|| |0448|Find All Numbers Disappeared in an Array|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0448.Find-All-Numbers-Disappeared-in-an-Array)|56.1%|Easy|| @@ -610,7 +610,7 @@ |0470|Implement Rand10() Using Rand7()|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0470.Implement-Rand10()-Using-Rand7())|46.1%|Medium|| |0471|Encode String with Shortest Length||49.3%|Hard|| |0472|Concatenated Words||44.0%|Hard|| -|0473|Matchsticks to Square||38.2%|Medium|| +|0473|Matchsticks to Square||38.3%|Medium|| |0474|Ones and Zeroes|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0474.Ones-and-Zeroes)|43.7%|Medium|| |0475|Heaters|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0475.Heaters)|33.7%|Medium|| |0476|Number Complement|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0476.Number-Complement)|65.2%|Easy|| @@ -620,7 +620,7 @@ |0480|Sliding Window Median|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0480.Sliding-Window-Median)|38.8%|Hard|| |0481|Magical String||48.1%|Medium|| |0482|License Key Formatting||43.1%|Easy|| -|0483|Smallest Good Base|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0483.Smallest-Good-Base)|36.3%|Hard|| +|0483|Smallest Good Base|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0483.Smallest-Good-Base)|36.4%|Hard|| |0484|Find Permutation||64.2%|Medium|| |0485|Max Consecutive Ones|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0485.Max-Consecutive-Ones)|52.8%|Easy|| |0486|Predict the Winner||48.9%|Medium|| @@ -665,12 +665,12 @@ |0525|Contiguous Array||43.5%|Medium|| |0526|Beautiful Arrangement|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0526.Beautiful-Arrangement)|61.9%|Medium|| |0527|Word Abbreviation||56.3%|Hard|| -|0528|Random Pick with Weight|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0528.Random-Pick-with-Weight)|44.6%|Medium|| +|0528|Random Pick with Weight|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0528.Random-Pick-with-Weight)|44.7%|Medium|| |0529|Minesweeper|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0529.Minesweeper)|61.2%|Medium|| |0530|Minimum Absolute Difference in BST||54.9%|Easy|| |0531|Lonely Pixel I||59.6%|Medium|| |0532|K-diff Pairs in an Array|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0532.K-diff-Pairs-in-an-Array)|35.3%|Medium|| -|0533|Lonely Pixel II||48.1%|Medium|| +|0533|Lonely Pixel II||48.2%|Medium|| |0534|Game Play Analysis III||79.5%|Medium|| |0535|Encode and Decode TinyURL||81.0%|Medium|| |0536|Construct Binary Tree from String||50.8%|Medium|| @@ -682,7 +682,7 @@ |0542|01 Matrix|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0542.01-Matrix)|41.0%|Medium|| |0543|Diameter of Binary Tree||49.2%|Easy|| |0544|Output Contest Matches||75.9%|Medium|| -|0545|Boundary of Binary Tree||39.9%|Medium|| +|0545|Boundary of Binary Tree||40.0%|Medium|| |0546|Remove Boxes||44.1%|Hard|| |0547|Number of Provinces|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0547.Number-of-Provinces)|60.5%|Medium|| |0548|Split Array with Equal Sum||48.0%|Medium|| @@ -700,15 +700,15 @@ |0560|Subarray Sum Equals K||43.7%|Medium|| |0561|Array Partition I|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0561.Array-Partition-I)|73.3%|Easy|| |0562|Longest Line of Consecutive One in Matrix||46.2%|Medium|| -|0563|Binary Tree Tilt|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0563.Binary-Tree-Tilt)|53.1%|Easy|| +|0563|Binary Tree Tilt|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0563.Binary-Tree-Tilt)|53.0%|Easy|| |0564|Find the Closest Palindrome||20.3%|Hard|| |0565|Array Nesting||56.0%|Medium|| |0566|Reshape the Matrix|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0566.Reshape-the-Matrix)|61.1%|Easy|| |0567|Permutation in String|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0567.Permutation-in-String)|44.6%|Medium|| |0568|Maximum Vacation Days||41.6%|Hard|| -|0569|Median Employee Salary||61.8%|Hard|| -|0570|Managers with at Least 5 Direct Reports||66.9%|Medium|| -|0571|Find Median Given Frequency of Numbers||45.4%|Hard|| +|0569|Median Employee Salary||61.9%|Hard|| +|0570|Managers with at Least 5 Direct Reports||66.8%|Medium|| +|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.5%|Easy|| |0573|Squirrel Simulation||54.1%|Medium|| |0574|Winning Candidate||52.2%|Medium|| @@ -716,13 +716,13 @@ |0576|Out of Boundary Paths||36.0%|Medium|| |0577|Employee Bonus||71.6%|Easy|| |0578|Get Highest Answer Rate Question||41.8%|Medium|| -|0579|Find Cumulative Salary of an Employee||38.4%|Hard|| +|0579|Find Cumulative Salary of an Employee||38.5%|Hard|| |0580|Count Student Number in Departments||51.9%|Medium|| |0581|Shortest Unsorted Continuous Subarray|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0581.Shortest-Unsorted-Continuous-Subarray)|32.8%|Medium|| -|0582|Kill Process||63.7%|Medium|| +|0582|Kill Process||63.8%|Medium|| |0583|Delete Operation for Two Strings||50.1%|Medium|| |0584|Find Customer Referee||74.1%|Easy|| -|0585|Investments in 2016||57.0%|Medium|| +|0585|Investments in 2016||57.1%|Medium|| |0586|Customer Placing the Largest Number of Orders||75.4%|Easy|| |0587|Erect the Fence||36.5%|Hard|| |0588|Design In-Memory File System||46.6%|Hard|| @@ -760,11 +760,11 @@ |0620|Not Boring Movies||69.9%|Easy|| |0621|Task Scheduler||52.0%|Medium|| |0622|Design Circular Queue||45.8%|Medium|| -|0623|Add One Row to Tree|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0623.Add-One-Row-to-Tree)|51.6%|Medium|| +|0623|Add One Row to Tree|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0623.Add-One-Row-to-Tree)|53.1%|Medium|| |0624|Maximum Distance in Arrays||39.6%|Medium|| -|0625|Minimum Factorization||32.9%|Medium|| +|0625|Minimum Factorization||33.0%|Medium|| |0626|Exchange Seats||65.8%|Medium|| -|0627|Swap Salary||77.7%|Easy|| +|0627|Swap Salary||77.8%|Easy|| |0628|Maximum Product of Three Numbers|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0628.Maximum-Product-of-Three-Numbers)|46.9%|Easy|| |0629|K Inverse Pairs Array||31.7%|Hard|| |0630|Course Schedule III||33.8%|Hard|| @@ -782,7 +782,7 @@ |0642|Design Search Autocomplete System||46.3%|Hard|| |0643|Maximum Average Subarray I|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0643.Maximum-Average-Subarray-I)|42.0%|Easy|| |0644|Maximum Average Subarray II||34.1%|Hard|| -|0645|Set Mismatch|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0645.Set-Mismatch)|42.1%|Easy|| +|0645|Set Mismatch|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0645.Set-Mismatch)|42.0%|Easy|| |0646|Maximum Length of Pair Chain||53.0%|Medium|| |0647|Palindromic Substrings||61.9%|Medium|| |0648|Replace Words|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0648.Replace-Words)|58.7%|Medium|| @@ -812,7 +812,7 @@ |0672|Bulb Switcher II||51.1%|Medium|| |0673|Number of Longest Increasing Subsequence||38.5%|Medium|| |0674|Longest Continuous Increasing Subsequence|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0674.Longest-Continuous-Increasing-Subsequence)|46.0%|Easy|| -|0675|Cut Off Trees for Golf Event||35.3%|Hard|| +|0675|Cut Off Trees for Golf Event||35.4%|Hard|| |0676|Implement Magic Dictionary|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0676.Implement-Magic-Dictionary)|55.3%|Medium|| |0677|Map Sum Pairs||54.0%|Medium|| |0678|Valid Parenthesis String||31.7%|Medium|| @@ -839,8 +839,8 @@ |0699|Falling Squares|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0699.Falling-Squares)|42.6%|Hard|| |0700|Search in a Binary Search Tree||73.4%|Easy|| |0701|Insert into a Binary Search Tree||75.5%|Medium|| -|0702|Search in a Sorted Array of Unknown Size||68.8%|Medium|| -|0703|Kth Largest Element in a Stream|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0703.Kth-Largest-Element-in-a-Stream)|50.8%|Easy|| +|0702|Search in a Sorted Array of Unknown Size||68.9%|Medium|| +|0703|Kth Largest Element in a Stream|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0703.Kth-Largest-Element-in-a-Stream)|50.7%|Easy|| |0704|Binary Search|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0704.Binary-Search)|54.1%|Easy|| |0705|Design HashSet|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0705.Design-HashSet)|64.6%|Easy|| |0706|Design HashMap|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0706.Design-HashMap)|64.3%|Easy|| @@ -851,7 +851,7 @@ |0711|Number of Distinct Islands II||49.3%|Hard|| |0712|Minimum ASCII Delete Sum for Two Strings||59.5%|Medium|| |0713|Subarray Product Less Than K|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0713.Subarray-Product-Less-Than-K)|40.5%|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)|56.1%|Medium|| +|0714|Best Time to Buy and Sell Stock with Transaction Fee|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0714.Best-Time-to-Buy-and-Sell-Stock-with-Transaction-Fee)|56.2%|Medium|| |0715|Range Module|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0715.Range-Module)|40.3%|Hard|| |0716|Max Stack||43.1%|Easy|| |0717|1-bit and 2-bit Characters|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0717.1-bit-and-2-bit-Characters)|47.1%|Easy|| @@ -861,7 +861,7 @@ |0721|Accounts Merge|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0721.Accounts-Merge)|51.9%|Medium|| |0722|Remove Comments||36.2%|Medium|| |0723|Candy Crush||72.7%|Medium|| -|0724|Find Pivot Index|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0724.Find-Pivot-Index)|45.6%|Easy|| +|0724|Find Pivot Index|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0724.Find-Pivot-Index)|45.7%|Easy|| |0725|Split Linked List in Parts|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0725.Split-Linked-List-in-Parts)|53.0%|Medium|| |0726|Number of Atoms|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0726.Number-of-Atoms)|51.0%|Hard|| |0727|Minimum Window Subsequence||42.3%|Hard|| @@ -869,7 +869,7 @@ |0729|My Calendar I|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0729.My-Calendar-I)|53.4%|Medium|| |0730|Count Different Palindromic Subsequences||43.4%|Hard|| |0731|My Calendar II||50.7%|Medium|| -|0732|My Calendar III|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0732.My-Calendar-III)|61.9%|Hard|| +|0732|My Calendar III|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0732.My-Calendar-III)|62.0%|Hard|| |0733|Flood Fill|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0733.Flood-Fill)|55.9%|Easy|| |0734|Sentence Similarity||42.4%|Easy|| |0735|Asteroid Collision|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0735.Asteroid-Collision)|43.3%|Medium|| @@ -880,13 +880,13 @@ |0740|Delete and Earn||49.5%|Medium|| |0741|Cherry Pickup||35.1%|Hard|| |0742|Closest Leaf in a Binary Tree||44.5%|Medium|| -|0743|Network Delay Time||45.5%|Medium|| +|0743|Network Delay Time||45.6%|Medium|| |0744|Find Smallest Letter Greater Than Target|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0744.Find-Smallest-Letter-Greater-Than-Target)|45.6%|Easy|| |0745|Prefix and Suffix Search|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0745.Prefix-and-Suffix-Search)|35.4%|Hard|| |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||43.0%|Easy|| |0748|Shortest Completing Word|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0748.Shortest-Completing-Word)|57.5%|Easy|| -|0749|Contain Virus||48.2%|Hard|| +|0749|Contain Virus||48.3%|Hard|| |0750|Number Of Corner Rectangles||67.2%|Medium|| |0751|IP to CIDR||59.5%|Medium|| |0752|Open the Lock||52.9%|Medium|| @@ -894,7 +894,7 @@ |0754|Reach a Number||40.5%|Medium|| |0755|Pour Water||44.1%|Medium|| |0756|Pyramid Transition Matrix|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0756.Pyramid-Transition-Matrix)|55.6%|Medium|| -|0757|Set Intersection Size At Least Two||42.6%|Hard|| +|0757|Set Intersection Size At Least Two||42.5%|Hard|| |0758|Bold Words in String||47.4%|Easy|| |0759|Employee Free Time||68.3%|Hard|| |0760|Find Anagram Mappings||81.9%|Easy|| @@ -907,7 +907,7 @@ |0767|Reorganize String|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0767.Reorganize-String)|50.2%|Medium|| |0768|Max Chunks To Make Sorted II||49.8%|Hard|| |0769|Max Chunks To Make Sorted||55.7%|Medium|| -|0770|Basic Calculator IV||54.2%|Hard|| +|0770|Basic Calculator IV||54.3%|Hard|| |0771|Jewels and Stones|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0771.Jewels-and-Stones)|86.9%|Easy|| |0772|Basic Calculator III||43.7%|Hard|| |0773|Sliding Puzzle||60.9%|Hard|| @@ -939,7 +939,7 @@ |0799|Champagne Tower||44.1%|Medium|| |0800|Similar RGB Color||62.4%|Easy|| |0801|Minimum Swaps To Make Sequences Increasing||39.0%|Medium|| -|0802|Find Eventual Safe States|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0802.Find-Eventual-Safe-States)|49.8%|Medium|| +|0802|Find Eventual Safe States|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0802.Find-Eventual-Safe-States)|49.9%|Medium|| |0803|Bricks Falling When Hit|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0803.Bricks-Falling-When-Hit)|31.5%|Hard|| |0804|Unique Morse Code Words||79.0%|Easy|| |0805|Split Array With Same Average||26.9%|Hard|| @@ -957,7 +957,7 @@ |0817|Linked List Components|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0817.Linked-List-Components)|57.8%|Medium|| |0818|Race Car||40.0%|Hard|| |0819|Most Common Word|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0819.Most-Common-Word)|45.5%|Easy|| -|0820|Short Encoding of Words|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0820.Short-Encoding-of-Words)|55.3%|Medium|| +|0820|Short Encoding of Words|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0820.Short-Encoding-of-Words)|55.2%|Medium|| |0821|Shortest Distance to a Character|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0821.Shortest-Distance-to-a-Character)|70.1%|Easy|| |0822|Card Flipping Game||43.7%|Medium|| |0823|Binary Trees With Factors||36.6%|Medium|| @@ -984,7 +984,7 @@ |0844|Backspace String Compare|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0844.Backspace-String-Compare)|47.1%|Easy|| |0845|Longest Mountain in Array|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0845.Longest-Mountain-in-Array)|38.6%|Medium|| |0846|Hand of Straights||55.4%|Medium|| -|0847|Shortest Path Visiting All Nodes||53.8%|Hard|| +|0847|Shortest Path Visiting All Nodes||53.9%|Hard|| |0848|Shifting Letters||45.2%|Medium|| |0849|Maximize Distance to Closest Person||44.5%|Medium|| |0850|Rectangle Area II|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0850.Rectangle-Area-II)|48.3%|Hard|| @@ -995,14 +995,14 @@ |0855|Exam Room||43.4%|Medium|| |0856|Score of Parentheses|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0856.Score-of-Parentheses)|64.8%|Medium|| |0857|Minimum Cost to Hire K Workers||50.5%|Hard|| -|0858|Mirror Reflection||59.7%|Medium|| +|0858|Mirror Reflection||59.6%|Medium|| |0859|Buddy Strings||29.3%|Easy|| |0860|Lemonade Change||51.8%|Easy|| |0861|Score After Flipping Matrix||73.7%|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.2%|Hard|| |0863|All Nodes Distance K in Binary Tree|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0863.All-Nodes-Distance-K-in-Binary-Tree)|58.0%|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)|42.1%|Hard|| -|0865|Smallest Subtree with all the Deepest Nodes||64.9%|Medium|| +|0865|Smallest Subtree with all the Deepest Nodes||64.8%|Medium|| |0866|Prime Palindrome||25.1%|Medium|| |0867|Transpose Matrix|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0867.Transpose-Matrix)|62.1%|Easy|| |0868|Binary Gap||61.0%|Easy|| @@ -1016,21 +1016,21 @@ |0876|Middle of the Linked List|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0876.Middle-of-the-Linked-List)|69.1%|Easy|| |0877|Stone Game||66.9%|Medium|| |0878|Nth Magical Number|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0878.Nth-Magical-Number)|28.8%|Hard|| -|0879|Profitable Schemes||40.0%|Hard|| +|0879|Profitable Schemes||39.9%|Hard|| |0880|Decoded String at Index|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0880.Decoded-String-at-Index)|28.2%|Medium|| |0881|Boats to Save People|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0881.Boats-to-Save-People)|49.0%|Medium|| |0882|Reachable Nodes In Subdivided Graph||42.9%|Hard|| |0883|Projection Area of 3D Shapes||68.3%|Easy|| |0884|Uncommon Words from Two Sentences|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0884.Uncommon-Words-from-Two-Sentences)|64.2%|Easy|| -|0885|Spiral Matrix III|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0885.Spiral-Matrix-III)|70.8%|Medium|| +|0885|Spiral Matrix III|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0885.Spiral-Matrix-III)|70.9%|Medium|| |0886|Possible Bipartition||45.1%|Medium|| |0887|Super Egg Drop|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0887.Super-Egg-Drop)|27.0%|Hard|| |0888|Fair Candy Swap|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0888.Fair-Candy-Swap)|59.1%|Easy|| -|0889|Construct Binary Tree from Preorder and Postorder Traversal||67.6%|Medium|| +|0889|Construct Binary Tree from Preorder and Postorder Traversal||67.7%|Medium|| |0890|Find and Replace Pattern||74.2%|Medium|| |0891|Sum of Subsequence Widths|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0891.Sum-of-Subsequence-Widths)|33.1%|Hard|| |0892|Surface Area of 3D Shapes|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0892.Surface-Area-of-3D-Shapes)|59.8%|Easy|| -|0893|Groups of Special-Equivalent Strings||69.1%|Easy|| +|0893|Groups of Special-Equivalent Strings||69.2%|Easy|| |0894|All Possible Full Binary Trees||77.1%|Medium|| |0895|Maximum Frequency Stack|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0895.Maximum-Frequency-Stack)|63.1%|Hard|| |0896|Monotonic Array|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0896.Monotonic-Array)|58.0%|Easy|| @@ -1040,7 +1040,7 @@ |0900|RLE Iterator||55.4%|Medium|| |0901|Online Stock Span|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0901.Online-Stock-Span)|61.4%|Medium|| |0902|Numbers At Most N Given Digit Set||36.1%|Hard|| -|0903|Valid Permutations for DI Sequence||54.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)|43.0%|Medium|| |0905|Sort Array By Parity||75.0%|Easy|| |0906|Super Palindromes||32.8%|Hard|| @@ -1054,11 +1054,11 @@ |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.1%|Easy|| |0915|Partition Array into Disjoint Intervals||46.2%|Medium|| |0916|Word Subsets||48.1%|Medium|| -|0917|Reverse Only Letters||58.9%|Easy|| +|0917|Reverse Only Letters||59.0%|Easy|| |0918|Maximum Sum Circular Subarray|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0918.Maximum-Sum-Circular-Subarray)|34.2%|Medium|| |0919|Complete Binary Tree Inserter||58.9%|Medium|| |0920|Number of Music Playlists|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0920.Number-of-Music-Playlists)|47.8%|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.8%|Medium|| +|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.9%|Medium|| |0922|Sort Array By Parity II|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0922.Sort-Array-By-Parity-II)|70.6%|Easy|| |0923|3Sum With Multiplicity|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0923.3Sum-With-Multiplicity)|36.3%|Medium|| |0924|Minimize Malware Spread|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0924.Minimize-Malware-Spread)|41.9%|Hard|| @@ -1082,16 +1082,16 @@ |0942|DI String Match|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0942.DI-String-Match)|73.6%|Easy|| |0943|Find the Shortest Superstring||43.4%|Hard|| |0944|Delete Columns to Make Sorted||70.9%|Easy|| -|0945|Minimum Increment to Make Array Unique||46.8%|Medium|| +|0945|Minimum Increment to Make Array Unique||46.7%|Medium|| |0946|Validate Stack Sequences|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0946.Validate-Stack-Sequences)|64.4%|Medium|| |0947|Most Stones Removed with Same Row or Column|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0947.Most-Stones-Removed-with-Same-Row-or-Column)|55.4%|Medium|| |0948|Bag of Tokens||46.1%|Medium|| |0949|Largest Time for Given Digits|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0949.Largest-Time-for-Given-Digits)|36.2%|Medium|| |0950|Reveal Cards In Increasing Order||75.4%|Medium|| -|0951|Flip Equivalent Binary Trees||65.7%|Medium|| +|0951|Flip Equivalent Binary Trees||65.8%|Medium|| |0952|Largest Component Size by Common Factor|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0952.Largest-Component-Size-by-Common-Factor)|36.2%|Hard|| |0953|Verifying an Alien Dictionary|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0953.Verifying-an-Alien-Dictionary)|52.0%|Easy|| -|0954|Array of Doubled Pairs||35.2%|Medium|| +|0954|Array of Doubled Pairs||35.1%|Medium|| |0955|Delete Columns to Make Sorted II||33.8%|Medium|| |0956|Tallest Billboard||39.8%|Hard|| |0957|Prison Cells After N Days||40.1%|Medium|| @@ -1118,9 +1118,9 @@ |0978|Longest Turbulent Subarray|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0978.Longest-Turbulent-Subarray)|46.7%|Medium|| |0979|Distribute Coins in Binary Tree|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0979.Distribute-Coins-in-Binary-Tree)|69.8%|Medium|| |0980|Unique Paths III|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0980.Unique-Paths-III)|77.1%|Hard|| -|0981|Time Based Key-Value Store|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0981.Time-Based-Key-Value-Store)|54.2%|Medium|| +|0981|Time Based Key-Value Store|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0981.Time-Based-Key-Value-Store)|54.1%|Medium|| |0982|Triples with Bitwise AND Equal To Zero||56.3%|Hard|| -|0983|Minimum Cost For Tickets||62.7%|Medium|| +|0983|Minimum Cost For Tickets||62.8%|Medium|| |0984|String Without AAA or BBB|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0984.String-Without-AAA-or-BBB)|38.7%|Medium|| |0985|Sum of Even Numbers After Queries|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0985.Sum-of-Even-Numbers-After-Queries)|60.7%|Easy|| |0986|Interval List Intersections|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0986.Interval-List-Intersections)|68.4%|Medium|| @@ -1140,7 +1140,7 @@ |1000|Minimum Cost to Merge Stones||40.6%|Hard|| |1001|Grid Illumination||36.5%|Hard|| |1002|Find Common Characters|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1002.Find-Common-Characters)|68.6%|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.4%|Medium|| +|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.5%|Medium|| |1004|Max Consecutive Ones III|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1004.Max-Consecutive-Ones-III)|60.9%|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.3%|Easy|| |1006|Clumsy Factorial||53.6%|Medium|| @@ -1148,11 +1148,11 @@ |1008|Construct Binary Search Tree from Preorder Traversal||78.8%|Medium|| |1009|Complement of Base 10 Integer||61.5%|Easy|| |1010|Pairs of Songs With Total Durations Divisible by 60||50.4%|Medium|| -|1011|Capacity To Ship Packages Within D Days|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1011.Capacity-To-Ship-Packages-Within-D-Days)|59.7%|Medium|| +|1011|Capacity To Ship Packages Within D Days|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1011.Capacity-To-Ship-Packages-Within-D-Days)|59.8%|Medium|| |1012|Numbers With Repeated Digits||37.8%|Hard|| -|1013|Partition Array Into Three Parts With Equal Sum||48.7%|Easy|| +|1013|Partition Array Into Three Parts With Equal Sum||48.6%|Easy|| |1014|Best Sightseeing Pair||52.9%|Medium|| -|1015|Smallest Integer Divisible by K||41.8%|Medium|| +|1015|Smallest Integer Divisible by K||41.9%|Medium|| |1016|Binary String With Substrings Representing 1 To N||58.9%|Medium|| |1017|Convert to Base -2|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1017.Convert-to-Base--2)|59.8%|Medium|| |1018|Binary Prefix Divisible By 5|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1018.Binary-Prefix-Divisible-By-5)|47.8%|Easy|| @@ -1178,7 +1178,7 @@ |1038|Binary Search Tree to Greater Sum Tree|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1038.Binary-Search-Tree-to-Greater-Sum-Tree)|82.4%|Medium|| |1039|Minimum Score Triangulation of Polygon||50.1%|Medium|| |1040|Moving Stones Until Consecutive II|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1040.Moving-Stones-Until-Consecutive-II)|54.1%|Medium|| -|1041|Robot Bounded In Circle||55.0%|Medium|| +|1041|Robot Bounded In Circle||55.1%|Medium|| |1042|Flower Planting With No Adjacent||48.8%|Medium|| |1043|Partition Array for Maximum Sum||67.1%|Medium|| |1044|Longest Duplicate Substring||31.4%|Hard|| @@ -1190,7 +1190,7 @@ |1050|Actors and Directors Who Cooperated At Least Three Times||72.4%|Easy|| |1051|Height Checker|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1051.Height-Checker)|72.1%|Easy|| |1052|Grumpy Bookstore Owner|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1052.Grumpy-Bookstore-Owner)|55.8%|Medium|| -|1053|Previous Permutation With One Swap||51.0%|Medium|| +|1053|Previous Permutation With One Swap||51.1%|Medium|| |1054|Distant Barcodes|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1054.Distant-Barcodes)|44.3%|Medium|| |1055|Shortest Way to Form String||57.2%|Medium|| |1056|Confusing Number||47.0%|Easy|| @@ -1198,7 +1198,7 @@ |1058|Minimize Rounding Error to Meet Target||43.2%|Medium|| |1059|All Paths from Source Lead to Destination||43.0%|Medium|| |1060|Missing Element in Sorted Array||54.8%|Medium|| -|1061|Lexicographically Smallest Equivalent String||66.8%|Medium|| +|1061|Lexicographically Smallest Equivalent String||66.7%|Medium|| |1062|Longest Repeating Substring||58.3%|Medium|| |1063|Number of Valid Subarrays||72.1%|Hard|| |1064|Fixed Point||65.0%|Easy|| @@ -1209,7 +1209,7 @@ |1069|Product Sales Analysis II||83.2%|Easy|| |1070|Product Sales Analysis III||49.9%|Medium|| |1071|Greatest Common Divisor of Strings||51.1%|Easy|| -|1072|Flip Columns For Maximum Number of Equal Rows||61.4%|Medium|| +|1072|Flip Columns For Maximum Number of Equal Rows||61.5%|Medium|| |1073|Adding Two Negabinary Numbers|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1073.Adding-Two-Negabinary-Numbers)|34.9%|Medium|| |1074|Number of Submatrices That Sum to Target|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1074.Number-of-Submatrices-That-Sum-to-Target)|61.8%|Hard|| |1075|Project Employees I||66.1%|Easy|| @@ -1218,7 +1218,7 @@ |1078|Occurrences After Bigram|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1078.Occurrences-After-Bigram)|64.9%|Easy|| |1079|Letter Tile Possibilities|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1079.Letter-Tile-Possibilities)|75.9%|Medium|| |1080|Insufficient Nodes in Root to Leaf Paths||49.9%|Medium|| -|1081|Smallest Subsequence of Distinct Characters||53.4%|Medium|| +|1081|Smallest Subsequence of Distinct Characters||53.5%|Medium|| |1082|Sales Analysis I||73.8%|Easy|| |1083|Sales Analysis II||50.8%|Easy|| |1084|Sales Analysis III||54.7%|Easy|| @@ -1244,18 +1244,18 @@ |1104|Path In Zigzag Labelled Binary Tree||73.1%|Medium|| |1105|Filling Bookcase Shelves|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1105.Filling-Bookcase-Shelves)|57.5%|Medium|| |1106|Parsing A Boolean Expression||59.3%|Hard|| -|1107|New Users Daily Count||46.0%|Medium|| +|1107|New Users Daily Count||46.1%|Medium|| |1108|Defanging an IP Address|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1108.Defanging-an-IP-Address)|88.4%|Easy|| |1109|Corporate Flight Bookings||54.3%|Medium|| |1110|Delete Nodes And Return Forest|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1110.Delete-Nodes-And-Return-Forest)|67.8%|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.6%|Medium|| -|1112|Highest Grade For Each Student||72.1%|Medium|| +|1112|Highest Grade For Each Student||72.2%|Medium|| |1113|Reported Posts||65.9%|Easy|| -|1114|Print in Order||67.1%|Easy|| +|1114|Print in Order||67.2%|Easy|| |1115|Print FooBar Alternately||59.0%|Medium|| |1116|Print Zero Even Odd||57.7%|Medium|| |1117|Building H2O||53.1%|Medium|| -|1118|Number of Days in a Month||57.4%|Easy|| +|1118|Number of Days in a Month||57.3%|Easy|| |1119|Remove Vowels from a String||90.4%|Easy|| |1120|Maximum Average Subtree||63.6%|Medium|| |1121|Divide Array Into Increasing Sequences||58.2%|Hard|| @@ -1264,29 +1264,29 @@ |1124|Longest Well-Performing Interval||33.3%|Medium|| |1125|Smallest Sufficient Team||47.1%|Hard|| |1126|Active Businesses||68.6%|Medium|| -|1127|User Purchase Platform||50.4%|Hard|| +|1127|User Purchase Platform||50.5%|Hard|| |1128|Number of Equivalent Domino Pairs|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1128.Number-of-Equivalent-Domino-Pairs)|46.4%|Easy|| |1129|Shortest Path with Alternating Colors||40.2%|Medium|| |1130|Minimum Cost Tree From Leaf Values||67.3%|Medium|| |1131|Maximum of Absolute Value Expression||51.8%|Medium|| -|1132|Reported Posts II||34.7%|Medium|| +|1132|Reported Posts II||34.6%|Medium|| |1133|Largest Unique Number||67.2%|Easy|| |1134|Armstrong Number||78.2%|Easy|| -|1135|Connecting Cities With Minimum Cost||59.3%|Medium|| +|1135|Connecting Cities With Minimum Cost||59.4%|Medium|| |1136|Parallel Courses||60.8%|Medium|| |1137|N-th Tribonacci Number|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1137.N-th-Tribonacci-Number)|55.9%|Easy|| |1138|Alphabet Board Path||51.1%|Medium|| |1139|Largest 1-Bordered Square||48.6%|Medium|| |1140|Stone Game II||64.7%|Medium|| |1141|User Activity for the Past 30 Days I||54.5%|Easy|| -|1142|User Activity for the Past 30 Days II||35.4%|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.2%|Medium|| |1145|Binary Tree Coloring Game|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1145.Binary-Tree-Coloring-Game)|51.3%|Medium|| |1146|Snapshot Array||36.8%|Medium|| |1147|Longest Chunked Palindrome Decomposition||59.5%|Hard|| -|1148|Article Views I||77.0%|Easy|| -|1149|Article Views II||48.3%|Medium|| +|1148|Article Views I||77.1%|Easy|| +|1149|Article Views II||48.2%|Medium|| |1150|Check If a Number Is Majority Element in a Sorted Array||57.4%|Easy|| |1151|Minimum Swaps to Group All 1's Together||58.7%|Medium|| |1152|Analyze User Website Visit Pattern||43.2%|Medium|| @@ -1296,7 +1296,7 @@ |1156|Swap For Longest Repeated Character Substring||47.1%|Medium|| |1157|Online Majority Element In Subarray|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1157.Online-Majority-Element-In-Subarray)|39.7%|Hard|| |1158|Market Analysis I||64.0%|Medium|| -|1159|Market Analysis II||55.7%|Hard|| +|1159|Market Analysis II||55.8%|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.9%|Easy|| |1161|Maximum Level Sum of a Binary Tree||69.4%|Medium|| |1162|As Far from Land as Possible||45.4%|Medium|| @@ -1320,13 +1320,13 @@ |1180|Count Substrings with Only One Distinct Letter||77.7%|Easy|| |1181|Before and After Puzzle||44.5%|Medium|| |1182|Shortest Distance to Target Color||53.4%|Medium|| -|1183|Maximum Number of Ones||57.5%|Hard|| -|1184|Distance Between Bus Stops|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1184.Distance-Between-Bus-Stops)|54.1%|Easy|| +|1183|Maximum Number of Ones||57.6%|Hard|| +|1184|Distance Between Bus Stops|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1184.Distance-Between-Bus-Stops)|54.0%|Easy|| |1185|Day of the Week|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1185.Day-of-the-Week)|61.3%|Easy|| |1186|Maximum Subarray Sum with One Deletion||38.8%|Medium|| -|1187|Make Array Strictly Increasing||42.1%|Hard|| +|1187|Make Array Strictly Increasing||42.0%|Hard|| |1188|Design Bounded Blocking Queue||72.9%|Medium|| -|1189|Maximum Number of Balloons|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1189.Maximum-Number-of-Balloons)|61.8%|Easy|| +|1189|Maximum Number of Balloons|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1189.Maximum-Number-of-Balloons)|61.9%|Easy|| |1190|Reverse Substrings Between Each Pair of Parentheses||64.1%|Medium|| |1191|K-Concatenation Maximum Sum||25.2%|Medium|| |1192|Critical Connections in a Network||50.1%|Hard|| @@ -1350,13 +1350,13 @@ |1210|Minimum Moves to Reach Target with Rotations||46.4%|Hard|| |1211|Queries Quality and Percentage||70.0%|Easy|| |1212|Team Scores in Football Tournament||56.9%|Medium|| -|1213|Intersection of Three Sorted Arrays||79.3%|Easy|| +|1213|Intersection of Three Sorted Arrays||79.4%|Easy|| |1214|Two Sum BSTs||67.5%|Medium|| |1215|Stepping Numbers||43.6%|Medium|| |1216|Valid Palindrome III||49.9%|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.1%|Easy|| |1218|Longest Arithmetic Subsequence of Given Difference||46.7%|Medium|| -|1219|Path with Maximum Gold||65.8%|Medium|| +|1219|Path with Maximum Gold||65.7%|Medium|| |1220|Count Vowels Permutation||54.1%|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.3%|Easy|| |1222|Queens That Can Attack the King||69.5%|Medium|| @@ -1367,7 +1367,7 @@ |1227|Airplane Seat Assignment Probability||62.2%|Medium|| |1228|Missing Number In Arithmetic Progression||51.3%|Easy|| |1229|Meeting Scheduler||54.4%|Medium|| -|1230|Toss Strange Coins||50.3%|Medium|| +|1230|Toss Strange Coins||50.2%|Medium|| |1231|Divide Chocolate||53.6%|Hard|| |1232|Check If It Is a Straight Line|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1232.Check-If-It-Is-a-Straight-Line)|43.5%|Easy|| |1233|Remove Sub-Folders from the Filesystem||62.1%|Medium|| @@ -1375,7 +1375,7 @@ |1235|Maximum Profit in Job Scheduling|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1235.Maximum-Profit-in-Job-Scheduling)|47.5%|Hard|| |1236|Web Crawler||64.7%|Medium|| |1237|Find Positive Integer Solution for a Given Equation||69.4%|Medium|| -|1238|Circular Permutation in Binary Representation||66.3%|Medium|| +|1238|Circular Permutation in Binary Representation||66.2%|Medium|| |1239|Maximum Length of a Concatenated String with Unique Characters||49.7%|Medium|| |1240|Tiling a Rectangle with the Fewest Squares||52.6%|Hard|| |1241|Number of Comments per Post||67.9%|Easy|| @@ -1395,7 +1395,7 @@ |1255|Maximum Score Words Formed by Letters||70.0%|Hard|| |1256|Encode Number||67.9%|Medium|| |1257|Smallest Common Region||61.1%|Medium|| -|1258|Synonymous Sentences||63.0%|Medium|| +|1258|Synonymous Sentences||63.1%|Medium|| |1259|Handshakes That Don't Cross||54.2%|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.5%|Medium|| @@ -1417,24 +1417,24 @@ |1277|Count Square Submatrices with All Ones||72.8%|Medium|| |1278|Palindrome Partitioning III||60.9%|Hard|| |1279|Traffic Light Controlled Intersection||76.0%|Easy|| -|1280|Students and Examinations||75.0%|Easy|| +|1280|Students and Examinations||75.1%|Easy|| |1281|Subtract the Product and Sum of Digits of an Integer|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1281.Subtract-the-Product-and-Sum-of-Digits-of-an-Integer)|85.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.6%|Medium|| |1284|Minimum Number of Flips to Convert Binary Matrix to Zero Matrix||70.1%|Hard|| -|1285|Find the Start and End Number of Continuous Ranges||87.4%|Medium|| +|1285|Find the Start and End Number of Continuous Ranges||87.5%|Medium|| |1286|Iterator for Combination||70.9%|Medium|| |1287|Element Appearing More Than 25% In Sorted Array|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1287.Element-Appearing-More-Than-25%-In-Sorted-Array)|60.1%|Easy|| |1288|Remove Covered Intervals||57.3%|Medium|| -|1289|Minimum Falling Path Sum II||62.5%|Hard|| +|1289|Minimum Falling Path Sum II||62.4%|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.8%|Easy|| |1291|Sequential Digits||57.4%|Medium|| -|1292|Maximum Side Length of a Square with Sum Less than or Equal to Threshold||50.7%|Medium|| +|1292|Maximum Side Length of a Square with Sum Less than or Equal to Threshold||50.8%|Medium|| |1293|Shortest Path in a Grid with Obstacles Elimination||43.1%|Hard|| |1294|Weather Type in Each Country||66.5%|Easy|| |1295|Find Numbers with Even Number of Digits|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1295.Find-Numbers-with-Even-Number-of-Digits)|79.0%|Easy|| |1296|Divide Array in Sets of K Consecutive Numbers||55.5%|Medium|| -|1297|Maximum Number of Occurrences of a Substring||50.2%|Medium|| +|1297|Maximum Number of Occurrences of a Substring||50.3%|Medium|| |1298|Maximum Candies You Can Get from Boxes||59.7%|Hard|| |1299|Replace Elements with Greatest Element on Right Side|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1299.Replace-Elements-with-Greatest-Element-on-Right-Side)|74.6%|Easy|| |1300|Sum of Mutated Array Closest to Target|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1300.Sum-of-Mutated-Array-Closest-to-Target)|43.0%|Medium|| @@ -1446,7 +1446,7 @@ |1306|Jump Game III|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1306.Jump-Game-III)|62.4%|Medium|| |1307|Verbal Arithmetic Puzzle||36.8%|Hard|| |1308|Running Total for Different Genders||87.7%|Medium|| -|1309|Decrypt String from Alphabet to Integer Mapping||77.5%|Easy|| +|1309|Decrypt String from Alphabet to Integer Mapping||77.6%|Easy|| |1310|XOR Queries of a Subarray||69.3%|Medium|| |1311|Get Watched Videos by Your Friends||44.2%|Medium|| |1312|Minimum Insertion Steps to Make a String Palindrome||59.8%|Hard|| @@ -1454,8 +1454,8 @@ |1314|Matrix Block Sum||73.5%|Medium|| |1315|Sum of Nodes with Even-Valued Grandparent||84.3%|Medium|| |1316|Distinct Echo Substrings||49.7%|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|| -|1318|Minimum Flips to Make a OR b Equal to c||64.0%|Medium|| +|1317|Convert Integer to the Sum of Two No-Zero Integers|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1317.Convert-Integer-to-the-Sum-of-Two-No-Zero-Integers)|56.7%|Easy|| +|1318|Minimum Flips to Make a OR b Equal to c||63.9%|Medium|| |1319|Number of Operations to Make Network Connected|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1319.Number-of-Operations-to-Make-Network-Connected)|55.5%|Medium|| |1320|Minimum Distance to Type a Word Using Two Fingers||61.8%|Hard|| |1321|Restaurant Growth||71.3%|Medium|| @@ -1465,13 +1465,13 @@ |1325|Delete Leaves With a Given Value||73.8%|Medium|| |1326|Minimum Number of Taps to Open to Water a Garden||47.6%|Hard|| |1327|List the Products Ordered in a Period||77.6%|Easy|| -|1328|Break a Palindrome||46.8%|Medium|| +|1328|Break a Palindrome||46.9%|Medium|| |1329|Sort the Matrix Diagonally|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1329.Sort-the-Matrix-Diagonally)|81.8%|Medium|| -|1330|Reverse Subarray To Maximize Array Value||36.8%|Hard|| +|1330|Reverse Subarray To Maximize Array Value||36.7%|Hard|| |1331|Rank Transform of an Array||57.5%|Easy|| |1332|Remove Palindromic Subsequences|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1332.Remove-Palindromic-Subsequences)|68.0%|Easy|| |1333|Filter Restaurants by Vegan-Friendly, Price and Distance||57.2%|Medium|| -|1334|Find the City With the Smallest Number of Neighbors at a Threshold Distance||47.0%|Medium|| +|1334|Find the City With the Smallest Number of Neighbors at a Threshold Distance||47.1%|Medium|| |1335|Minimum Difficulty of a Job Schedule||56.8%|Hard|| |1336|Number of Transactions per Visit||48.3%|Hard|| |1337|The K Weakest Rows in a Matrix|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1337.The-K-Weakest-Rows-in-a-Matrix)|72.0%|Easy|| @@ -1482,28 +1482,28 @@ |1342|Number of Steps to Reduce a Number to Zero||85.8%|Easy|| |1343|Number of Sub-arrays of Size K and Average Greater than or Equal to Threshold||64.8%|Medium|| |1344|Angle Between Hands of a Clock||61.3%|Medium|| -|1345|Jump Game IV||41.9%|Hard|| +|1345|Jump Game IV||42.0%|Hard|| |1346|Check If N and Its Double Exist||36.1%|Easy|| |1347|Minimum Number of Steps to Make Two Strings Anagram||75.1%|Medium|| |1348|Tweet Counts Per Frequency||36.2%|Medium|| |1349|Maximum Students Taking Exam||44.2%|Hard|| |1350|Students With Invalid Departments||90.3%|Easy|| |1351|Count Negative Numbers in a Sorted Matrix||75.9%|Easy|| -|1352|Product of the Last K Numbers||44.6%|Medium|| +|1352|Product of the Last K Numbers||44.7%|Medium|| |1353|Maximum Number of Events That Can Be Attended||30.5%|Medium|| |1354|Construct Target Array With Multiple Sums||31.4%|Hard|| |1355|Activity Participants||74.3%|Medium|| |1356|Sort Integers by The Number of 1 Bits||69.6%|Easy|| |1357|Apply Discount Every n Orders||66.9%|Medium|| |1358|Number of Substrings Containing All Three Characters||60.6%|Medium|| -|1359|Count All Valid Pickup and Delivery Options||56.3%|Hard|| +|1359|Count All Valid Pickup and Delivery Options||56.4%|Hard|| |1360|Number of Days Between Two Dates||46.7%|Easy|| |1361|Validate Binary Tree Nodes||43.7%|Medium|| |1362|Closest Divisors||57.7%|Medium|| |1363|Largest Multiple of Three||34.1%|Hard|| |1364|Number of Trusted Contacts of a Customer||78.8%|Medium|| |1365|How Many Numbers Are Smaller Than the Current Number||86.0%|Easy|| -|1366|Rank Teams by Votes||55.2%|Medium|| +|1366|Rank Teams by Votes||55.3%|Medium|| |1367|Linked List in Binary Tree||41.1%|Medium|| |1368|Minimum Cost to Make at Least One Valid Path in a Grid||57.4%|Hard|| |1369|Get the Second Most Recent Activity||68.8%|Hard|| @@ -1516,23 +1516,23 @@ |1376|Time Needed to Inform All Employees||56.5%|Medium|| |1377|Frog Position After T Seconds||35.2%|Hard|| |1378|Replace Employee ID With The Unique Identifier||90.1%|Easy|| -|1379|Find a Corresponding Node of a Binary Tree in a Clone of That Tree||84.6%|Medium|| +|1379|Find a Corresponding Node of a Binary Tree in a Clone of That Tree||84.7%|Medium|| |1380|Lucky Numbers in a Matrix|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1380.Lucky-Numbers-in-a-Matrix)|70.5%|Easy|| |1381|Design a Stack With Increment Operation||76.2%|Medium|| -|1382|Balance a Binary Search Tree||76.2%|Medium|| +|1382|Balance a Binary Search Tree||76.1%|Medium|| |1383|Maximum Performance of a Team||35.8%|Hard|| |1384|Total Sales Amount by Year||64.5%|Hard|| |1385|Find the Distance Value Between Two Arrays|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1385.Find-the-Distance-Value-Between-Two-Arrays)|66.3%|Easy|| -|1386|Cinema Seat Allocation||35.7%|Medium|| -|1387|Sort Integers by The Power Value||70.4%|Medium|| -|1388|Pizza With 3n Slices||45.7%|Hard|| +|1386|Cinema Seat Allocation||35.8%|Medium|| +|1387|Sort Integers by The Power Value||70.5%|Medium|| +|1388|Pizza With 3n Slices||45.8%|Hard|| |1389|Create Target Array in the Given Order|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1389.Create-Target-Array-in-the-Given-Order)|84.8%|Easy|| |1390|Four Divisors||39.2%|Medium|| |1391|Check if There is a Valid Path in a Grid||44.9%|Medium|| |1392|Longest Happy Prefix||41.9%|Hard|| |1393|Capital Gain/Loss||90.8%|Medium|| |1394|Find Lucky Integer in an Array||63.2%|Easy|| -|1395|Count Number of Teams||76.9%|Medium|| +|1395|Count Number of Teams||76.8%|Medium|| |1396|Design Underground System||69.7%|Medium|| |1397|Find All Good Strings||38.6%|Hard|| |1398|Customers Who Bought Products A and B but Not C||82.1%|Medium|| @@ -1545,10 +1545,10 @@ |1405|Longest Happy String||52.4%|Medium|| |1406|Stone Game III||57.5%|Hard|| |1407|Top Travellers||83.8%|Easy|| -|1408|String Matching in an Array||63.1%|Easy|| +|1408|String Matching in an Array||63.2%|Easy|| |1409|Queries on a Permutation With Key||81.6%|Medium|| |1410|HTML Entity Parser||54.2%|Medium|| -|1411|Number of Ways to Paint N × 3 Grid||60.4%|Hard|| +|1411|Number of Ways to Paint N × 3 Grid||60.5%|Hard|| |1412|Find the Quiet Students in All Exams||64.2%|Hard|| |1413|Minimum Value to Get Positive Step by Step Sum||65.6%|Easy|| |1414|Find the Minimum Number of Fibonacci Numbers Whose Sum Is K||63.2%|Medium|| @@ -1570,14 +1570,14 @@ |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.3%|Easy|| |1432|Max Difference You Can Get From Changing an Integer||42.9%|Medium|| -|1433|Check If a String Can Break Another String||67.2%|Medium|| +|1433|Check If a String Can Break Another String||67.3%|Medium|| |1434|Number of Ways to Wear Different Hats to Each Other||39.4%|Hard|| |1435|Create a Session Bar Chart||77.8%|Easy|| |1436|Destination City||77.2%|Easy|| -|1437|Check If All 1's Are at Least Length K Places Away|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1437.Check-If-All-1's-Are-at-Least-Length-K-Places-Away)|62.4%|Easy|| +|1437|Check If All 1's Are at Least Length K Places Away|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1437.Check-If-All-1's-Are-at-Least-Length-K-Places-Away)|62.3%|Easy|| |1438|Longest Continuous Subarray With Absolute Diff Less Than or Equal to Limit|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1438.Longest-Continuous-Subarray-With-Absolute-Diff-Less-Than-or-Equal-to-Limit)|44.4%|Medium|| |1439|Find the Kth Smallest Sum of a Matrix With Sorted Rows|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1439.Find-the-Kth-Smallest-Sum-of-a-Matrix-With-Sorted-Rows)|60.1%|Hard|| -|1440|Evaluate Boolean Expression||74.8%|Medium|| +|1440|Evaluate Boolean Expression||74.9%|Medium|| |1441|Build an Array With Stack Operations||70.3%|Easy|| |1442|Count Triplets That Can Form Two Arrays of Equal XOR||71.4%|Medium|| |1443|Minimum Time to Collect All Apples in a Tree||54.6%|Medium|| @@ -1587,7 +1587,7 @@ |1447|Simplified Fractions||62.1%|Medium|| |1448|Count Good Nodes in Binary Tree||70.9%|Medium|| |1449|Form Largest Integer With Digits That Add up to Target||44.2%|Hard|| -|1450|Number of Students Doing Homework at a Given Time||77.2%|Easy|| +|1450|Number of Students Doing Homework at a Given Time||77.1%|Easy|| |1451|Rearrange Words in a Sentence||59.6%|Medium|| |1452|People Whose List of Favorite Companies Is Not a Subset of Another List||55.0%|Medium|| |1453|Maximum Number of Darts Inside of a Circular Dartboard||35.4%|Hard|| @@ -1596,7 +1596,7 @@ |1456|Maximum Number of Vowels in a Substring of Given Length||54.6%|Medium|| |1457|Pseudo-Palindromic Paths in a Binary Tree||70.5%|Medium|| |1458|Max Dot Product of Two Subsequences||43.2%|Hard|| -|1459|Rectangles Area||64.8%|Medium|| +|1459|Rectangles Area||64.9%|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||47.3%|Medium|| |1462|Course Schedule IV||44.7%|Medium|| @@ -1605,15 +1605,15 @@ |1465|Maximum Area of a Piece of Cake After Horizontal and Vertical Cuts||33.2%|Medium|| |1466|Reorder Routes to Make All Paths Lead to the City Zero||61.8%|Medium|| |1467|Probability of a Two Boxes Having The Same Number of Distinct Balls||60.9%|Hard|| -|1468|Calculate Salaries||81.9%|Medium|| +|1468|Calculate Salaries||82.0%|Medium|| |1469|Find All The Lonely Nodes||80.4%|Easy|| |1470|Shuffle the Array|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1470.Shuffle-the-Array)|88.2%|Easy|| |1471|The k Strongest Values in an Array||58.5%|Medium|| |1472|Design Browser History||71.5%|Medium|| -|1473|Paint House III||48.5%|Hard|| -|1474|Delete N Nodes After M Nodes of a Linked List||74.8%|Easy|| +|1473|Paint House III||48.4%|Hard|| +|1474|Delete N Nodes After M Nodes of a Linked List||74.2%|Easy|| |1475|Final Prices With a Special Discount in a Shop||75.2%|Easy|| -|1476|Subrectangle Queries||88.3%|Medium|| +|1476|Subrectangle Queries||88.2%|Medium|| |1477|Find Two Non-overlapping Sub-arrays Each With Target Sum||34.6%|Medium|| |1478|Allocate Mailboxes||54.0%|Hard|| |1479|Sales by Day of the Week||83.3%|Hard|| @@ -1622,15 +1622,15 @@ |1482|Minimum Number of Days to Make m Bouquets||50.3%|Medium|| |1483|Kth Ancestor of a Tree Node||30.7%|Hard|| |1484|Group Sold Products By The Date||85.4%|Easy|| -|1485|Clone Binary Tree With Random Pointer||79.3%|Medium|| +|1485|Clone Binary Tree With Random Pointer||79.2%|Medium|| |1486|XOR Operation in an Array||84.1%|Easy|| |1487|Making File Names Unique||30.7%|Medium|| |1488|Avoid Flood in The City||24.5%|Medium|| |1489|Find Critical and Pseudo-Critical Edges in Minimum Spanning Tree||51.4%|Hard|| -|1490|Clone N-ary Tree||83.6%|Medium|| +|1490|Clone N-ary Tree||83.5%|Medium|| |1491|Average Salary Excluding the Minimum and Maximum Salary||68.5%|Easy|| |1492|The kth Factor of n||63.3%|Medium|| -|1493|Longest Subarray of 1's After Deleting One Element||57.8%|Medium|| +|1493|Longest Subarray of 1's After Deleting One Element||57.7%|Medium|| |1494|Parallel Courses II||31.2%|Hard|| |1495|Friendly Movies Streamed Last Month||51.3%|Easy|| |1496|Path Crossing||55.2%|Easy|| @@ -1638,7 +1638,7 @@ |1498|Number of Subsequences That Satisfy the Given Sum Condition||38.5%|Medium|| |1499|Max Value of Equation||45.0%|Hard|| |1500|Design a File Sharing System||46.3%|Medium|| -|1501|Countries You Can Safely Invest In||60.5%|Medium|| +|1501|Countries You Can Safely Invest In||60.6%|Medium|| |1502|Can Make Arithmetic Progression From Sequence||71.1%|Easy|| |1503|Last Moment Before All Ants Fall Out of a Plank||53.2%|Medium|| |1504|Count Submatrices With All Ones||60.8%|Medium|| @@ -1651,7 +1651,7 @@ |1511|Customer Order Frequency||73.7%|Easy|| |1512|Number of Good Pairs|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1512.Number-of-Good-Pairs)|87.7%|Easy|| |1513|Number of Substrings With Only 1s||41.9%|Medium|| -|1514|Path with Maximum Probability||40.5%|Medium|| +|1514|Path with Maximum Probability||40.6%|Medium|| |1515|Best Position for a Service Centre||37.6%|Hard|| |1516|Move Sub-Tree of N-Ary Tree||63.8%|Hard|| |1517|Find Users With Valid E-Mails||71.3%|Easy|| @@ -1660,16 +1660,16 @@ |1520|Maximum Number of Non-Overlapping Substrings||36.3%|Hard|| |1521|Find a Value of a Mysterious Function Closest to Target||44.3%|Hard|| |1522|Diameter of N-Ary Tree||68.8%|Medium|| -|1523|Count Odd Numbers in an Interval Range||54.6%|Easy|| +|1523|Count Odd Numbers in an Interval Range||54.5%|Easy|| |1524|Number of Sub-arrays With Odd Sum||39.9%|Medium|| |1525|Number of Good Ways to Split a String||66.5%|Medium|| |1526|Minimum Number of Increments on Subarrays to Form a Target Array||60.0%|Hard|| -|1527|Patients With a Condition||66.0%|Easy|| +|1527|Patients With a Condition||65.8%|Easy|| |1528|Shuffle String||85.6%|Easy|| |1529|Bulb Switcher IV||70.8%|Medium|| |1530|Number of Good Leaf Nodes Pairs||56.2%|Medium|| |1531|String Compression II||33.9%|Hard|| -|1532|The Most Recent Three Orders||72.9%|Medium|| +|1532|The Most Recent Three Orders||72.8%|Medium|| |1533|Find the Index of the Large Integer||54.7%|Medium|| |1534|Count Good Triplets||80.3%|Easy|| |1535|Find the Winner of an Array Game||47.6%|Medium|| @@ -1677,14 +1677,14 @@ |1537|Get the Maximum Score||36.4%|Hard|| |1538|Guess the Majority in a Hidden Array||61.0%|Medium|| |1539|Kth Missing Positive Number|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1539.Kth-Missing-Positive-Number)|55.0%|Easy|| -|1540|Can Convert String in K Moves||30.9%|Medium|| -|1541|Minimum Insertions to Balance a Parentheses String||42.7%|Medium|| +|1540|Can Convert String in K Moves||31.0%|Medium|| +|1541|Minimum Insertions to Balance a Parentheses String||42.8%|Medium|| |1542|Find Longest Awesome Substring||36.7%|Hard|| |1543|Fix Product Name Format||67.3%|Easy|| |1544|Make The String Great||55.5%|Easy|| |1545|Find Kth Bit in Nth Binary String||57.5%|Medium|| |1546|Maximum Number of Non-Overlapping Subarrays With Sum Equals Target||43.8%|Medium|| -|1547|Minimum Cost to Cut a Stick||52.7%|Hard|| +|1547|Minimum Cost to Cut a Stick||52.8%|Hard|| |1548|The Most Similar Path in a Graph||54.2%|Hard|| |1549|The Most Recent Orders for Each Product||66.9%|Medium|| |1550|Three Consecutive Odds||64.7%|Easy|| @@ -1692,39 +1692,39 @@ |1552|Magnetic Force Between Two Balls||48.9%|Medium|| |1553|Minimum Number of Days to Eat N Oranges||29.7%|Hard|| |1554|Strings Differ by One Character||63.5%|Medium|| -|1555|Bank Account Summary||53.0%|Medium|| -|1556|Thousand Separator||57.4%|Easy|| +|1555|Bank Account Summary||52.9%|Medium|| +|1556|Thousand Separator||57.5%|Easy|| |1557|Minimum Number of Vertices to Reach All Nodes||75.5%|Medium|| |1558|Minimum Numbers of Function Calls to Make Target Array||63.4%|Medium|| -|1559|Detect Cycles in 2D Grid||44.5%|Hard|| +|1559|Detect Cycles in 2D Grid||44.6%|Hard|| |1560|Most Visited Sector in a Circular Track||56.9%|Easy|| |1561|Maximum Number of Coins You Can Get||77.5%|Medium|| |1562|Find Latest Group of Size M||39.5%|Medium|| |1563|Stone Game V||39.9%|Hard|| |1564|Put Boxes Into the Warehouse I||66.0%|Medium|| -|1565|Unique Orders and Customers Per Month||83.1%|Easy|| +|1565|Unique Orders and Customers Per Month||83.0%|Easy|| |1566|Detect Pattern of Length M Repeated K or More Times||42.5%|Easy|| |1567|Maximum Length of Subarray With Positive Product||36.7%|Medium|| |1568|Minimum Number of Days to Disconnect Island||50.2%|Hard|| |1569|Number of Ways to Reorder Array to Get Same BST||50.0%|Hard|| |1570|Dot Product of Two Sparse Vectors||91.2%|Medium|| -|1571|Warehouse Manager||89.9%|Easy|| -|1572|Matrix Diagonal Sum||77.9%|Easy|| +|1571|Warehouse Manager||89.8%|Easy|| +|1572|Matrix Diagonal Sum||77.8%|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)|31.2%|Medium|| |1574|Shortest Subarray to be Removed to Make Array Sorted||33.5%|Medium|| |1575|Count All Possible Routes||57.3%|Hard|| |1576|Replace All ?'s to Avoid Consecutive Repeating Characters||48.6%|Easy|| |1577|Number of Ways Where Square of Number Is Equal to Product of Two Numbers||37.5%|Medium|| -|1578|Minimum Deletion Cost to Avoid Repeating Letters||60.5%|Medium|| +|1578|Minimum Deletion Cost to Avoid Repeating Letters||60.6%|Medium|| |1579|Remove Max Number of Edges to Keep Graph Fully Traversable|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1579.Remove-Max-Number-of-Edges-to-Keep-Graph-Fully-Traversable)|46.2%|Hard|| -|1580|Put Boxes Into the Warehouse II||62.5%|Medium|| -|1581|Customer Who Visited but Did Not Make Any Transactions||89.7%|Easy|| +|1580|Put Boxes Into the Warehouse II||62.3%|Medium|| +|1581|Customer Who Visited but Did Not Make Any Transactions||89.6%|Easy|| |1582|Special Positions in a Binary Matrix||64.4%|Easy|| |1583|Count Unhappy Friends||54.5%|Medium|| |1584|Min Cost to Connect All Points||52.2%|Medium|| |1585|Check If String Is Transformable With Substring Sort Operations||48.3%|Hard|| |1586|Binary Search Tree Iterator II||66.6%|Medium|| -|1587|Bank Account Summary II||90.0%|Easy|| +|1587|Bank Account Summary II||89.8%|Easy|| |1588|Sum of All Odd Length Subarrays||81.6%|Easy|| |1589|Maximum Sum Obtained of Any Permutation||34.8%|Medium|| |1590|Make Sum Divisible by P||27.0%|Medium|| @@ -1734,7 +1734,7 @@ |1594|Maximum Non Negative Product in a Matrix||31.8%|Medium|| |1595|Minimum Cost to Connect Two Groups of Points||43.3%|Hard|| |1596|The Most Frequently Ordered Products for Each Customer||84.9%|Medium|| -|1597|Build Binary Expression Tree From Infix Expression||60.2%|Hard|| +|1597|Build Binary Expression Tree From Infix Expression||60.1%|Hard|| |1598|Crawler Log Folder||63.9%|Easy|| |1599|Maximum Profit of Operating a Centennial Wheel||43.7%|Medium|| |1600|Throne Inheritance||60.5%|Medium|| @@ -1744,35 +1744,35 @@ |1604|Alert Using Same Key-Card Three or More Times in a One Hour Period||42.6%|Medium|| |1605|Find Valid Matrix Given Row and Column Sums||77.2%|Medium|| |1606|Find Servers That Handled Most Number of Requests||37.2%|Hard|| -|1607|Sellers With No Sales||55.5%|Easy|| -|1608|Special Array With X Elements Greater Than or Equal X|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1608.Special-Array-With-X-Elements-Greater-Than-or-Equal-X)|61.4%|Easy|| +|1607|Sellers With No Sales||55.4%|Easy|| +|1608|Special Array With X Elements Greater Than or Equal X|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1608.Special-Array-With-X-Elements-Greater-Than-or-Equal-X)|61.3%|Easy|| |1609|Even Odd Tree||52.6%|Medium|| -|1610|Maximum Number of Visible Points||29.7%|Hard|| +|1610|Maximum Number of Visible Points||29.8%|Hard|| |1611|Minimum One Bit Operations to Make Integers Zero||57.1%|Hard|| -|1612|Check If Two Expression Trees are Equivalent||69.7%|Medium|| -|1613|Find the Missing IDs||73.9%|Medium|| -|1614|Maximum Nesting Depth of the Parentheses|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1614.Maximum-Nesting-Depth-of-the-Parentheses)|82.8%|Easy|| +|1612|Check If Two Expression Trees are Equivalent||69.8%|Medium|| +|1613|Find the Missing IDs||74.0%|Medium|| +|1614|Maximum Nesting Depth of the Parentheses|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1614.Maximum-Nesting-Depth-of-the-Parentheses)|82.7%|Easy|| |1615|Maximal Network Rank||52.3%|Medium|| |1616|Split Two Strings to Make Palindrome||36.2%|Medium|| -|1617|Count Subtrees With Max Distance Between Cities||63.3%|Hard|| -|1618|Maximum Font to Fit a Sentence in a Screen||56.4%|Medium|| +|1617|Count Subtrees With Max Distance Between Cities||63.2%|Hard|| +|1618|Maximum Font to Fit a Sentence in a Screen||56.2%|Medium|| |1619|Mean of Array After Removing Some Elements|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1619.Mean-of-Array-After-Removing-Some-Elements)|65.0%|Easy|| |1620|Coordinate With Maximum Network Quality||37.1%|Medium|| |1621|Number of Sets of K Non-Overlapping Line Segments||41.3%|Medium|| -|1622|Fancy Sequence||15.0%|Hard|| +|1622|Fancy Sequence||15.1%|Hard|| |1623|All Valid Triplets That Can Represent a Country||88.6%|Easy|| |1624|Largest Substring Between Two Equal Characters|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1624.Largest-Substring-Between-Two-Equal-Characters)|58.7%|Easy|| |1625|Lexicographically Smallest String After Applying Operations||64.2%|Medium|| |1626|Best Team With No Conflicts||38.1%|Medium|| |1627|Graph Connectivity With Threshold||39.1%|Hard|| |1628|Design an Expression Tree With Evaluate Function||80.5%|Medium|| -|1629|Slowest Key|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1629.Slowest-Key)|59.1%|Easy|| +|1629|Slowest Key|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1629.Slowest-Key)|59.2%|Easy|| |1630|Arithmetic Subarrays||77.5%|Medium|| |1631|Path With Minimum Effort|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1631.Path-With-Minimum-Effort)|50.1%|Medium|| |1632|Rank Transform of a Matrix||30.8%|Hard|| -|1633|Percentage of Users Attended a Contest||71.1%|Easy|| -|1634|Add Two Polynomials Represented as Linked Lists||55.4%|Medium|| -|1635|Hopper Company Queries I||55.7%|Hard|| +|1633|Percentage of Users Attended a Contest||71.0%|Easy|| +|1634|Add Two Polynomials Represented as Linked Lists||55.2%|Medium|| +|1635|Hopper Company Queries I||55.6%|Hard|| |1636|Sort Array by Increasing Frequency|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1636.Sort-Array-by-Increasing-Frequency)|66.8%|Easy|| |1637|Widest Vertical Area Between Two Points Containing No Points||83.5%|Medium|| |1638|Count Substrings That Differ by One Character||69.5%|Medium|| @@ -1780,25 +1780,25 @@ |1640|Check Array Formation Through Concatenation|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1640.Check-Array-Formation-Through-Concatenation)|60.0%|Easy|| |1641|Count Sorted Vowel Strings|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1641.Count-Sorted-Vowel-Strings)|76.3%|Medium|| |1642|Furthest Building You Can Reach||50.3%|Medium|| -|1643|Kth Smallest Instructions||43.9%|Hard|| -|1644|Lowest Common Ancestor of a Binary Tree II||56.6%|Medium|| -|1645|Hopper Company Queries II||37.7%|Hard|| +|1643|Kth Smallest Instructions||44.0%|Hard|| +|1644|Lowest Common Ancestor of a Binary Tree II||56.5%|Medium|| +|1645|Hopper Company Queries II||37.6%|Hard|| |1646|Get Maximum in Generated Array|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1646.Get-Maximum-in-Generated-Array)|53.3%|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)|54.7%|Medium|| -|1648|Sell Diminishing-Valued Colored Balls|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1648.Sell-Diminishing-Valued-Colored-Balls)|30.5%|Medium|| +|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)|54.6%|Medium|| +|1648|Sell Diminishing-Valued Colored Balls|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1648.Sell-Diminishing-Valued-Colored-Balls)|30.6%|Medium|| |1649|Create Sorted Array through Instructions|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1649.Create-Sorted-Array-through-Instructions)|36.4%|Hard|| |1650|Lowest Common Ancestor of a Binary Tree III||76.4%|Medium|| -|1651|Hopper Company Queries III||65.6%|Hard|| +|1651|Hopper Company Queries III||65.7%|Hard|| |1652|Defuse the Bomb|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1652.Defuse-the-Bomb)|62.7%|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)|51.3%|Medium|| +|1653|Minimum Deletions to Make String Balanced|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1653.Minimum-Deletions-to-Make-String-Balanced)|51.4%|Medium|| |1654|Minimum Jumps to Reach Home|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1654.Minimum-Jumps-to-Reach-Home)|25.6%|Medium|| |1655|Distribute Repeating Integers|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1655.Distribute-Repeating-Integers)|40.0%|Hard|| -|1656|Design an Ordered Stream|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1656.Design-an-Ordered-Stream)|82.2%|Easy|| +|1656|Design an Ordered Stream|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1656.Design-an-Ordered-Stream)|82.1%|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)|55.4%|Medium|| |1658|Minimum Operations to Reduce X to Zero|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1658.Minimum-Operations-to-Reduce-X-to-Zero)|33.4%|Medium|| |1659|Maximize Grid Happiness|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1659.Maximize-Grid-Happiness)|35.6%|Hard|| |1660|Correct a Binary Tree||77.1%|Medium|| -|1661|Average Time of Process per Machine||79.5%|Easy|| +|1661|Average Time of Process per Machine||79.3%|Easy|| |1662|Check If Two String Arrays are Equivalent|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1662.Check-If-Two-String-Arrays-are-Equivalent)|82.9%|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)|64.3%|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)|62.1%|Medium|| @@ -1808,13 +1808,13 @@ |1668|Maximum Repeating Substring|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1668.Maximum-Repeating-Substring)|38.8%|Easy|| |1669|Merge In Between Linked Lists|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1669.Merge-In-Between-Linked-Lists)|76.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.4%|Medium|| -|1671|Minimum Number of Removals to Make Mountain Array||45.8%|Hard|| +|1671|Minimum Number of Removals to Make Mountain Array||45.7%|Hard|| |1672|Richest Customer Wealth|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1672.Richest-Customer-Wealth)|88.2%|Easy|| |1673|Find the Most Competitive Subsequence|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1673.Find-the-Most-Competitive-Subsequence)|45.4%|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.9%|Medium|| |1675|Minimize Deviation in Array|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1675.Minimize-Deviation-in-Array)|48.4%|Hard|| -|1676|Lowest Common Ancestor of a Binary Tree IV||79.3%|Medium|| -|1677|Product's Worth Over Invoices||73.3%|Easy|| +|1676|Lowest Common Ancestor of a Binary Tree IV||79.2%|Medium|| +|1677|Product's Worth Over Invoices||73.4%|Easy|| |1678|Goal Parser Interpretation|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1678.Goal-Parser-Interpretation)|85.4%|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)|54.0%|Medium|| |1680|Concatenation of Consecutive Binary Numbers|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1680.Concatenation-of-Consecutive-Binary-Numbers)|52.3%|Medium|| @@ -1823,108 +1823,108 @@ |1683|Invalid Tweets||90.8%|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)|82.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)|62.8%|Medium|| -|1686|Stone Game VI||49.6%|Medium|| -|1687|Delivering Boxes from Storage to Ports||34.8%|Hard|| +|1686|Stone Game VI||49.5%|Medium|| +|1687|Delivering Boxes from Storage to Ports||35.0%|Hard|| |1688|Count of Matches in Tournament|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1688.Count-of-Matches-in-Tournament)|81.6%|Easy|| |1689|Partitioning Into Minimum Number Of Deci-Binary Numbers|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1689.Partitioning-Into-Minimum-Number-Of-Deci-Binary-Numbers)|87.2%|Medium|| |1690|Stone Game VII|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1690.Stone-Game-VII)|48.3%|Medium|| |1691|Maximum Height by Stacking Cuboids|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1691.Maximum-Height-by-Stacking-Cuboids)|50.1%|Hard|| |1692|Count Ways to Distribute Candies||62.8%|Hard|| |1693|Daily Leads and Partners||91.0%|Easy|| -|1694|Reformat Phone Number|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1694.Reformat-Phone-Number)|65.8%|Easy|| +|1694|Reformat Phone Number|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1694.Reformat-Phone-Number)|65.7%|Easy|| |1695|Maximum Erasure Value|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1695.Maximum-Erasure-Value)|49.6%|Medium|| -|1696|Jump Game VI|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1696.Jump-Game-VI)|53.1%|Medium|| +|1696|Jump Game VI|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1696.Jump-Game-VI)|53.0%|Medium|| |1697|Checking Existence of Edge Length Limited Paths||54.6%|Hard|| -|1698|Number of Distinct Substrings in a String||59.9%|Medium|| +|1698|Number of Distinct Substrings in a String||59.8%|Medium|| |1699|Number of Calls Between Two Persons||86.6%|Medium|| |1700|Number of Students Unable to Eat Lunch|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1700.Number-of-Students-Unable-to-Eat-Lunch)|68.2%|Easy|| |1701|Average Waiting Time||61.4%|Medium|| -|1702|Maximum Binary String After Change||60.0%|Medium|| -|1703|Minimum Adjacent Swaps for K Consecutive Ones||39.9%|Hard|| -|1704|Determine if String Halves Are Alike|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1704.Determine-if-String-Halves-Are-Alike)|77.1%|Easy|| +|1702|Maximum Binary String After Change||59.9%|Medium|| +|1703|Minimum Adjacent Swaps for K Consecutive Ones||39.7%|Hard|| +|1704|Determine if String Halves Are Alike|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1704.Determine-if-String-Halves-Are-Alike)|77.0%|Easy|| |1705|Maximum Number of Eaten Apples||41.9%|Medium|| -|1706|Where Will the Ball Fall||59.9%|Medium|| +|1706|Where Will the Ball Fall||60.0%|Medium|| |1707|Maximum XOR With an Element From Array||46.9%|Hard|| -|1708|Largest Subarray Length K||62.7%|Easy|| +|1708|Largest Subarray Length K||62.8%|Easy|| |1709|Biggest Window Between Visits||82.7%|Medium|| -|1710|Maximum Units on a Truck|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1710.Maximum-Units-on-a-Truck)|70.2%|Easy|| +|1710|Maximum Units on a Truck|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1710.Maximum-Units-on-a-Truck)|70.3%|Easy|| |1711|Count Good Meals||26.0%|Medium|| |1712|Ways to Split Array Into Three Subarrays||29.5%|Medium|| -|1713|Minimum Operations to Make a Subsequence||45.5%|Hard|| +|1713|Minimum Operations to Make a Subsequence||45.6%|Hard|| |1714|Sum Of Special Evenly-Spaced Elements In Array||48.3%|Hard|| -|1715|Count Apples and Oranges||79.7%|Medium|| +|1715|Count Apples and Oranges||79.8%|Medium|| |1716|Calculate Money in Leetcode Bank|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1716.Calculate-Money-in-Leetcode-Bank)|66.5%|Easy|| |1717|Maximum Score From Removing Substrings||40.3%|Medium|| -|1718|Construct the Lexicographically Largest Valid Sequence||46.1%|Medium|| +|1718|Construct the Lexicographically Largest Valid Sequence||46.2%|Medium|| |1719|Number Of Ways To Reconstruct A Tree||39.4%|Hard|| |1720|Decode XORed Array|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1720.Decode-XORed-Array)|85.3%|Easy|| |1721|Swapping Nodes in a Linked List||64.5%|Medium|| |1722|Minimize Hamming Distance After Swap Operations||54.5%|Medium|| |1723|Find Minimum Time to Finish All Jobs||43.9%|Hard|| |1724|Checking Existence of Edge Length Limited Paths II||56.7%|Hard|| -|1725|Number Of Rectangles That Can Form The Largest Square|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1725.Number-Of-Rectangles-That-Can-Form-The-Largest-Square)|77.8%|Easy|| +|1725|Number Of Rectangles That Can Form The Largest Square|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1725.Number-Of-Rectangles-That-Can-Form-The-Largest-Square)|77.9%|Easy|| |1726|Tuple with Same Product||56.1%|Medium|| -|1727|Largest Submatrix With Rearrangements||58.4%|Medium|| +|1727|Largest Submatrix With Rearrangements||58.5%|Medium|| |1728|Cat and Mouse II||41.1%|Hard|| |1729|Find Followers Count||71.8%|Easy|| -|1730|Shortest Path to Get Food||57.3%|Medium|| -|1731|The Number of Employees Which Report to Each Employee||49.3%|Easy|| -|1732|Find the Highest Altitude|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1732.Find-the-Highest-Altitude)|80.8%|Easy|| +|1730|Shortest Path to Get Food||57.4%|Medium|| +|1731|The Number of Employees Which Report to Each Employee||49.1%|Easy|| +|1732|Find the Highest Altitude|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1732.Find-the-Highest-Altitude)|80.7%|Easy|| |1733|Minimum Number of People to Teach||37.2%|Medium|| |1734|Decode XORed Permutation||52.4%|Medium|| -|1735|Count Ways to Make Array With Product||48.4%|Hard|| +|1735|Count Ways to Make Array With Product||48.3%|Hard|| |1736|Latest Time by Replacing Hidden Digits|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1736.Latest-Time-by-Replacing-Hidden-Digits)|41.1%|Easy|| |1737|Change Minimum Characters to Satisfy One of Three Conditions||29.6%|Medium|| |1738|Find Kth Largest XOR Coordinate Value||62.0%|Medium|| |1739|Building Boxes||49.7%|Hard|| -|1740|Find Distance in a Binary Tree||69.4%|Medium|| -|1741|Find Total Time Spent by Each Employee||91.1%|Easy|| +|1740|Find Distance in a Binary Tree||69.3%|Medium|| +|1741|Find Total Time Spent by Each Employee||91.2%|Easy|| |1742|Maximum Number of Balls in a Box|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1742.Maximum-Number-of-Balls-in-a-Box)|74.7%|Easy|| |1743|Restore the Array From Adjacent Pairs||63.0%|Medium|| |1744|Can You Eat Your Favorite Candy on Your Favorite Day?||30.4%|Medium|| |1745|Palindrome Partitioning IV||49.2%|Hard|| -|1746|Maximum Subarray Sum After One Operation||63.7%|Medium|| -|1747|Leetflex Banned Accounts||70.0%|Medium|| -|1748|Sum of Unique Elements|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1748.Sum-of-Unique-Elements)|75.6%|Easy|| -|1749|Maximum Absolute Sum of Any Subarray||51.5%|Medium|| -|1750|Minimum Length of String After Deleting Similar Ends||42.4%|Medium|| -|1751|Maximum Number of Events That Can Be Attended II||47.4%|Hard|| -|1752|Check if Array Is Sorted and Rotated|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1752.Check-if-Array-Is-Sorted-and-Rotated)|63.6%|Easy|| +|1746|Maximum Subarray Sum After One Operation||63.5%|Medium|| +|1747|Leetflex Banned Accounts||70.2%|Medium|| +|1748|Sum of Unique Elements|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1748.Sum-of-Unique-Elements)|75.5%|Easy|| +|1749|Maximum Absolute Sum of Any Subarray||51.6%|Medium|| +|1750|Minimum Length of String After Deleting Similar Ends||42.5%|Medium|| +|1751|Maximum Number of Events That Can Be Attended II||47.5%|Hard|| +|1752|Check if Array Is Sorted and Rotated|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1752.Check-if-Array-Is-Sorted-and-Rotated)|63.5%|Easy|| |1753|Maximum Score From Removing Stones||61.2%|Medium|| |1754|Largest Merge Of Two Strings||39.9%|Medium|| -|1755|Closest Subsequence Sum||35.8%|Hard|| -|1756|Design Most Recently Used Queue||77.7%|Medium|| +|1755|Closest Subsequence Sum||35.7%|Hard|| +|1756|Design Most Recently Used Queue||77.9%|Medium|| |1757|Recyclable and Low Fat Products||96.1%|Easy|| |1758|Minimum Changes To Make Alternating Binary String|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1758.Minimum-Changes-To-Make-Alternating-Binary-String)|58.9%|Easy|| -|1759|Count Number of Homogenous Substrings||41.9%|Medium|| -|1760|Minimum Limit of Balls in a Bag||52.0%|Medium|| -|1761|Minimum Degree of a Connected Trio in a Graph||37.1%|Hard|| +|1759|Count Number of Homogenous Substrings||41.8%|Medium|| +|1760|Minimum Limit of Balls in a Bag||52.1%|Medium|| +|1761|Minimum Degree of a Connected Trio in a Graph||37.2%|Hard|| |1762|Buildings With an Ocean View||81.8%|Medium|| -|1763|Longest Nice Substring||62.0%|Easy|| +|1763|Longest Nice Substring||61.9%|Easy|| |1764|Form Array by Concatenating Subarrays of Another Array||55.7%|Medium|| -|1765|Map of Highest Peak||54.4%|Medium|| +|1765|Map of Highest Peak||54.5%|Medium|| |1766|Tree of Coprimes||36.7%|Hard|| -|1767|Find the Subtasks That Did Not Execute||88.8%|Hard|| -|1768|Merge Strings Alternately||77.7%|Easy|| -|1769|Minimum Number of Operations to Move All Balls to Each Box||88.1%|Medium|| +|1767|Find the Subtasks That Did Not Execute||87.8%|Hard|| +|1768|Merge Strings Alternately||77.6%|Easy|| +|1769|Minimum Number of Operations to Move All Balls to Each Box||87.7%|Medium|| |1770|Maximum Score from Performing Multiplication Operations||28.8%|Medium|| -|1771|Maximize Palindrome Length From Subsequences||34.0%|Hard|| -|1772|Sort Features by Popularity||65.9%|Medium|| +|1771|Maximize Palindrome Length From Subsequences||34.1%|Hard|| +|1772|Sort Features by Popularity||66.2%|Medium|| |1773|Count Items Matching a Rule||86.8%|Easy|| -|1774|Closest Dessert Cost||60.2%|Medium|| +|1774|Closest Dessert Cost||60.1%|Medium|| |1775|Equal Sum Arrays With Minimum Number of Operations||50.5%|Medium|| -|1776|Car Fleet II||43.8%|Hard|| +|1776|Car Fleet II||43.9%|Hard|| |1777|Product's Price for Each Store||87.5%|Easy|| -|1778|Shortest Path in a Hidden Grid||46.2%|Medium|| +|1778|Shortest Path in a Hidden Grid||45.1%|Medium|| |1779|Find Nearest Point That Has the Same X or Y Coordinate||68.2%|Easy|| -|1780|Check if Number is a Sum of Powers of Three||62.7%|Medium|| -|1781|Sum of Beauty of All Substrings||46.2%|Medium|| -|1782|Count Pairs Of Nodes||27.9%|Hard|| -|1783|Grand Slam Titles||95.2%|Medium|| +|1780|Check if Number is a Sum of Powers of Three||63.0%|Medium|| +|1781|Sum of Beauty of All Substrings||46.7%|Medium|| +|1782|Count Pairs Of Nodes||29.7%|Hard|| +|1783|Grand Slam Titles||94.7%|Medium|| |1784|Check if Binary String Has at Most One Segment of Ones||42.7%|Easy|| -|1785|Minimum Elements to Add to Form a Given Sum||38.4%|Medium|| -|1786|Number of Restricted Paths From First to Last Node||35.2%|Medium|| -|1787|Make the XOR of All Segments Equal to Zero||31.7%|Hard|| +|1785|Minimum Elements to Add to Form a Given Sum||38.6%|Medium|| +|1786|Number of Restricted Paths From First to Last Node||35.3%|Medium|| +|1787|Make the XOR of All Segments Equal to Zero||33.1%|Hard|| |------------|-------------------------------------------------------|-------| ----------------| ---------------|-------------| ------------------------------------------------------------------ diff --git a/leetcode/0006.ZigZag-Conversion/6. ZigZag Conversion.go b/leetcode/0006.ZigZag-Conversion/6. ZigZag Conversion.go new file mode 100644 index 00000000..e35454ab --- /dev/null +++ b/leetcode/0006.ZigZag-Conversion/6. ZigZag Conversion.go @@ -0,0 +1,26 @@ +package leetcode + +func convert(s string, numRows int) string { + matrix, down, up := make([][]byte, numRows, numRows), 0, numRows-2 + for i := 0; i != len(s); { + if down != numRows { + matrix[down] = append(matrix[down], byte(s[i])) + down++ + i++ + } else if up > 0 { + matrix[up] = append(matrix[up], byte(s[i])) + up-- + i++ + } else { + up = numRows - 2 + down = 0 + } + } + solution := make([]byte, 0, len(s)) + for _, row := range matrix { + for _, item := range row { + solution = append(solution, item) + } + } + return string(solution) +} diff --git a/leetcode/0006.ZigZag-Conversion/6. ZigZag Conversion_test.go b/leetcode/0006.ZigZag-Conversion/6. ZigZag Conversion_test.go new file mode 100644 index 00000000..c6bbd824 --- /dev/null +++ b/leetcode/0006.ZigZag-Conversion/6. ZigZag Conversion_test.go @@ -0,0 +1,53 @@ +package leetcode + +import ( + "fmt" + "testing" +) + +type question6 struct { + para6 + ans6 +} + +// para 是参数 +// one 代表第一个参数 +type para6 struct { + s string + numRows int +} + +// ans 是答案 +// one 代表第一个答案 +type ans6 struct { + one string +} + +func Test_Problem6(t *testing.T) { + + qs := []question6{ + + { + para6{"PAYPALISHIRING", 3}, + ans6{"PAHNAPLSIIGYIR"}, + }, + + { + para6{"PAYPALISHIRING", 4}, + ans6{"PINALSIGYAHRPI"}, + }, + + { + para6{"A", 1}, + ans6{"A"}, + }, + } + + fmt.Printf("------------------------Leetcode Problem 6------------------------\n") + + for _, q := range qs { + _, p := q.ans6, q.para6 + fmt.Printf("【input】:%v 【output】:%v\n", p, convert(p.s, p.numRows)) + } + fmt.Printf("\n\n\n") +} diff --git a/leetcode/0006.ZigZag-Conversion/README.md b/leetcode/0006.ZigZag-Conversion/README.md new file mode 100644 index 00000000..b281e084 --- /dev/null +++ b/leetcode/0006.ZigZag-Conversion/README.md @@ -0,0 +1,107 @@ +# [6. ZigZag Conversion](https://leetcode.com/problems/zigzag-conversion/) + + +## 题目 + +The string `"PAYPALISHIRING"` is written in a zigzag pattern on a given number of rows like this: (you may want to display this pattern in a fixed font for better legibility) + +``` +P A H N +A P L S I I G +Y I R +``` + +And then read line by line: `"PAHNAPLSIIGYIR"` + +Write the code that will take a string and make this conversion given a number of rows: + +``` +string convert(string s, int numRows); +``` + +**Example 1:** + +``` +Input: s = "PAYPALISHIRING", numRows = 3 +Output: "PAHNAPLSIIGYIR" +``` + +**Example 2:** + +``` +Input: s = "PAYPALISHIRING", numRows = 4 +Output: "PINALSIGYAHRPI" +Explanation: +P I N +A L S I G +Y A H R +P I +``` + +**Example 3:** + +``` +Input: s = "A", numRows = 1 +Output: "A" +``` + +**Constraints:** + +- `1 <= s.length <= 1000` +- `s` consists of English letters (lower-case and upper-case), `','` and `'.'`. +- `1 <= numRows <= 1000` + +## 题目大意 + +将一个给定字符串 `s` 根据给定的行数 `numRows` ,以从上往下、从左到右进行 Z 字形排列。 + +比如输入字符串为 `"PAYPALISHIRING"` 行数为 3 时,排列如下: + +```go +P A H N +A P L S I I G +Y I R +``` + +之后,你的输出需要从左往右逐行读取,产生出一个新的字符串,比如:`"PAHNAPLSIIGYIR"`。 + +请你实现这个将字符串进行指定行数变换的函数: + +```go +string convert(string s, int numRows); +``` + +## 解题思路 + +- 这一题没有什么算法思想,考察的是对程序控制的能力。用 2 个变量保存方向,当垂直输出的行数达到了规定的目标行数以后,需要从下往上转折到第一行,循环中控制好方向ji + +## 代码 + +```go +package leetcode + +func convert(s string, numRows int) string { + matrix, down, up := make([][]byte, numRows, numRows), 0, numRows-2 + for i := 0; i != len(s); { + if down != numRows { + matrix[down] = append(matrix[down], byte(s[i])) + down++ + i++ + } else if up > 0 { + matrix[up] = append(matrix[up], byte(s[i])) + up-- + i++ + } else { + up = numRows - 2 + down = 0 + } + } + solution := make([]byte, 0, len(s)) + for _, row := range matrix { + for _, item := range row { + solution = append(solution, item) + } + } + return string(solution) +} +``` \ No newline at end of file diff --git a/leetcode/0008.String-to-Integer-atoi/8. String to Integer (atoi).go b/leetcode/0008.String-to-Integer-atoi/8. String to Integer (atoi).go new file mode 100644 index 00000000..24a04676 --- /dev/null +++ b/leetcode/0008.String-to-Integer-atoi/8. String to Integer (atoi).go @@ -0,0 +1,56 @@ +package leetcode + +func myAtoi(s string) int { + maxInt, signAllowed, whitespaceAllowed, sign, digits := int64(2<<30), true, true, 1, []int{} + for _, c := range s { + if c == ' ' && whitespaceAllowed { + continue + } + if signAllowed { + if c == '+' { + signAllowed = false + whitespaceAllowed = false + continue + } else if c == '-' { + sign = -1 + signAllowed = false + whitespaceAllowed = false + continue + } + } + if c < '0' || c > '9' { + break + } + whitespaceAllowed, signAllowed = false, false + digits = append(digits, int(c-48)) + } + var num, place int64 + place, num = 1, 0 + lastLeading0Index := -1 + for i, d := range digits { + if d == 0 { + lastLeading0Index = i + } else { + break + } + } + if lastLeading0Index > -1 { + digits = digits[lastLeading0Index+1:] + } + var rtnMax int64 + if sign > 0 { + rtnMax = maxInt - 1 + } else { + rtnMax = maxInt + } + digitsCount := len(digits) + for i := digitsCount - 1; i >= 0; i-- { + num += int64(digits[i]) * place + place *= 10 + if digitsCount-i > 10 || num > rtnMax { + return int(int64(sign) * rtnMax) + } + } + num *= int64(sign) + return int(num) +} diff --git a/leetcode/0008.String-to-Integer-atoi/8. String to Integer (atoi)_test.go b/leetcode/0008.String-to-Integer-atoi/8. String to Integer (atoi)_test.go new file mode 100644 index 00000000..e69de29b diff --git a/leetcode/0008.String-to-Integer-atoi/README.md b/leetcode/0008.String-to-Integer-atoi/README.md new file mode 100644 index 00000000..677ed334 --- /dev/null +++ b/leetcode/0008.String-to-Integer-atoi/README.md @@ -0,0 +1,192 @@ +# [8. String to Integer (atoi)](https://leetcode.com/problems/string-to-integer-atoi/) + + +## 题目 + +Implement the `myAtoi(string s)` function, which converts a string to a 32-bit signed integer (similar to C/C++'s `atoi` function). + +The algorithm for `myAtoi(string s)` is as follows: + +1. Read in and ignore any leading whitespace. +2. Check if the next character (if not already at the end of the string) is `'-'` or `'+'`. Read this character in if it is either. This determines if the final result is negative or positive respectively. Assume the result is positive if neither is present. +3. Read in next the characters until the next non-digit charcter or the end of the input is reached. The rest of the string is ignored. +4. Convert these digits into an integer (i.e. `"123" -> 123`, `"0032" -> 32`). If no digits were read, then the integer is `0`. Change the sign as necessary (from step 2). +5. If the integer is out of the 32-bit signed integer range `[-231, 231 - 1]`, then clamp the integer so that it remains in the range. Specifically, integers less than `231` should be clamped to `231`, and integers greater than `231 - 1` should be clamped to `231 - 1`. +6. Return the integer as the final result. + +**Note:** + +- Only the space character `' '` is considered a whitespace character. +- **Do not ignore** any characters other than the leading whitespace or the rest of the string after the digits. + +**Example 1:** + +``` +Input: s = "42" +Output: 42 +Explanation: The underlined characters are what is read in, the caret is the current reader position. +Step 1: "42" (no characters read because there is no leading whitespace) + ^ +Step 2: "42" (no characters read because there is neither a '-' nor '+') + ^ +Step 3: "42" ("42" is read in) + ^ +The parsed integer is 42. +Since 42 is in the range [-231, 231 - 1], the final result is 42. + +``` + +**Example 2:** + +``` +Input: s = " -42" +Output: -42 +Explanation: +Step 1: " -42" (leading whitespace is read and ignored) + ^ +Step 2: " -42" ('-' is read, so the result should be negative) + ^ +Step 3: " -42" ("42" is read in) + ^ +The parsed integer is -42. +Since -42 is in the range [-231, 231 - 1], the final result is -42. + +``` + +**Example 3:** + +``` +Input: s = "4193 with words" +Output: 4193 +Explanation: +Step 1: "4193 with words" (no characters read because there is no leading whitespace) + ^ +Step 2: "4193 with words" (no characters read because there is neither a '-' nor '+') + ^ +Step 3: "4193 with words" ("4193" is read in; reading stops because the next character is a non-digit) + ^ +The parsed integer is 4193. +Since 4193 is in the range [-231, 231 - 1], the final result is 4193. + +``` + +**Example 4:** + +``` +Input: s = "words and 987" +Output: 0 +Explanation: +Step 1: "words and 987" (no characters read because there is no leading whitespace) + ^ +Step 2: "words and 987" (no characters read because there is neither a '-' nor '+') + ^ +Step 3: "words and 987" (reading stops immediately because there is a non-digit 'w') + ^ +The parsed integer is 0 because no digits were read. +Since 0 is in the range [-231, 231 - 1], the final result is 0. + +``` + +**Example 5:** + +``` +Input: s = "-91283472332" +Output: -2147483648 +Explanation: +Step 1: "-91283472332" (no characters read because there is no leading whitespace) + ^ +Step 2: "-91283472332" ('-' is read, so the result should be negative) + ^ +Step 3: "-91283472332" ("91283472332" is read in) + ^ +The parsed integer is -91283472332. +Since -91283472332 is less than the lower bound of the range [-231, 231 - 1], the final result is clamped to -231 = -2147483648. +``` + +**Constraints:** + +- `0 <= s.length <= 200` +- `s` consists of English letters (lower-case and upper-case), digits (`0-9`), `' '`, `'+'` + +## 题目大意 + +请你来实现一个 myAtoi(string s) 函数,使其能将字符串转换成一个 32 位有符号整数(类似 C/C++ 中的 atoi 函数)。 + +函数 myAtoi(string s) 的算法如下: + +- 读入字符串并丢弃无用的前导空格 +- 检查下一个字符(假设还未到字符末尾)为正还是负号,读取该字符(如果有)。 确定最终结果是负数还是正数。 如果两者都不存在,则假定结果为正。 +- 读入下一个字符,直到到达下一个非数字字符或到达输入的结尾。字符串的其余部分将被忽略。 +- 将前面步骤读入的这些数字转换为整数(即,"123" -> 123, "0032" -> 32)。如果没有读入数字,则整数为 0 。必要时更改符号(从步骤 2 开始)。 +- 如果整数数超过 32 位有符号整数范围 [−231, 231 − 1] ,需要截断这个整数,使其保持在这个范围内。具体来说,小于 −231 的整数应该被固定为 −231 ,大于 231 − 1 的整数应该被固定为 231 − 1 。 +- 返回整数作为最终结果。 + +注意: + +- 本题中的空白字符只包括空格字符 ' ' 。 +- 除前导空格或数字后的其余字符串外,请勿忽略 任何其他字符。 + +## 解题思路 + +- 这题是简单题。题目要求实现类似 `C++` 中 `atoi` 函数的功能。这个函数功能是将字符串类型的数字转成 `int` 类型数字。先去除字符串中的前导空格,并判断记录数字的符号。数字需要去掉前导 `0` 。最后将数字转换成数字类型,判断是否超过 `int` 类型的上限 `[-2^31, 2^31 - 1]`,如果超过上限,需要输出边界,即 `-2^31`,或者 `2^31 - 1`。 + +## 代码 + +```go +package leetcode + +func myAtoi(s string) int { + maxInt, signAllowed, whitespaceAllowed, sign, digits := int64(2<<30), true, true, 1, []int{} + for _, c := range s { + if c == ' ' && whitespaceAllowed { + continue + } + if signAllowed { + if c == '+' { + signAllowed = false + whitespaceAllowed = false + continue + } else if c == '-' { + sign = -1 + signAllowed = false + whitespaceAllowed = false + continue + } + } + if c < '0' || c > '9' { + break + } + whitespaceAllowed, signAllowed = false, false + digits = append(digits, int(c-48)) + } + var num, place int64 + place, num = 1, 0 + lastLeading0Index := -1 + for i, d := range digits { + if d == 0 { + lastLeading0Index = i + } else { + break + } + } + if lastLeading0Index > -1 { + digits = digits[lastLeading0Index+1:] + } + var rtnMax int64 + if sign > 0 { + rtnMax = maxInt - 1 + } else { + rtnMax = maxInt + } + digitsCount := len(digits) + for i := digitsCount - 1; i >= 0; i-- { + num += int64(digits[i]) * place + place *= 10 + if digitsCount-i > 10 || num > rtnMax { + return int(int64(sign) * rtnMax) + } + } + num *= int64(sign) + return int(num) +} +``` \ No newline at end of file diff --git a/leetcode/0012.Integer-to-Roman/12. Integer to Roman.go b/leetcode/0012.Integer-to-Roman/12. Integer to Roman.go new file mode 100644 index 00000000..525e8aef --- /dev/null +++ b/leetcode/0012.Integer-to-Roman/12. Integer to Roman.go @@ -0,0 +1,15 @@ +package leetcode + +func intToRoman(num int) string { + values := []int{1000, 900, 500, 400, 100, 90, 50, 40, 10, 9, 5, 4, 1} + symbols := []string{"M", "CM", "D", "CD", "C", "XC", "L", "XL", "X", "IX", "V", "IV", "I"} + res, i := "", 0 + for num != 0 { + for values[i] > num { + i++ + } + num -= values[i] + res += symbols[i] + } + return res +} diff --git a/leetcode/0012.Integer-to-Roman/12. Integer to Roman_test.go b/leetcode/0012.Integer-to-Roman/12. Integer to Roman_test.go new file mode 100644 index 00000000..c5fff602 --- /dev/null +++ b/leetcode/0012.Integer-to-Roman/12. Integer to Roman_test.go @@ -0,0 +1,71 @@ +package leetcode + +import ( + "fmt" + "testing" +) + +type question12 struct { + para12 + ans12 +} + +// para 是参数 +// one 代表第一个参数 +type para12 struct { + one int +} + +// ans 是答案 +// one 代表第一个答案 +type ans12 struct { + one string +} + +func Test_Problem12(t *testing.T) { + + qs := []question12{ + + { + para12{3}, + ans12{"III"}, + }, + + { + para12{4}, + ans12{"IV"}, + }, + + { + para12{9}, + ans12{"IX"}, + }, + + { + para12{58}, + ans12{"LVIII"}, + }, + + { + para12{1994}, + ans12{"MCMXCIV"}, + }, + { + para12{123}, + ans12{"CXXIII"}, + }, + + { + para12{120}, + ans12{"CXX"}, + }, + } + + fmt.Printf("------------------------Leetcode Problem 12------------------------\n") + + for _, q := range qs { + _, p := q.ans12, q.para12 + fmt.Printf("【input】:%v 【output】:%v\n", p.one, intToRoman(p.one)) + } + fmt.Printf("\n\n\n") +} diff --git a/leetcode/0012.Integer-to-Roman/README.md b/leetcode/0012.Integer-to-Roman/README.md new file mode 100644 index 00000000..5a2882d6 --- /dev/null +++ b/leetcode/0012.Integer-to-Roman/README.md @@ -0,0 +1,102 @@ +# [12. Integer to Roman](https://leetcode.com/problems/integer-to-roman/) + + +## 题目 + +Roman numerals are represented by seven different symbols: `I`, `V`, `X`, `L`, `C`, `D` and `M`. + +``` +Symbol Value +I 1 +V 5 +X 10 +L 50 +C 100 +D 500 +M 1000 +``` + +For example, `2` is written as `II` in Roman numeral, just two one's added together. `12` is written as `XII`, which is simply `X + II`. The number `27` is written as `XXVII`, which is `XX + V + II`. + +Roman numerals are usually written largest to smallest from left to right. However, the numeral for four is not `IIII`. Instead, the number four is written as `IV`. Because the one is before the five we subtract it making four. The same principle applies to the number nine, which is written as `IX`. There are six instances where subtraction is used: + +- `I` can be placed before `V` (5) and `X` (10) to make 4 and 9. +- `X` can be placed before `L` (50) and `C` (100) to make 40 and 90. +- `C` can be placed before `D` (500) and `M` (1000) to make 400 and 900. + +Given an integer, convert it to a roman numeral. + +**Example 1:** + +``` +Input: num = 3 +Output: "III" +``` + +**Example 2:** + +``` +Input: num = 4 +Output: "IV" +``` + +**Example 3:** + +``` +Input: num = 9 +Output: "IX" +``` + +**Example 4:** + +``` +Input: num = 58 +Output: "LVIII" +Explanation: L = 50, V = 5, III = 3. +``` + +**Example 5:** + +``` +Input: num = 1994 +Output: "MCMXCIV" +Explanation: M = 1000, CM = 900, XC = 90 and IV = 4. +``` + +**Constraints:** + +- `1 <= num <= 3999` + +## 题目大意 + +通常情况下,罗马数字中小的数字在大的数字的右边。但也存在特例,例如 4 不写做 IIII,而是 IV。数字 1 在数字 5 的左边,所表示的数等于大数 5 减小数 1 得到的数值 4 。同样地,数字 9 表示为 IX。这个特殊的规则只适用于以下六种情况: + +- I 可以放在 V (5) 和 X (10) 的左边,来表示 4 和 9。 +- X 可以放在 L (50) 和 C (100) 的左边,来表示 40 和 90。 +- C 可以放在 D (500) 和 M (1000) 的左边,来表示 400 和 900。 + +给定一个整数,将其转为罗马数字。输入确保在 1 到 3999 的范围内。 + +## 解题思路 + +- 依照题意,优先选择大的数字,解题思路采用贪心算法。将 1-3999 范围内的罗马数字从大到小放在数组中,从头选择到尾,即可把整数转成罗马数字。 + +## 代码 + +```go +package leetcode + +func intToRoman(num int) string { + values := []int{1000, 900, 500, 400, 100, 90, 50, 40, 10, 9, 5, 4, 1} + symbols := []string{"M", "CM", "D", "CD", "C", "XC", "L", "XL", "X", "IX", "V", "IV", "I"} + res, i := "", 0 + for num != 0 { + for values[i] > num { + i++ + } + num -= values[i] + res += symbols[i] + } + return res +} +``` \ No newline at end of file diff --git a/website/content/ChapterFour/0001~0099/0005.Longest-Palindromic-Substring.md b/website/content/ChapterFour/0001~0099/0005.Longest-Palindromic-Substring.md index 3306f945..c8952865 100644 --- a/website/content/ChapterFour/0001~0099/0005.Longest-Palindromic-Substring.md +++ b/website/content/ChapterFour/0001~0099/0005.Longest-Palindromic-Substring.md @@ -189,5 +189,5 @@ func longestPalindrome3(s string) string { ----------------------------------------------
diff --git a/website/content/ChapterFour/0001~0099/0006.ZigZag-Conversion.md b/website/content/ChapterFour/0001~0099/0006.ZigZag-Conversion.md new file mode 100644 index 00000000..8f61aedc --- /dev/null +++ b/website/content/ChapterFour/0001~0099/0006.ZigZag-Conversion.md @@ -0,0 +1,114 @@ +# [6. ZigZag Conversion](https://leetcode.com/problems/zigzag-conversion/) + + +## 题目 + +The string `"PAYPALISHIRING"` is written in a zigzag pattern on a given number of rows like this: (you may want to display this pattern in a fixed font for better legibility) + +``` +P A H N +A P L S I I G +Y I R +``` + +And then read line by line: `"PAHNAPLSIIGYIR"` + +Write the code that will take a string and make this conversion given a number of rows: + +``` +string convert(string s, int numRows); +``` + +**Example 1:** + +``` +Input: s = "PAYPALISHIRING", numRows = 3 +Output: "PAHNAPLSIIGYIR" +``` + +**Example 2:** + +``` +Input: s = "PAYPALISHIRING", numRows = 4 +Output: "PINALSIGYAHRPI" +Explanation: +P I N +A L S I G +Y A H R +P I +``` + +**Example 3:** + +``` +Input: s = "A", numRows = 1 +Output: "A" +``` + +**Constraints:** + +- `1 <= s.length <= 1000` +- `s` consists of English letters (lower-case and upper-case), `','` and `'.'`. +- `1 <= numRows <= 1000` + +## 题目大意 + +将一个给定字符串 `s` 根据给定的行数 `numRows` ,以从上往下、从左到右进行 Z 字形排列。 + +比如输入字符串为 `"PAYPALISHIRING"` 行数为 3 时,排列如下: + +```go +P A H N +A P L S I I G +Y I R +``` + +之后,你的输出需要从左往右逐行读取,产生出一个新的字符串,比如:`"PAHNAPLSIIGYIR"`。 + +请你实现这个将字符串进行指定行数变换的函数: + +```go +string convert(string s, int numRows); +``` + +## 解题思路 + +- 这一题没有什么算法思想,考察的是对程序控制的能力。用 2 个变量保存方向,当垂直输出的行数达到了规定的目标行数以后,需要从下往上转折到第一行,循环中控制好方向ji + +## 代码 + +```go +package leetcode + +func convert(s string, numRows int) string { + matrix, down, up := make([][]byte, numRows, numRows), 0, numRows-2 + for i := 0; i != len(s); { + if down != numRows { + matrix[down] = append(matrix[down], byte(s[i])) + down++ + i++ + } else if up > 0 { + matrix[up] = append(matrix[up], byte(s[i])) + up-- + i++ + } else { + up = numRows - 2 + down = 0 + } + } + solution := make([]byte, 0, len(s)) + for _, row := range matrix { + for _, item := range row { + solution = append(solution, item) + } + } + return string(solution) +} +``` + + +---------------------------------------------- + diff --git a/website/content/ChapterFour/0001~0099/0007.Reverse-Integer.md b/website/content/ChapterFour/0001~0099/0007.Reverse-Integer.md index f4a3d7db..5f0b783f 100755 --- a/website/content/ChapterFour/0001~0099/0007.Reverse-Integer.md +++ b/website/content/ChapterFour/0001~0099/0007.Reverse-Integer.md @@ -57,6 +57,6 @@ func reverse7(x int) int { ---------------------------------------------- diff --git a/website/content/ChapterFour/0001~0099/0008.String-to-Integer-atoi.md b/website/content/ChapterFour/0001~0099/0008.String-to-Integer-atoi.md new file mode 100644 index 00000000..0f37b876 --- /dev/null +++ b/website/content/ChapterFour/0001~0099/0008.String-to-Integer-atoi.md @@ -0,0 +1,199 @@ +# [8. String to Integer (atoi)](https://leetcode.com/problems/string-to-integer-atoi/) + + +## 题目 + +Implement the `myAtoi(string s)` function, which converts a string to a 32-bit signed integer (similar to C/C++'s `atoi` function). + +The algorithm for `myAtoi(string s)` is as follows: + +1. Read in and ignore any leading whitespace. +2. Check if the next character (if not already at the end of the string) is `'-'` or `'+'`. Read this character in if it is either. This determines if the final result is negative or positive respectively. Assume the result is positive if neither is present. +3. Read in next the characters until the next non-digit charcter or the end of the input is reached. The rest of the string is ignored. +4. Convert these digits into an integer (i.e. `"123" -> 123`, `"0032" -> 32`). If no digits were read, then the integer is `0`. Change the sign as necessary (from step 2). +5. If the integer is out of the 32-bit signed integer range `[-231, 231 - 1]`, then clamp the integer so that it remains in the range. Specifically, integers less than `231` should be clamped to `231`, and integers greater than `231 - 1` should be clamped to `231 - 1`. +6. Return the integer as the final result. + +**Note:** + +- Only the space character `' '` is considered a whitespace character. +- **Do not ignore** any characters other than the leading whitespace or the rest of the string after the digits. + +**Example 1:** + +``` +Input: s = "42" +Output: 42 +Explanation: The underlined characters are what is read in, the caret is the current reader position. +Step 1: "42" (no characters read because there is no leading whitespace) + ^ +Step 2: "42" (no characters read because there is neither a '-' nor '+') + ^ +Step 3: "42" ("42" is read in) + ^ +The parsed integer is 42. +Since 42 is in the range [-231, 231 - 1], the final result is 42. + +``` + +**Example 2:** + +``` +Input: s = " -42" +Output: -42 +Explanation: +Step 1: " -42" (leading whitespace is read and ignored) + ^ +Step 2: " -42" ('-' is read, so the result should be negative) + ^ +Step 3: " -42" ("42" is read in) + ^ +The parsed integer is -42. +Since -42 is in the range [-231, 231 - 1], the final result is -42. + +``` + +**Example 3:** + +``` +Input: s = "4193 with words" +Output: 4193 +Explanation: +Step 1: "4193 with words" (no characters read because there is no leading whitespace) + ^ +Step 2: "4193 with words" (no characters read because there is neither a '-' nor '+') + ^ +Step 3: "4193 with words" ("4193" is read in; reading stops because the next character is a non-digit) + ^ +The parsed integer is 4193. +Since 4193 is in the range [-231, 231 - 1], the final result is 4193. + +``` + +**Example 4:** + +``` +Input: s = "words and 987" +Output: 0 +Explanation: +Step 1: "words and 987" (no characters read because there is no leading whitespace) + ^ +Step 2: "words and 987" (no characters read because there is neither a '-' nor '+') + ^ +Step 3: "words and 987" (reading stops immediately because there is a non-digit 'w') + ^ +The parsed integer is 0 because no digits were read. +Since 0 is in the range [-231, 231 - 1], the final result is 0. + +``` + +**Example 5:** + +``` +Input: s = "-91283472332" +Output: -2147483648 +Explanation: +Step 1: "-91283472332" (no characters read because there is no leading whitespace) + ^ +Step 2: "-91283472332" ('-' is read, so the result should be negative) + ^ +Step 3: "-91283472332" ("91283472332" is read in) + ^ +The parsed integer is -91283472332. +Since -91283472332 is less than the lower bound of the range [-231, 231 - 1], the final result is clamped to -231 = -2147483648. +``` + +**Constraints:** + +- `0 <= s.length <= 200` +- `s` consists of English letters (lower-case and upper-case), digits (`0-9`), `' '`, `'+'` + +## 题目大意 + +请你来实现一个 myAtoi(string s) 函数,使其能将字符串转换成一个 32 位有符号整数(类似 C/C++ 中的 atoi 函数)。 + +函数 myAtoi(string s) 的算法如下: + +- 读入字符串并丢弃无用的前导空格 +- 检查下一个字符(假设还未到字符末尾)为正还是负号,读取该字符(如果有)。 确定最终结果是负数还是正数。 如果两者都不存在,则假定结果为正。 +- 读入下一个字符,直到到达下一个非数字字符或到达输入的结尾。字符串的其余部分将被忽略。 +- 将前面步骤读入的这些数字转换为整数(即,"123" -> 123, "0032" -> 32)。如果没有读入数字,则整数为 0 。必要时更改符号(从步骤 2 开始)。 +- 如果整数数超过 32 位有符号整数范围 [−231, 231 − 1] ,需要截断这个整数,使其保持在这个范围内。具体来说,小于 −231 的整数应该被固定为 −231 ,大于 231 − 1 的整数应该被固定为 231 − 1 。 +- 返回整数作为最终结果。 + +注意: + +- 本题中的空白字符只包括空格字符 ' ' 。 +- 除前导空格或数字后的其余字符串外,请勿忽略 任何其他字符。 + +## 解题思路 + +- 这题是简单题。题目要求实现类似 `C++` 中 `atoi` 函数的功能。这个函数功能是将字符串类型的数字转成 `int` 类型数字。先去除字符串中的前导空格,并判断记录数字的符号。数字需要去掉前导 `0` 。最后将数字转换成数字类型,判断是否超过 `int` 类型的上限 `[-2^31, 2^31 - 1]`,如果超过上限,需要输出边界,即 `-2^31`,或者 `2^31 - 1`。 + +## 代码 + +```go +package leetcode + +func myAtoi(s string) int { + maxInt, signAllowed, whitespaceAllowed, sign, digits := int64(2<<30), true, true, 1, []int{} + for _, c := range s { + if c == ' ' && whitespaceAllowed { + continue + } + if signAllowed { + if c == '+' { + signAllowed = false + whitespaceAllowed = false + continue + } else if c == '-' { + sign = -1 + signAllowed = false + whitespaceAllowed = false + continue + } + } + if c < '0' || c > '9' { + break + } + whitespaceAllowed, signAllowed = false, false + digits = append(digits, int(c-48)) + } + var num, place int64 + place, num = 1, 0 + lastLeading0Index := -1 + for i, d := range digits { + if d == 0 { + lastLeading0Index = i + } else { + break + } + } + if lastLeading0Index > -1 { + digits = digits[lastLeading0Index+1:] + } + var rtnMax int64 + if sign > 0 { + rtnMax = maxInt - 1 + } else { + rtnMax = maxInt + } + digitsCount := len(digits) + for i := digitsCount - 1; i >= 0; i-- { + num += int64(digits[i]) * place + place *= 10 + if digitsCount-i > 10 || num > rtnMax { + return int(int64(sign) * rtnMax) + } + } + num *= int64(sign) + return int(num) +} +``` + + +---------------------------------------------- + diff --git a/website/content/ChapterFour/0001~0099/0009.Palindrome-Number.md b/website/content/ChapterFour/0001~0099/0009.Palindrome-Number.md index 506c672a..4cfa1c98 100644 --- a/website/content/ChapterFour/0001~0099/0009.Palindrome-Number.md +++ b/website/content/ChapterFour/0001~0099/0009.Palindrome-Number.md @@ -98,6 +98,6 @@ func isPalindrome1(x int) bool { ---------------------------------------------- diff --git a/website/content/ChapterFour/0001~0099/0011.Container-With-Most-Water.md b/website/content/ChapterFour/0001~0099/0011.Container-With-Most-Water.md index 7c40c781..6e81d5b0 100644 --- a/website/content/ChapterFour/0001~0099/0011.Container-With-Most-Water.md +++ b/website/content/ChapterFour/0001~0099/0011.Container-With-Most-Water.md @@ -62,5 +62,5 @@ func maxArea(height []int) int { ---------------------------------------------- diff --git a/website/content/ChapterFour/0001~0099/0012.Integer-to-Roman.md b/website/content/ChapterFour/0001~0099/0012.Integer-to-Roman.md new file mode 100644 index 00000000..274c2a12 --- /dev/null +++ b/website/content/ChapterFour/0001~0099/0012.Integer-to-Roman.md @@ -0,0 +1,109 @@ +# [12. Integer to Roman](https://leetcode.com/problems/integer-to-roman/) + + +## 题目 + +Roman numerals are represented by seven different symbols: `I`, `V`, `X`, `L`, `C`, `D` and `M`. + +``` +Symbol Value +I 1 +V 5 +X 10 +L 50 +C 100 +D 500 +M 1000 +``` + +For example, `2` is written as `II` in Roman numeral, just two one's added together. `12` is written as `XII`, which is simply `X + II`. The number `27` is written as `XXVII`, which is `XX + V + II`. + +Roman numerals are usually written largest to smallest from left to right. However, the numeral for four is not `IIII`. Instead, the number four is written as `IV`. Because the one is before the five we subtract it making four. The same principle applies to the number nine, which is written as `IX`. There are six instances where subtraction is used: + +- `I` can be placed before `V` (5) and `X` (10) to make 4 and 9. +- `X` can be placed before `L` (50) and `C` (100) to make 40 and 90. +- `C` can be placed before `D` (500) and `M` (1000) to make 400 and 900. + +Given an integer, convert it to a roman numeral. + +**Example 1:** + +``` +Input: num = 3 +Output: "III" +``` + +**Example 2:** + +``` +Input: num = 4 +Output: "IV" +``` + +**Example 3:** + +``` +Input: num = 9 +Output: "IX" +``` + +**Example 4:** + +``` +Input: num = 58 +Output: "LVIII" +Explanation: L = 50, V = 5, III = 3. +``` + +**Example 5:** + +``` +Input: num = 1994 +Output: "MCMXCIV" +Explanation: M = 1000, CM = 900, XC = 90 and IV = 4. +``` + +**Constraints:** + +- `1 <= num <= 3999` + +## 题目大意 + +通常情况下,罗马数字中小的数字在大的数字的右边。但也存在特例,例如 4 不写做 IIII,而是 IV。数字 1 在数字 5 的左边,所表示的数等于大数 5 减小数 1 得到的数值 4 。同样地,数字 9 表示为 IX。这个特殊的规则只适用于以下六种情况: + +- I 可以放在 V (5) 和 X (10) 的左边,来表示 4 和 9。 +- X 可以放在 L (50) 和 C (100) 的左边,来表示 40 和 90。 +- C 可以放在 D (500) 和 M (1000) 的左边,来表示 400 和 900。 + +给定一个整数,将其转为罗马数字。输入确保在 1 到 3999 的范围内。 + +## 解题思路 + +- 依照题意,优先选择大的数字,解题思路采用贪心算法。将 1-3999 范围内的罗马数字从大到小放在数组中,从头选择到尾,即可把整数转成罗马数字。 + +## 代码 + +```go +package leetcode + +func intToRoman(num int) string { + values := []int{1000, 900, 500, 400, 100, 90, 50, 40, 10, 9, 5, 4, 1} + symbols := []string{"M", "CM", "D", "CD", "C", "XC", "L", "XL", "X", "IX", "V", "IV", "I"} + res, i := "", 0 + for num != 0 { + for values[i] > num { + i++ + } + num -= values[i] + res += symbols[i] + } + return res +} +``` + + +---------------------------------------------- + diff --git a/website/content/ChapterFour/0001~0099/0013.Roman-to-Integer.md b/website/content/ChapterFour/0001~0099/0013.Roman-to-Integer.md index fd652aea..2eb6ff75 100644 --- a/website/content/ChapterFour/0001~0099/0013.Roman-to-Integer.md +++ b/website/content/ChapterFour/0001~0099/0013.Roman-to-Integer.md @@ -134,6 +134,6 @@ func romanToInt(s string) int { ---------------------------------------------- diff --git a/website/content/ChapterTwo/Array.md b/website/content/ChapterTwo/Array.md index 6f9d5095..fe0bfa08 100644 --- a/website/content/ChapterTwo/Array.md +++ b/website/content/ChapterTwo/Array.md @@ -60,7 +60,7 @@ weight: 1 |0167|Two Sum II - Input array is sorted|[Go]({{< relref "/ChapterFour/0100~0199/0167.Two-Sum-II-Input-array-is-sorted.md" >}})|Easy| O(n)| O(1)||55.7%| |0169|Majority Element|[Go]({{< relref "/ChapterFour/0100~0199/0169.Majority-Element.md" >}})|Easy||||60.1%| |0189|Rotate Array|[Go]({{< relref "/ChapterFour/0100~0199/0189.Rotate-Array.md" >}})|Medium||||36.6%| -|0209|Minimum Size Subarray Sum|[Go]({{< relref "/ChapterFour/0200~0299/0209.Minimum-Size-Subarray-Sum.md" >}})|Medium| O(n)| O(1)||39.5%| +|0209|Minimum Size Subarray Sum|[Go]({{< relref "/ChapterFour/0200~0299/0209.Minimum-Size-Subarray-Sum.md" >}})|Medium| O(n)| O(1)||39.6%| |0216|Combination Sum III|[Go]({{< relref "/ChapterFour/0200~0299/0216.Combination-Sum-III.md" >}})|Medium| O(n)| O(1)|❤️|60.4%| |0217|Contains Duplicate|[Go]({{< relref "/ChapterFour/0200~0299/0217.Contains-Duplicate.md" >}})|Easy| O(n)| O(n)||56.7%| |0219|Contains Duplicate II|[Go]({{< relref "/ChapterFour/0200~0299/0219.Contains-Duplicate-II.md" >}})|Easy| O(n)| O(n)||38.7%| @@ -87,11 +87,11 @@ weight: 1 |0695|Max Area of Island|[Go]({{< relref "/ChapterFour/0600~0699/0695.Max-Area-of-Island.md" >}})|Medium||||64.9%| |0697|Degree of an Array|[Go]({{< relref "/ChapterFour/0600~0699/0697.Degree-of-an-Array.md" >}})|Easy||||54.5%| |0713|Subarray Product Less Than K|[Go]({{< relref "/ChapterFour/0700~0799/0713.Subarray-Product-Less-Than-K.md" >}})|Medium| O(n)| O(1)||40.5%| -|0714|Best Time to Buy and Sell Stock with Transaction Fee|[Go]({{< relref "/ChapterFour/0700~0799/0714.Best-Time-to-Buy-and-Sell-Stock-with-Transaction-Fee.md" >}})|Medium| O(n)| O(1)||56.1%| +|0714|Best Time to Buy and Sell Stock with Transaction Fee|[Go]({{< relref "/ChapterFour/0700~0799/0714.Best-Time-to-Buy-and-Sell-Stock-with-Transaction-Fee.md" >}})|Medium| O(n)| O(1)||56.2%| |0717|1-bit and 2-bit Characters|[Go]({{< relref "/ChapterFour/0700~0799/0717.1-bit-and-2-bit-Characters.md" >}})|Easy||||47.1%| |0718|Maximum Length of Repeated Subarray|[Go]({{< relref "/ChapterFour/0700~0799/0718.Maximum-Length-of-Repeated-Subarray.md" >}})|Medium||||50.4%| |0719|Find K-th Smallest Pair Distance|[Go]({{< relref "/ChapterFour/0700~0799/0719.Find-K-th-Smallest-Pair-Distance.md" >}})|Hard||||32.6%| -|0724|Find Pivot Index|[Go]({{< relref "/ChapterFour/0700~0799/0724.Find-Pivot-Index.md" >}})|Easy||||45.6%| +|0724|Find Pivot Index|[Go]({{< relref "/ChapterFour/0700~0799/0724.Find-Pivot-Index.md" >}})|Easy||||45.7%| |0729|My Calendar I|[Go]({{< relref "/ChapterFour/0700~0799/0729.My-Calendar-I.md" >}})|Medium||||53.4%| |0746|Min Cost Climbing Stairs|[Go]({{< relref "/ChapterFour/0700~0799/0746.Min-Cost-Climbing-Stairs.md" >}})|Easy| O(n)| O(1)||50.9%| |0766|Toeplitz Matrix|[Go]({{< relref "/ChapterFour/0700~0799/0766.Toeplitz-Matrix.md" >}})|Easy| O(n)| O(1)||65.9%| @@ -112,7 +112,7 @@ weight: 1 |0989|Add to Array-Form of Integer|[Go]({{< relref "/ChapterFour/0900~0999/0989.Add-to-Array-Form-of-Integer.md" >}})|Easy||||44.9%| |0999|Available Captures for Rook|[Go]({{< relref "/ChapterFour/0900~0999/0999.Available-Captures-for-Rook.md" >}})|Easy||||67.8%| |1002|Find Common Characters|[Go]({{< relref "/ChapterFour/1000~1099/1002.Find-Common-Characters.md" >}})|Easy||||68.6%| -|1011|Capacity To Ship Packages Within D Days|[Go]({{< relref "/ChapterFour/1000~1099/1011.Capacity-To-Ship-Packages-Within-D-Days.md" >}})|Medium||||59.7%| +|1011|Capacity To Ship Packages Within D Days|[Go]({{< relref "/ChapterFour/1000~1099/1011.Capacity-To-Ship-Packages-Within-D-Days.md" >}})|Medium||||59.8%| |1018|Binary Prefix Divisible By 5|[Go]({{< relref "/ChapterFour/1000~1099/1018.Binary-Prefix-Divisible-By-5.md" >}})|Easy||||47.8%| |1040|Moving Stones Until Consecutive II|[Go]({{< relref "/ChapterFour/1000~1099/1040.Moving-Stones-Until-Consecutive-II.md" >}})|Medium||||54.1%| |1051|Height Checker|[Go]({{< relref "/ChapterFour/1000~1099/1051.Height-Checker.md" >}})|Easy||||72.1%| @@ -124,7 +124,7 @@ weight: 1 |1157|Online Majority Element In Subarray|[Go]({{< relref "/ChapterFour/1100~1199/1157.Online-Majority-Element-In-Subarray.md" >}})|Hard||||39.7%| |1160|Find Words That Can Be Formed by Characters|[Go]({{< relref "/ChapterFour/1100~1199/1160.Find-Words-That-Can-Be-Formed-by-Characters.md" >}})|Easy||||67.9%| |1170|Compare Strings by Frequency of the Smallest Character|[Go]({{< relref "/ChapterFour/1100~1199/1170.Compare-Strings-by-Frequency-of-the-Smallest-Character.md" >}})|Medium||||59.8%| -|1184|Distance Between Bus Stops|[Go]({{< relref "/ChapterFour/1100~1199/1184.Distance-Between-Bus-Stops.md" >}})|Easy||||54.1%| +|1184|Distance Between Bus Stops|[Go]({{< relref "/ChapterFour/1100~1199/1184.Distance-Between-Bus-Stops.md" >}})|Easy||||54.0%| |1185|Day of the Week|[Go]({{< relref "/ChapterFour/1100~1199/1185.Day-of-the-Week.md" >}})|Easy||||61.3%| |1200|Minimum Absolute Difference|[Go]({{< relref "/ChapterFour/1200~1299/1200.Minimum-Absolute-Difference.md" >}})|Easy||||67.0%| |1202|Smallest String With Swaps|[Go]({{< relref "/ChapterFour/1200~1299/1202.Smallest-String-With-Swaps.md" >}})|Medium||||48.8%| @@ -147,27 +147,27 @@ weight: 1 |1385|Find the Distance Value Between Two Arrays|[Go]({{< relref "/ChapterFour/1300~1399/1385.Find-the-Distance-Value-Between-Two-Arrays.md" >}})|Easy||||66.3%| |1389|Create Target Array in the Given Order|[Go]({{< relref "/ChapterFour/1300~1399/1389.Create-Target-Array-in-the-Given-Order.md" >}})|Easy||||84.8%| |1423|Maximum Points You Can Obtain from Cards|[Go]({{< relref "/ChapterFour/1400~1499/1423.Maximum-Points-You-Can-Obtain-from-Cards.md" >}})|Medium||||46.7%| -|1437|Check If All 1's Are at Least Length K Places Away|[Go]({{< relref "/ChapterFour/1400~1499/1437.Check-If-All-1s-Are-at-Least-Length-K-Places-Away.md" >}})|Easy||||62.4%| +|1437|Check If All 1's Are at Least Length K Places Away|[Go]({{< relref "/ChapterFour/1400~1499/1437.Check-If-All-1s-Are-at-Least-Length-K-Places-Away.md" >}})|Easy||||62.3%| |1438|Longest Continuous Subarray With Absolute Diff Less Than or Equal to Limit|[Go]({{< relref "/ChapterFour/1400~1499/1438.Longest-Continuous-Subarray-With-Absolute-Diff-Less-Than-or-Equal-to-Limit.md" >}})|Medium||||44.4%| |1464|Maximum Product of Two Elements in an Array|[Go]({{< relref "/ChapterFour/1400~1499/1464.Maximum-Product-of-Two-Elements-in-an-Array.md" >}})|Easy||||77.1%| |1470|Shuffle the Array|[Go]({{< relref "/ChapterFour/1400~1499/1470.Shuffle-the-Array.md" >}})|Easy||||88.2%| |1480|Running Sum of 1d Array|[Go]({{< relref "/ChapterFour/1400~1499/1480.Running-Sum-of-1d-Array.md" >}})|Easy||||88.9%| |1512|Number of Good Pairs|[Go]({{< relref "/ChapterFour/1500~1599/1512.Number-of-Good-Pairs.md" >}})|Easy||||87.7%| |1539|Kth Missing Positive Number|[Go]({{< relref "/ChapterFour/1500~1599/1539.Kth-Missing-Positive-Number.md" >}})|Easy||||55.0%| -|1608|Special Array With X Elements Greater Than or Equal X|[Go]({{< relref "/ChapterFour/1600~1699/1608.Special-Array-With-X-Elements-Greater-Than-or-Equal-X.md" >}})|Easy||||61.4%| +|1608|Special Array With X Elements Greater Than or Equal X|[Go]({{< relref "/ChapterFour/1600~1699/1608.Special-Array-With-X-Elements-Greater-Than-or-Equal-X.md" >}})|Easy||||61.3%| |1619|Mean of Array After Removing Some Elements|[Go]({{< relref "/ChapterFour/1600~1699/1619.Mean-of-Array-After-Removing-Some-Elements.md" >}})|Easy||||65.0%| -|1629|Slowest Key|[Go]({{< relref "/ChapterFour/1600~1699/1629.Slowest-Key.md" >}})|Easy||||59.1%| +|1629|Slowest Key|[Go]({{< relref "/ChapterFour/1600~1699/1629.Slowest-Key.md" >}})|Easy||||59.2%| |1636|Sort Array by Increasing Frequency|[Go]({{< relref "/ChapterFour/1600~1699/1636.Sort-Array-by-Increasing-Frequency.md" >}})|Easy||||66.8%| |1640|Check Array Formation Through Concatenation|[Go]({{< relref "/ChapterFour/1600~1699/1640.Check-Array-Formation-Through-Concatenation.md" >}})|Easy||||60.0%| |1646|Get Maximum in Generated Array|[Go]({{< relref "/ChapterFour/1600~1699/1646.Get-Maximum-in-Generated-Array.md" >}})|Easy||||53.3%| |1652|Defuse the Bomb|[Go]({{< relref "/ChapterFour/1600~1699/1652.Defuse-the-Bomb.md" >}})|Easy||||62.7%| -|1656|Design an Ordered Stream|[Go]({{< relref "/ChapterFour/1600~1699/1656.Design-an-Ordered-Stream.md" >}})|Easy||||82.2%| +|1656|Design an Ordered Stream|[Go]({{< relref "/ChapterFour/1600~1699/1656.Design-an-Ordered-Stream.md" >}})|Easy||||82.1%| |1672|Richest Customer Wealth|[Go]({{< relref "/ChapterFour/1600~1699/1672.Richest-Customer-Wealth.md" >}})|Easy||||88.2%| |1700|Number of Students Unable to Eat Lunch|[Go]({{< relref "/ChapterFour/1700~1799/1700.Number-of-Students-Unable-to-Eat-Lunch.md" >}})|Easy||||68.2%| -|1732|Find the Highest Altitude|[Go]({{< relref "/ChapterFour/1700~1799/1732.Find-the-Highest-Altitude.md" >}})|Easy||||80.8%| +|1732|Find the Highest Altitude|[Go]({{< relref "/ChapterFour/1700~1799/1732.Find-the-Highest-Altitude.md" >}})|Easy||||80.7%| |1742|Maximum Number of Balls in a Box|[Go]({{< relref "/ChapterFour/1700~1799/1742.Maximum-Number-of-Balls-in-a-Box.md" >}})|Easy||||74.7%| -|1748|Sum of Unique Elements|[Go]({{< relref "/ChapterFour/1700~1799/1748.Sum-of-Unique-Elements.md" >}})|Easy||||75.6%| -|1752|Check if Array Is Sorted and Rotated|[Go]({{< relref "/ChapterFour/1700~1799/1752.Check-if-Array-Is-Sorted-and-Rotated.md" >}})|Easy||||63.7%| +|1748|Sum of Unique Elements|[Go]({{< relref "/ChapterFour/1700~1799/1748.Sum-of-Unique-Elements.md" >}})|Easy||||75.5%| +|1752|Check if Array Is Sorted and Rotated|[Go]({{< relref "/ChapterFour/1700~1799/1752.Check-if-Array-Is-Sorted-and-Rotated.md" >}})|Easy||||63.5%| |1758|Minimum Changes To Make Alternating Binary String|[Go]({{< relref "/ChapterFour/1700~1799/1758.Minimum-Changes-To-Make-Alternating-Binary-String.md" >}})|Easy||||58.9%| |------------|-------------------------------------------------------|-------| ----------------| ---------------|-------------|-------------|-------------| diff --git a/website/content/ChapterTwo/Backtracking.md b/website/content/ChapterTwo/Backtracking.md index c87d052d..33615321 100644 --- a/website/content/ChapterTwo/Backtracking.md +++ b/website/content/ChapterTwo/Backtracking.md @@ -108,14 +108,14 @@ func updateMatrix_BFS(matrix [][]int) [][]int { |0046|Permutations|[Go]({{< relref "/ChapterFour/0001~0099/0046.Permutations.md" >}})|Medium| O(n)| O(n)|❤️|66.7%| |0047|Permutations II|[Go]({{< relref "/ChapterFour/0001~0099/0047.Permutations-II.md" >}})|Medium| O(n^2)| O(n)|❤️|49.5%| |0051|N-Queens|[Go]({{< relref "/ChapterFour/0001~0099/0051.N-Queens.md" >}})|Hard| O(n!)| O(n)|❤️|49.8%| -|0052|N-Queens II|[Go]({{< relref "/ChapterFour/0001~0099/0052.N-Queens-II.md" >}})|Hard| O(n!)| O(n)|❤️|60.2%| +|0052|N-Queens II|[Go]({{< relref "/ChapterFour/0001~0099/0052.N-Queens-II.md" >}})|Hard| O(n!)| O(n)|❤️|60.3%| |0060|Permutation Sequence|[Go]({{< relref "/ChapterFour/0001~0099/0060.Permutation-Sequence.md" >}})|Hard| O(n log n)| O(1)||39.4%| |0077|Combinations|[Go]({{< relref "/ChapterFour/0001~0099/0077.Combinations.md" >}})|Medium| O(n)| O(n)|❤️|57.6%| |0078|Subsets|[Go]({{< relref "/ChapterFour/0001~0099/0078.Subsets.md" >}})|Medium| O(n^2)| O(n)|❤️|65.2%| |0079|Word Search|[Go]({{< relref "/ChapterFour/0001~0099/0079.Word-Search.md" >}})|Medium| O(n^2)| O(n^2)|❤️|36.9%| |0089|Gray Code|[Go]({{< relref "/ChapterFour/0001~0099/0089.Gray-Code.md" >}})|Medium| O(n)| O(1)||50.5%| |0090|Subsets II|[Go]({{< relref "/ChapterFour/0001~0099/0090.Subsets-II.md" >}})|Medium| O(n^2)| O(n)|❤️|48.9%| -|0093|Restore IP Addresses|[Go]({{< relref "/ChapterFour/0001~0099/0093.Restore-IP-Addresses.md" >}})|Medium| O(n)| O(n)|❤️|37.6%| +|0093|Restore IP Addresses|[Go]({{< relref "/ChapterFour/0001~0099/0093.Restore-IP-Addresses.md" >}})|Medium| O(n)| O(n)|❤️|37.7%| |0126|Word Ladder II|[Go]({{< relref "/ChapterFour/0100~0199/0126.Word-Ladder-II.md" >}})|Hard| O(n)| O(n^2)|❤️|23.8%| |0131|Palindrome Partitioning|[Go]({{< relref "/ChapterFour/0100~0199/0131.Palindrome-Partitioning.md" >}})|Medium| O(n)| O(n^2)|❤️|52.2%| |0211|Design Add and Search Words Data Structure|[Go]({{< relref "/ChapterFour/0200~0299/0211.Design-Add-and-Search-Words-Data-Structure.md" >}})|Medium| O(n)| O(n)|❤️|40.3%| diff --git a/website/content/ChapterTwo/Binary_Search.md b/website/content/ChapterTwo/Binary_Search.md index 3caeba06..05c218bd 100644 --- a/website/content/ChapterTwo/Binary_Search.md +++ b/website/content/ChapterTwo/Binary_Search.md @@ -145,13 +145,13 @@ func peakIndexInMountainArray(A []int) int { |0162|Find Peak Element|[Go]({{< relref "/ChapterFour/0100~0199/0162.Find-Peak-Element.md" >}})|Medium||||44.0%| |0167|Two Sum II - Input array is sorted|[Go]({{< relref "/ChapterFour/0100~0199/0167.Two-Sum-II-Input-array-is-sorted.md" >}})|Easy| O(n)| O(1)||55.7%| |0174|Dungeon Game|[Go]({{< relref "/ChapterFour/0100~0199/0174.Dungeon-Game.md" >}})|Hard||||33.3%| -|0209|Minimum Size Subarray Sum|[Go]({{< relref "/ChapterFour/0200~0299/0209.Minimum-Size-Subarray-Sum.md" >}})|Medium| O(n)| O(1)||39.5%| +|0209|Minimum Size Subarray Sum|[Go]({{< relref "/ChapterFour/0200~0299/0209.Minimum-Size-Subarray-Sum.md" >}})|Medium| O(n)| O(1)||39.6%| |0222|Count Complete Tree Nodes|[Go]({{< relref "/ChapterFour/0200~0299/0222.Count-Complete-Tree-Nodes.md" >}})|Medium| O(n)| O(1)||49.4%| |0230|Kth Smallest Element in a BST|[Go]({{< relref "/ChapterFour/0200~0299/0230.Kth-Smallest-Element-in-a-BST.md" >}})|Medium| O(n)| O(1)||62.7%| |0240|Search a 2D Matrix II|[Go]({{< relref "/ChapterFour/0200~0299/0240.Search-a-2D-Matrix-II.md" >}})|Medium||||45.2%| |0275|H-Index II|[Go]({{< relref "/ChapterFour/0200~0299/0275.H-Index-II.md" >}})|Medium||||36.3%| |0287|Find the Duplicate Number|[Go]({{< relref "/ChapterFour/0200~0299/0287.Find-the-Duplicate-Number.md" >}})|Medium| O(n)| O(1)|❤️|57.6%| -|0300|Longest Increasing Subsequence|[Go]({{< relref "/ChapterFour/0300~0399/0300.Longest-Increasing-Subsequence.md" >}})|Medium| O(n log n)| O(n)||44.1%| +|0300|Longest Increasing Subsequence|[Go]({{< relref "/ChapterFour/0300~0399/0300.Longest-Increasing-Subsequence.md" >}})|Medium| O(n log n)| O(n)||44.2%| |0315|Count of Smaller Numbers After Self|[Go]({{< relref "/ChapterFour/0300~0399/0315.Count-of-Smaller-Numbers-After-Self.md" >}})|Hard||||42.5%| |0327|Count of Range Sum|[Go]({{< relref "/ChapterFour/0300~0399/0327.Count-of-Range-Sum.md" >}})|Hard||||36.1%| |0349|Intersection of Two Arrays|[Go]({{< relref "/ChapterFour/0300~0399/0349.Intersection-of-Two-Arrays.md" >}})|Easy| O(n)| O(n) ||64.9%| @@ -165,10 +165,10 @@ func peakIndexInMountainArray(A []int) int { |0441|Arranging Coins|[Go]({{< relref "/ChapterFour/0400~0499/0441.Arranging-Coins.md" >}})|Easy||||42.4%| |0454|4Sum II|[Go]({{< relref "/ChapterFour/0400~0499/0454.4Sum-II.md" >}})|Medium| O(n^2)| O(n) ||54.6%| |0475|Heaters|[Go]({{< relref "/ChapterFour/0400~0499/0475.Heaters.md" >}})|Medium||||33.7%| -|0483|Smallest Good Base|[Go]({{< relref "/ChapterFour/0400~0499/0483.Smallest-Good-Base.md" >}})|Hard||||36.3%| +|0483|Smallest Good Base|[Go]({{< relref "/ChapterFour/0400~0499/0483.Smallest-Good-Base.md" >}})|Hard||||36.4%| |0493|Reverse Pairs|[Go]({{< relref "/ChapterFour/0400~0499/0493.Reverse-Pairs.md" >}})|Hard||||26.9%| |0497|Random Point in Non-overlapping Rectangles|[Go]({{< relref "/ChapterFour/0400~0499/0497.Random-Point-in-Non-overlapping-Rectangles.md" >}})|Medium||||39.1%| -|0528|Random Pick with Weight|[Go]({{< relref "/ChapterFour/0500~0599/0528.Random-Pick-with-Weight.md" >}})|Medium||||44.6%| +|0528|Random Pick with Weight|[Go]({{< relref "/ChapterFour/0500~0599/0528.Random-Pick-with-Weight.md" >}})|Medium||||44.7%| |0658|Find K Closest Elements|[Go]({{< relref "/ChapterFour/0600~0699/0658.Find-K-Closest-Elements.md" >}})|Medium||||42.0%| |0668|Kth Smallest Number in Multiplication Table|[Go]({{< relref "/ChapterFour/0600~0699/0668.Kth-Smallest-Number-in-Multiplication-Table.md" >}})|Hard||||47.8%| |0704|Binary Search|[Go]({{< relref "/ChapterFour/0700~0799/0704.Binary-Search.md" >}})|Easy||||54.1%| @@ -186,8 +186,8 @@ func peakIndexInMountainArray(A []int) int { |0887|Super Egg Drop|[Go]({{< relref "/ChapterFour/0800~0899/0887.Super-Egg-Drop.md" >}})|Hard||||27.0%| |0911|Online Election|[Go]({{< relref "/ChapterFour/0900~0999/0911.Online-Election.md" >}})|Medium||||51.4%| |0927|Three Equal Parts|[Go]({{< relref "/ChapterFour/0900~0999/0927.Three-Equal-Parts.md" >}})|Hard||||34.6%| -|0981|Time Based Key-Value Store|[Go]({{< relref "/ChapterFour/0900~0999/0981.Time-Based-Key-Value-Store.md" >}})|Medium||||54.2%| -|1011|Capacity To Ship Packages Within D Days|[Go]({{< relref "/ChapterFour/1000~1099/1011.Capacity-To-Ship-Packages-Within-D-Days.md" >}})|Medium||||59.7%| +|0981|Time Based Key-Value Store|[Go]({{< relref "/ChapterFour/0900~0999/0981.Time-Based-Key-Value-Store.md" >}})|Medium||||54.1%| +|1011|Capacity To Ship Packages Within D Days|[Go]({{< relref "/ChapterFour/1000~1099/1011.Capacity-To-Ship-Packages-Within-D-Days.md" >}})|Medium||||59.8%| |1111|Maximum Nesting Depth of Two Valid Parentheses Strings|[Go]({{< relref "/ChapterFour/1100~1199/1111.Maximum-Nesting-Depth-of-Two-Valid-Parentheses-Strings.md" >}})|Medium||||72.6%| |1157|Online Majority Element In Subarray|[Go]({{< relref "/ChapterFour/1100~1199/1157.Online-Majority-Element-In-Subarray.md" >}})|Hard||||39.7%| |1170|Compare Strings by Frequency of the Smallest Character|[Go]({{< relref "/ChapterFour/1100~1199/1170.Compare-Strings-by-Frequency-of-the-Smallest-Character.md" >}})|Medium||||59.8%| diff --git a/website/content/ChapterTwo/Depth_First_Search.md b/website/content/ChapterTwo/Depth_First_Search.md index 80bf681f..0a7bd387 100644 --- a/website/content/ChapterTwo/Depth_First_Search.md +++ b/website/content/ChapterTwo/Depth_First_Search.md @@ -17,7 +17,7 @@ weight: 9 |0104|Maximum Depth of Binary Tree|[Go]({{< relref "/ChapterFour/0100~0199/0104.Maximum-Depth-of-Binary-Tree.md" >}})|Easy| O(n)| O(1)||68.1%| |0105|Construct Binary Tree from Preorder and Inorder Traversal|[Go]({{< relref "/ChapterFour/0100~0199/0105.Construct-Binary-Tree-from-Preorder-and-Inorder-Traversal.md" >}})|Medium||||52.0%| |0106|Construct Binary Tree from Inorder and Postorder Traversal|[Go]({{< relref "/ChapterFour/0100~0199/0106.Construct-Binary-Tree-from-Inorder-and-Postorder-Traversal.md" >}})|Medium||||49.8%| -|0108|Convert Sorted Array to Binary Search Tree|[Go]({{< relref "/ChapterFour/0100~0199/0108.Convert-Sorted-Array-to-Binary-Search-Tree.md" >}})|Easy| O(n)| O(1)||60.5%| +|0108|Convert Sorted Array to Binary Search Tree|[Go]({{< relref "/ChapterFour/0100~0199/0108.Convert-Sorted-Array-to-Binary-Search-Tree.md" >}})|Easy| O(n)| O(1)||60.6%| |0109|Convert Sorted List to Binary Search Tree|[Go]({{< relref "/ChapterFour/0100~0199/0109.Convert-Sorted-List-to-Binary-Search-Tree.md" >}})|Medium| O(log n)| O(n)||50.3%| |0110|Balanced Binary Tree|[Go]({{< relref "/ChapterFour/0100~0199/0110.Balanced-Binary-Tree.md" >}})|Easy| O(n)| O(1)||44.7%| |0111|Minimum Depth of Binary Tree|[Go]({{< relref "/ChapterFour/0100~0199/0111.Minimum-Depth-of-Binary-Tree.md" >}})|Easy| O(n)| O(1)||39.6%| @@ -46,7 +46,7 @@ weight: 9 |0538|Convert BST to Greater Tree|[Go]({{< relref "/ChapterFour/0500~0599/0538.Convert-BST-to-Greater-Tree.md" >}})|Medium||||59.5%| |0542|01 Matrix|[Go]({{< relref "/ChapterFour/0500~0599/0542.01-Matrix.md" >}})|Medium| O(n)| O(1)||41.0%| |0547|Number of Provinces|[Go]({{< relref "/ChapterFour/0500~0599/0547.Number-of-Provinces.md" >}})|Medium||||60.5%| -|0563|Binary Tree Tilt|[Go]({{< relref "/ChapterFour/0500~0599/0563.Binary-Tree-Tilt.md" >}})|Easy||||53.1%| +|0563|Binary Tree Tilt|[Go]({{< relref "/ChapterFour/0500~0599/0563.Binary-Tree-Tilt.md" >}})|Easy||||53.0%| |0638|Shopping Offers|[Go]({{< relref "/ChapterFour/0600~0699/0638.Shopping-Offers.md" >}})|Medium||||52.9%| |0685|Redundant Connection II|[Go]({{< relref "/ChapterFour/0600~0699/0685.Redundant-Connection-II.md" >}})|Hard||||33.0%| |0695|Max Area of Island|[Go]({{< relref "/ChapterFour/0600~0699/0695.Max-Area-of-Island.md" >}})|Medium||||64.9%| @@ -56,7 +56,7 @@ weight: 9 |0756|Pyramid Transition Matrix|[Go]({{< relref "/ChapterFour/0700~0799/0756.Pyramid-Transition-Matrix.md" >}})|Medium||||55.6%| |0778|Swim in Rising Water|[Go]({{< relref "/ChapterFour/0700~0799/0778.Swim-in-Rising-Water.md" >}})|Hard||||54.7%| |0785|Is Graph Bipartite?|[Go]({{< relref "/ChapterFour/0700~0799/0785.Is-Graph-Bipartite.md" >}})|Medium||||48.6%| -|0802|Find Eventual Safe States|[Go]({{< relref "/ChapterFour/0800~0899/0802.Find-Eventual-Safe-States.md" >}})|Medium||||49.8%| +|0802|Find Eventual Safe States|[Go]({{< relref "/ChapterFour/0800~0899/0802.Find-Eventual-Safe-States.md" >}})|Medium||||49.9%| |0834|Sum of Distances in Tree|[Go]({{< relref "/ChapterFour/0800~0899/0834.Sum-of-Distances-in-Tree.md" >}})|Hard||||46.2%| |0839|Similar String Groups|[Go]({{< relref "/ChapterFour/0800~0899/0839.Similar-String-Groups.md" >}})|Hard||||41.0%| |0841|Keys and Rooms|[Go]({{< relref "/ChapterFour/0800~0899/0841.Keys-and-Rooms.md" >}})|Medium||||65.4%| diff --git a/website/content/ChapterTwo/Dynamic_Programming.md b/website/content/ChapterTwo/Dynamic_Programming.md index 794e361a..e161b46f 100644 --- a/website/content/ChapterTwo/Dynamic_Programming.md +++ b/website/content/ChapterTwo/Dynamic_Programming.md @@ -16,7 +16,7 @@ weight: 7 |0063|Unique Paths II|[Go]({{< relref "/ChapterFour/0001~0099/0063.Unique-Paths-II.md" >}})|Medium| O(n^2)| O(n^2)||35.3%| |0064|Minimum Path Sum|[Go]({{< relref "/ChapterFour/0001~0099/0064.Minimum-Path-Sum.md" >}})|Medium| O(n^2)| O(n^2)||56.3%| |0070|Climbing Stairs|[Go]({{< relref "/ChapterFour/0001~0099/0070.Climbing-Stairs.md" >}})|Easy| O(n)| O(n)||48.7%| -|0091|Decode Ways|[Go]({{< relref "/ChapterFour/0001~0099/0091.Decode-Ways.md" >}})|Medium| O(n)| O(n)||26.6%| +|0091|Decode Ways|[Go]({{< relref "/ChapterFour/0001~0099/0091.Decode-Ways.md" >}})|Medium| O(n)| O(n)||26.7%| |0095|Unique Binary Search Trees II|[Go]({{< relref "/ChapterFour/0001~0099/0095.Unique-Binary-Search-Trees-II.md" >}})|Medium||||42.7%| |0096|Unique Binary Search Trees|[Go]({{< relref "/ChapterFour/0001~0099/0096.Unique-Binary-Search-Trees.md" >}})|Medium| O(n)| O(n)||54.5%| |0120|Triangle|[Go]({{< relref "/ChapterFour/0100~0199/0120.Triangle.md" >}})|Medium| O(n^2)| O(n)||45.9%| @@ -26,7 +26,7 @@ weight: 7 |0174|Dungeon Game|[Go]({{< relref "/ChapterFour/0100~0199/0174.Dungeon-Game.md" >}})|Hard||||33.3%| |0198|House Robber|[Go]({{< relref "/ChapterFour/0100~0199/0198.House-Robber.md" >}})|Medium| O(n)| O(n)||42.9%| |0213|House Robber II|[Go]({{< relref "/ChapterFour/0200~0299/0213.House-Robber-II.md" >}})|Medium| O(n)| O(n)||37.6%| -|0300|Longest Increasing Subsequence|[Go]({{< relref "/ChapterFour/0300~0399/0300.Longest-Increasing-Subsequence.md" >}})|Medium| O(n log n)| O(n)||44.1%| +|0300|Longest Increasing Subsequence|[Go]({{< relref "/ChapterFour/0300~0399/0300.Longest-Increasing-Subsequence.md" >}})|Medium| O(n log n)| O(n)||44.2%| |0303|Range Sum Query - Immutable|[Go]({{< relref "/ChapterFour/0300~0399/0303.Range-Sum-Query-Immutable.md" >}})|Easy||||47.8%| |0304|Range Sum Query 2D - Immutable|[Go]({{< relref "/ChapterFour/0300~0399/0304.Range-Sum-Query-2D-Immutable.md" >}})|Medium||||40.6%| |0309|Best Time to Buy and Sell Stock with Cooldown|[Go]({{< relref "/ChapterFour/0300~0399/0309.Best-Time-to-Buy-and-Sell-Stock-with-Cooldown.md" >}})|Medium| O(n)| O(n)||48.2%| @@ -43,7 +43,7 @@ weight: 7 |0474|Ones and Zeroes|[Go]({{< relref "/ChapterFour/0400~0499/0474.Ones-and-Zeroes.md" >}})|Medium||||43.7%| |0494|Target Sum|[Go]({{< relref "/ChapterFour/0400~0499/0494.Target-Sum.md" >}})|Medium||||45.7%| |0638|Shopping Offers|[Go]({{< relref "/ChapterFour/0600~0699/0638.Shopping-Offers.md" >}})|Medium||||52.9%| -|0714|Best Time to Buy and Sell Stock with Transaction Fee|[Go]({{< relref "/ChapterFour/0700~0799/0714.Best-Time-to-Buy-and-Sell-Stock-with-Transaction-Fee.md" >}})|Medium| O(n)| O(1)||56.1%| +|0714|Best Time to Buy and Sell Stock with Transaction Fee|[Go]({{< relref "/ChapterFour/0700~0799/0714.Best-Time-to-Buy-and-Sell-Stock-with-Transaction-Fee.md" >}})|Medium| O(n)| O(1)||56.2%| |0718|Maximum Length of Repeated Subarray|[Go]({{< relref "/ChapterFour/0700~0799/0718.Maximum-Length-of-Repeated-Subarray.md" >}})|Medium||||50.4%| |0746|Min Cost Climbing Stairs|[Go]({{< relref "/ChapterFour/0700~0799/0746.Min-Cost-Climbing-Stairs.md" >}})|Easy| O(n)| O(1)||50.9%| |0838|Push Dominoes|[Go]({{< relref "/ChapterFour/0800~0899/0838.Push-Dominoes.md" >}})|Medium| O(n)| O(n)||49.9%| diff --git a/website/content/ChapterTwo/Hash_Table.md b/website/content/ChapterTwo/Hash_Table.md index 19a2a2ac..b5133123 100644 --- a/website/content/ChapterTwo/Hash_Table.md +++ b/website/content/ChapterTwo/Hash_Table.md @@ -46,7 +46,7 @@ weight: 13 |0594|Longest Harmonious Subsequence|[Go]({{< relref "/ChapterFour/0500~0599/0594.Longest-Harmonious-Subsequence.md" >}})|Easy||||51.2%| |0599|Minimum Index Sum of Two Lists|[Go]({{< relref "/ChapterFour/0500~0599/0599.Minimum-Index-Sum-of-Two-Lists.md" >}})|Easy||||51.8%| |0632|Smallest Range Covering Elements from K Lists|[Go]({{< relref "/ChapterFour/0600~0699/0632.Smallest-Range-Covering-Elements-from-K-Lists.md" >}})|Hard||||54.3%| -|0645|Set Mismatch|[Go]({{< relref "/ChapterFour/0600~0699/0645.Set-Mismatch.md" >}})|Easy||||42.1%| +|0645|Set Mismatch|[Go]({{< relref "/ChapterFour/0600~0699/0645.Set-Mismatch.md" >}})|Easy||||42.0%| |0648|Replace Words|[Go]({{< relref "/ChapterFour/0600~0699/0648.Replace-Words.md" >}})|Medium| O(n)| O(n) ||58.7%| |0676|Implement Magic Dictionary|[Go]({{< relref "/ChapterFour/0600~0699/0676.Implement-Magic-Dictionary.md" >}})|Medium| O(n)| O(n) ||55.3%| |0705|Design HashSet|[Go]({{< relref "/ChapterFour/0700~0799/0705.Design-HashSet.md" >}})|Easy||||64.6%| @@ -66,20 +66,20 @@ weight: 13 |0953|Verifying an Alien Dictionary|[Go]({{< relref "/ChapterFour/0900~0999/0953.Verifying-an-Alien-Dictionary.md" >}})|Easy||||52.0%| |0961|N-Repeated Element in Size 2N Array|[Go]({{< relref "/ChapterFour/0900~0999/0961.N-Repeated-Element-in-Size-2N-Array.md" >}})|Easy||||74.5%| |0970|Powerful Integers|[Go]({{< relref "/ChapterFour/0900~0999/0970.Powerful-Integers.md" >}})|Medium||||40.0%| -|0981|Time Based Key-Value Store|[Go]({{< relref "/ChapterFour/0900~0999/0981.Time-Based-Key-Value-Store.md" >}})|Medium||||54.2%| +|0981|Time Based Key-Value Store|[Go]({{< relref "/ChapterFour/0900~0999/0981.Time-Based-Key-Value-Store.md" >}})|Medium||||54.1%| |0987|Vertical Order Traversal of a Binary Tree|[Go]({{< relref "/ChapterFour/0900~0999/0987.Vertical-Order-Traversal-of-a-Binary-Tree.md" >}})|Hard||||38.9%| |0992|Subarrays with K Different Integers|[Go]({{< relref "/ChapterFour/0900~0999/0992.Subarrays-with-K-Different-Integers.md" >}})|Hard| O(n)| O(n) |❤️|50.7%| |1002|Find Common Characters|[Go]({{< relref "/ChapterFour/1000~1099/1002.Find-Common-Characters.md" >}})|Easy||||68.6%| |1078|Occurrences After Bigram|[Go]({{< relref "/ChapterFour/1000~1099/1078.Occurrences-After-Bigram.md" >}})|Easy||||64.9%| |1160|Find Words That Can Be Formed by Characters|[Go]({{< relref "/ChapterFour/1100~1199/1160.Find-Words-That-Can-Be-Formed-by-Characters.md" >}})|Easy||||67.9%| |1178|Number of Valid Words for Each Puzzle|[Go]({{< relref "/ChapterFour/1100~1199/1178.Number-of-Valid-Words-for-Each-Puzzle.md" >}})|Hard||||39.3%| -|1189|Maximum Number of Balloons|[Go]({{< relref "/ChapterFour/1100~1199/1189.Maximum-Number-of-Balloons.md" >}})|Easy||||61.8%| +|1189|Maximum Number of Balloons|[Go]({{< relref "/ChapterFour/1100~1199/1189.Maximum-Number-of-Balloons.md" >}})|Easy||||61.9%| |1207|Unique Number of Occurrences|[Go]({{< relref "/ChapterFour/1200~1299/1207.Unique-Number-of-Occurrences.md" >}})|Easy||||71.8%| |1512|Number of Good Pairs|[Go]({{< relref "/ChapterFour/1500~1599/1512.Number-of-Good-Pairs.md" >}})|Easy||||87.7%| |1539|Kth Missing Positive Number|[Go]({{< relref "/ChapterFour/1500~1599/1539.Kth-Missing-Positive-Number.md" >}})|Easy||||55.0%| |1640|Check Array Formation Through Concatenation|[Go]({{< relref "/ChapterFour/1600~1699/1640.Check-Array-Formation-Through-Concatenation.md" >}})|Easy||||60.0%| |1679|Max Number of K-Sum Pairs|[Go]({{< relref "/ChapterFour/1600~1699/1679.Max-Number-of-K-Sum-Pairs.md" >}})|Medium||||54.0%| -|1748|Sum of Unique Elements|[Go]({{< relref "/ChapterFour/1700~1799/1748.Sum-of-Unique-Elements.md" >}})|Easy||||75.6%| +|1748|Sum of Unique Elements|[Go]({{< relref "/ChapterFour/1700~1799/1748.Sum-of-Unique-Elements.md" >}})|Easy||||75.5%| |------------|-------------------------------------------------------|-------| ----------------| ---------------|-------------|-------------|-------------| diff --git a/website/content/ChapterTwo/Linked_List.md b/website/content/ChapterTwo/Linked_List.md index d06f2d12..f245b3ac 100644 --- a/website/content/ChapterTwo/Linked_List.md +++ b/website/content/ChapterTwo/Linked_List.md @@ -47,7 +47,7 @@ weight: 4 |0234|Palindrome Linked List|[Go]({{< relref "/ChapterFour/0200~0299/0234.Palindrome-Linked-List.md" >}})|Easy| O(n)| O(1)||40.6%| |0237|Delete Node in a Linked List|[Go]({{< relref "/ChapterFour/0200~0299/0237.Delete-Node-in-a-Linked-List.md" >}})|Easy| O(n)| O(1)||67.0%| |0328|Odd Even Linked List|[Go]({{< relref "/ChapterFour/0300~0399/0328.Odd-Even-Linked-List.md" >}})|Medium| O(n)| O(1)||57.1%| -|0445|Add Two Numbers II|[Go]({{< relref "/ChapterFour/0400~0499/0445.Add-Two-Numbers-II.md" >}})|Medium| O(n)| O(n)||56.3%| +|0445|Add Two Numbers II|[Go]({{< relref "/ChapterFour/0400~0499/0445.Add-Two-Numbers-II.md" >}})|Medium| O(n)| O(n)||56.4%| |0707|Design Linked List|[Go]({{< relref "/ChapterFour/0700~0799/0707.Design-Linked-List.md" >}})|Medium| O(n)| O(1)||25.9%| |0725|Split Linked List in Parts|[Go]({{< relref "/ChapterFour/0700~0799/0725.Split-Linked-List-in-Parts.md" >}})|Medium| O(n)| O(1)||53.0%| |0817|Linked List Components|[Go]({{< relref "/ChapterFour/0800~0899/0817.Linked-List-Components.md" >}})|Medium| O(n)| O(1)||57.8%| diff --git a/website/content/ChapterTwo/Math.md b/website/content/ChapterTwo/Math.md index 6c7e5623..829e645b 100644 --- a/website/content/ChapterTwo/Math.md +++ b/website/content/ChapterTwo/Math.md @@ -11,7 +11,9 @@ weight: 12 |:--------:|:------- | :--------: | :----------: | :----: | :-----: | :-----: |:-----: | |0002|Add Two Numbers|[Go]({{< relref "/ChapterFour/0001~0099/0002.Add-Two-Numbers.md" >}})|Medium| O(n)| O(1)||35.5%| |0007|Reverse Integer|[Go]({{< relref "/ChapterFour/0001~0099/0007.Reverse-Integer.md" >}})|Easy||||25.9%| +|0008|String to Integer (atoi)|[Go]({{< relref "/ChapterFour/0001~0099/0008.String-to-Integer-atoi.md" >}})|Medium||||15.7%| |0009|Palindrome Number|[Go]({{< relref "/ChapterFour/0001~0099/0009.Palindrome-Number.md" >}})|Easy||||49.8%| +|0012|Integer to Roman|[Go]({{< relref "/ChapterFour/0001~0099/0012.Integer-to-Roman.md" >}})|Medium||||56.6%| |0013|Roman to Integer|[Go]({{< relref "/ChapterFour/0001~0099/0013.Roman-to-Integer.md" >}})|Easy||||56.9%| |0029|Divide Two Integers|[Go]({{< relref "/ChapterFour/0001~0099/0029.Divide-Two-Integers.md" >}})|Medium||||16.9%| |0050|Pow(x, n)|[Go]({{< relref "/ChapterFour/0001~0099/0050.Powx-n.md" >}})|Medium| O(log n)| O(1)||31.0%| @@ -23,7 +25,7 @@ weight: 12 |0172|Factorial Trailing Zeroes|[Go]({{< relref "/ChapterFour/0100~0199/0172.Factorial-Trailing-Zeroes.md" >}})|Easy||||38.6%| |0202|Happy Number|[Go]({{< relref "/ChapterFour/0200~0299/0202.Happy-Number.md" >}})|Easy| O(log n)| O(1)||51.3%| |0204|Count Primes|[Go]({{< relref "/ChapterFour/0200~0299/0204.Count-Primes.md" >}})|Easy||||32.3%| -|0223|Rectangle Area|[Go]({{< relref "/ChapterFour/0200~0299/0223.Rectangle-Area.md" >}})|Medium||||38.2%| +|0223|Rectangle Area|[Go]({{< relref "/ChapterFour/0200~0299/0223.Rectangle-Area.md" >}})|Medium||||38.3%| |0224|Basic Calculator|[Go]({{< relref "/ChapterFour/0200~0299/0224.Basic-Calculator.md" >}})|Hard| O(n)| O(n)||38.2%| |0231|Power of Two|[Go]({{< relref "/ChapterFour/0200~0299/0231.Power-of-Two.md" >}})|Easy| O(1)| O(1)||43.8%| |0258|Add Digits|[Go]({{< relref "/ChapterFour/0200~0299/0258.Add-Digits.md" >}})|Easy||||58.5%| @@ -39,19 +41,19 @@ weight: 12 |0441|Arranging Coins|[Go]({{< relref "/ChapterFour/0400~0499/0441.Arranging-Coins.md" >}})|Easy||||42.4%| |0447|Number of Boomerangs|[Go]({{< relref "/ChapterFour/0400~0499/0447.Number-of-Boomerangs.md" >}})|Medium||||52.5%| |0453|Minimum Moves to Equal Array Elements|[Go]({{< relref "/ChapterFour/0400~0499/0453.Minimum-Moves-to-Equal-Array-Elements.md" >}})|Easy||||50.8%| -|0483|Smallest Good Base|[Go]({{< relref "/ChapterFour/0400~0499/0483.Smallest-Good-Base.md" >}})|Hard||||36.3%| +|0483|Smallest Good Base|[Go]({{< relref "/ChapterFour/0400~0499/0483.Smallest-Good-Base.md" >}})|Hard||||36.4%| |0507|Perfect Number|[Go]({{< relref "/ChapterFour/0500~0599/0507.Perfect-Number.md" >}})|Easy||||36.2%| |0537|Complex Number Multiplication|[Go]({{< relref "/ChapterFour/0500~0599/0537.Complex-Number-Multiplication.md" >}})|Medium||||68.3%| |0598|Range Addition II|[Go]({{< relref "/ChapterFour/0500~0599/0598.Range-Addition-II.md" >}})|Easy||||50.1%| |0628|Maximum Product of Three Numbers|[Go]({{< relref "/ChapterFour/0600~0699/0628.Maximum-Product-of-Three-Numbers.md" >}})|Easy| O(n)| O(1)||46.9%| |0633|Sum of Square Numbers|[Go]({{< relref "/ChapterFour/0600~0699/0633.Sum-of-Square-Numbers.md" >}})|Medium||||32.6%| -|0645|Set Mismatch|[Go]({{< relref "/ChapterFour/0600~0699/0645.Set-Mismatch.md" >}})|Easy||||42.1%| +|0645|Set Mismatch|[Go]({{< relref "/ChapterFour/0600~0699/0645.Set-Mismatch.md" >}})|Easy||||42.0%| |0753|Cracking the Safe|[Go]({{< relref "/ChapterFour/0700~0799/0753.Cracking-the-Safe.md" >}})|Hard||||52.4%| |0781|Rabbits in Forest|[Go]({{< relref "/ChapterFour/0700~0799/0781.Rabbits-in-Forest.md" >}})|Medium||||55.6%| |0812|Largest Triangle Area|[Go]({{< relref "/ChapterFour/0800~0899/0812.Largest-Triangle-Area.md" >}})|Easy||||59.0%| |0836|Rectangle Overlap|[Go]({{< relref "/ChapterFour/0800~0899/0836.Rectangle-Overlap.md" >}})|Easy||||44.2%| |0878|Nth Magical Number|[Go]({{< relref "/ChapterFour/0800~0899/0878.Nth-Magical-Number.md" >}})|Hard||||28.8%| -|0885|Spiral Matrix III|[Go]({{< relref "/ChapterFour/0800~0899/0885.Spiral-Matrix-III.md" >}})|Medium| O(n^2)| O(1)||70.8%| +|0885|Spiral Matrix III|[Go]({{< relref "/ChapterFour/0800~0899/0885.Spiral-Matrix-III.md" >}})|Medium| O(n^2)| O(1)||70.9%| |0887|Super Egg Drop|[Go]({{< relref "/ChapterFour/0800~0899/0887.Super-Egg-Drop.md" >}})|Hard||||27.0%| |0891|Sum of Subsequence Widths|[Go]({{< relref "/ChapterFour/0800~0899/0891.Sum-of-Subsequence-Widths.md" >}})|Hard| O(n log n)| O(1)||33.1%| |0892|Surface Area of 3D Shapes|[Go]({{< relref "/ChapterFour/0800~0899/0892.Surface-Area-of-3D-Shapes.md" >}})|Easy||||59.8%| @@ -76,17 +78,16 @@ weight: 12 |1217|Minimum Cost to Move Chips to The Same Position|[Go]({{< relref "/ChapterFour/1200~1299/1217.Minimum-Cost-to-Move-Chips-to-The-Same-Position.md" >}})|Easy||||71.1%| |1232|Check If It Is a Straight Line|[Go]({{< relref "/ChapterFour/1200~1299/1232.Check-If-It-Is-a-Straight-Line.md" >}})|Easy||||43.5%| |1281|Subtract the Product and Sum of Digits of an Integer|[Go]({{< relref "/ChapterFour/1200~1299/1281.Subtract-the-Product-and-Sum-of-Digits-of-an-Integer.md" >}})|Easy||||85.6%| -|1317|Convert Integer to the Sum of Two No-Zero Integers|[Go]({{< relref "/ChapterFour/1300~1399/1317.Convert-Integer-to-the-Sum-of-Two-No-Zero-Integers.md" >}})|Easy||||56.8%| +|1317|Convert Integer to the Sum of Two No-Zero Integers|[Go]({{< relref "/ChapterFour/1300~1399/1317.Convert-Integer-to-the-Sum-of-Two-No-Zero-Integers.md" >}})|Easy||||56.7%| |1512|Number of Good Pairs|[Go]({{< relref "/ChapterFour/1500~1599/1512.Number-of-Good-Pairs.md" >}})|Easy||||87.7%| |1641|Count Sorted Vowel Strings|[Go]({{< relref "/ChapterFour/1600~1699/1641.Count-Sorted-Vowel-Strings.md" >}})|Medium||||76.3%| -|1648|Sell Diminishing-Valued Colored Balls|[Go]({{< relref "/ChapterFour/1600~1699/1648.Sell-Diminishing-Valued-Colored-Balls.md" >}})|Medium||||30.5%| +|1648|Sell Diminishing-Valued Colored Balls|[Go]({{< relref "/ChapterFour/1600~1699/1648.Sell-Diminishing-Valued-Colored-Balls.md" >}})|Medium||||30.6%| |1680|Concatenation of Consecutive Binary Numbers|[Go]({{< relref "/ChapterFour/1600~1699/1680.Concatenation-of-Consecutive-Binary-Numbers.md" >}})|Medium||||52.3%| |1685|Sum of Absolute Differences in a Sorted Array|[Go]({{< relref "/ChapterFour/1600~1699/1685.Sum-of-Absolute-Differences-in-a-Sorted-Array.md" >}})|Medium||||62.8%| |1716|Calculate Money in Leetcode Bank|[Go]({{< relref "/ChapterFour/1700~1799/1716.Calculate-Money-in-Leetcode-Bank.md" >}})|Easy||||66.5%| |------------|-------------------------------------------------------|-------| ----------------| ---------------|-------------|-------------|-------------| - ----------------------------------------------