diff --git a/README.md b/README.md index e56c283f..36a514b6 100755 --- a/README.md +++ b/README.md @@ -126,21 +126,21 @@ | | Easy | Medium | Hard | Total | |:--------:|:--------:|:--------:|:--------:|:--------:| |Optimizing|36|43|16|95| -|Accepted|**272**|**339**|**103**|**714**| +|Accepted|**272**|**340**|**103**|**715**| |Total|466|942|379|1787| -|Perfection Rate|86.8%|87.3%|84.5%|86.7%| -|Completion Rate|58.4%|36.0%|27.2%|40.0%| +|Perfection Rate|86.8%|87.4%|84.5%|86.7%| +|Completion Rate|58.4%|36.1%|27.2%|40.0%| |------------|----------------------------|----------------------------|----------------------------|----------------------------| ## 二. 目录 -以下已经收录了 619 道题的题解,还有 12 道题在尝试优化到 beats 100% +以下已经收录了 620 道题的题解,还有 12 道题在尝试优化到 beats 100% | No. | Title | Solution | Acceptance | Difficulty | Frequency | |:--------:|:--------------------------------------------------------------|:--------:|:--------:|:--------:|:--------:| |0001|Two Sum|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0001.Two-Sum)|46.5%|Easy|| |0002|Add Two Numbers|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0002.Add-Two-Numbers)|35.5%|Medium|| -|0003|Longest Substring Without Repeating Characters|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0003.Longest-Substring-Without-Repeating-Characters)|31.4%|Medium|| +|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|| @@ -173,8 +173,8 @@ |0033|Search in Rotated Sorted Array|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0033.Search-in-Rotated-Sorted-Array)|35.9%|Medium|| |0034|Find First and Last Position of Element in Sorted Array|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0034.Find-First-and-Last-Position-of-Element-in-Sorted-Array)|37.3%|Medium|| |0035|Search Insert Position|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0035.Search-Insert-Position)|42.8%|Easy|| -|0036|Valid Sudoku|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0036.Valid-Sudoku)|50.6%|Medium|| -|0037|Sudoku Solver|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0037.Sudoku-Solver)|46.6%|Hard|| +|0036|Valid Sudoku|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0036.Valid-Sudoku)|50.7%|Medium|| +|0037|Sudoku Solver|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0037.Sudoku-Solver)|46.7%|Hard|| |0038|Count and Say||46.1%|Medium|| |0039|Combination Sum|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0039.Combination-Sum)|59.4%|Medium|| |0040|Combination Sum II|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0040.Combination-Sum-II)|50.2%|Medium|| @@ -188,7 +188,7 @@ |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.7%|Hard|| +|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|| |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|| @@ -270,7 +270,7 @@ |0130|Surrounded Regions|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0130.Surrounded-Regions)|29.5%|Medium|| |0131|Palindrome Partitioning|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0131.Palindrome-Partitioning)|52.2%|Medium|| |0132|Palindrome Partitioning II||31.3%|Hard|| -|0133|Clone Graph||39.3%|Medium|| +|0133|Clone Graph||39.4%|Medium|| |0134|Gas Station||41.3%|Medium|| |0135|Candy||33.1%|Hard|| |0136|Single Number|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0136.Single-Number)|66.6%|Easy|| @@ -284,7 +284,7 @@ |0144|Binary Tree Preorder Traversal|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0144.Binary-Tree-Preorder-Traversal)|57.6%|Medium|| |0145|Binary Tree Postorder Traversal|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0145.Binary-Tree-Postorder-Traversal)|57.7%|Medium|| |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.4%|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|| |0150|Evaluate Reverse Polish Notation|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0150.Evaluate-Reverse-Polish-Notation)|38.0%|Medium|| @@ -308,9 +308,9 @@ |0168|Excel Sheet Column Title|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0168.Excel-Sheet-Column-Title)|31.8%|Easy|| |0169|Majority Element|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0169.Majority-Element)|60.1%|Easy|| |0170|Two Sum III - Data structure design||34.9%|Easy|| -|0171|Excel Sheet Column Number|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0171.Excel-Sheet-Column-Number)|56.9%|Easy|| +|0171|Excel Sheet Column Number|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0171.Excel-Sheet-Column-Number)|57.0%|Easy|| |0172|Factorial Trailing Zeroes|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0172.Factorial-Trailing-Zeroes)|38.6%|Easy|| -|0173|Binary Search Tree Iterator|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0173.Binary-Search-Tree-Iterator)|60.2%|Medium|| +|0173|Binary Search Tree Iterator|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0173.Binary-Search-Tree-Iterator)|60.3%|Medium|| |0174|Dungeon Game|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0174.Dungeon-Game)|33.3%|Hard|| |0175|Combine Two Tables||64.3%|Easy|| |0176|Second Highest Salary||33.3%|Easy|| @@ -322,12 +322,12 @@ |0182|Duplicate Emails||64.7%|Easy|| |0183|Customers Who Never Order||57.0%|Easy|| |0184|Department Highest Salary||40.3%|Medium|| -|0185|Department Top Three Salaries||39.1%|Hard|| +|0185|Department Top Three Salaries||39.2%|Hard|| |0186|Reverse Words in a String II||45.6%|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.7%|Hard|| +|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|| -|0190|Reverse Bits|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0190.Reverse-Bits)|42.2%|Easy|| +|0190|Reverse Bits|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0190.Reverse-Bits)|42.3%|Easy|| |0191|Number of 1 Bits|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0191.Number-of-1-Bits)|53.9%|Easy|| |0192|Word Frequency||25.6%|Medium|| |0193|Valid Phone Numbers||25.4%|Easy|| @@ -356,13 +356,13 @@ |0216|Combination Sum III|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0216.Combination-Sum-III)|60.4%|Medium|| |0217|Contains Duplicate|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0217.Contains-Duplicate)|56.7%|Easy|| |0218|The Skyline Problem|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0218.The-Skyline-Problem)|36.4%|Hard|| -|0219|Contains Duplicate II|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0219.Contains-Duplicate-II)|38.6%|Easy|| +|0219|Contains Duplicate II|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0219.Contains-Duplicate-II)|38.7%|Easy|| |0220|Contains Duplicate III|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0220.Contains-Duplicate-III)|21.3%|Medium|| |0221|Maximal Square||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|| |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.5%|Easy|| +|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|| |0227|Basic Calculator II||38.6%|Medium|| |0228|Summary Ranges|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0228.Summary-Ranges)|42.5%|Easy|| @@ -383,9 +383,9 @@ |0243|Shortest Word Distance||62.0%|Easy|| |0244|Shortest Word Distance II||54.1%|Medium|| |0245|Shortest Word Distance III||56.0%|Medium|| -|0246|Strobogrammatic Number||46.1%|Easy|| -|0247|Strobogrammatic Number II||48.5%|Medium|| -|0248|Strobogrammatic Number III||40.2%|Hard|| +|0246|Strobogrammatic Number||46.3%|Easy|| +|0247|Strobogrammatic Number II||48.6%|Medium|| +|0248|Strobogrammatic Number III||40.3%|Hard|| |0249|Group Shifted Strings||58.2%|Medium|| |0250|Count Univalue Subtrees||53.4%|Medium|| |0251|Flatten 2D Vector||46.4%|Medium|| @@ -458,19 +458,19 @@ |0318|Maximum Product of Word Lengths|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0318.Maximum-Product-of-Word-Lengths)|52.3%|Medium|| |0319|Bulb Switcher||45.4%|Medium|| |0320|Generalized Abbreviation||53.8%|Medium|| -|0321|Create Maximum Number||27.5%|Hard|| +|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|| |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|| -|0327|Count of Range Sum|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0327.Count-of-Range-Sum)|36.0%|Hard|| +|0327|Count of Range Sum|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0327.Count-of-Range-Sum)|36.1%|Hard|| |0328|Odd Even Linked List|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0328.Odd-Even-Linked-List)|57.1%|Medium|| |0329|Longest Increasing Path in a Matrix|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0329.Longest-Increasing-Path-in-a-Matrix)|45.0%|Hard|| |0330|Patching Array||35.0%|Hard|| |0331|Verify Preorder Serialization of a Binary Tree|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0331.Verify-Preorder-Serialization-of-a-Binary-Tree)|41.0%|Medium|| |0332|Reconstruct Itinerary||37.9%|Medium|| -|0333|Largest BST Subtree||37.9%|Medium|| +|0333|Largest BST Subtree||38.0%|Medium|| |0334|Increasing Triplet Subsequence||40.8%|Medium|| |0335|Self Crossing||28.6%|Hard|| |0336|Palindrome Pairs||34.7%|Hard|| @@ -484,16 +484,16 @@ |0344|Reverse String|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0344.Reverse-String)|70.4%|Easy|| |0345|Reverse Vowels of a String|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0345.Reverse-Vowels-of-a-String)|45.1%|Easy|| |0346|Moving Average from Data Stream||73.3%|Easy|| -|0347|Top K Frequent Elements|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0347.Top-K-Frequent-Elements)|62.4%|Medium|| +|0347|Top K Frequent Elements|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0347.Top-K-Frequent-Elements)|62.5%|Medium|| |0348|Design Tic-Tac-Toe||55.6%|Medium|| |0349|Intersection of Two Arrays|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0349.Intersection-of-Two-Arrays)|64.9%|Easy|| |0350|Intersection of Two Arrays II|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0350.Intersection-of-Two-Arrays-II)|52.0%|Easy|| |0351|Android Unlock Patterns||49.7%|Medium|| |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.3%|Hard|| +|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||32.9%|Medium|| +|0356|Line Reflection||33.0%|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|| @@ -509,8 +509,8 @@ |0369|Plus One Linked List||59.5%|Medium|| |0370|Range Addition||63.6%|Medium|| |0371|Sum of Two Integers|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0371.Sum-of-Two-Integers)|50.6%|Medium|| -|0372|Super Pow|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0372.Super-Pow)|36.7%|Medium|| -|0373|Find K Pairs with Smallest Sums|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0373.Find-K-Pairs-with-Smallest-Sums)|37.7%|Medium|| +|0372|Super Pow|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0372.Super-Pow)|36.8%|Medium|| +|0373|Find K Pairs with Smallest Sums|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0373.Find-K-Pairs-with-Smallest-Sums)|37.8%|Medium|| |0374|Guess Number Higher or Lower||44.7%|Easy|| |0375|Guess Number Higher or Lower II||42.2%|Medium|| |0376|Wiggle Subsequence||40.2%|Medium|| @@ -549,7 +549,7 @@ |0409|Longest Palindrome|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0409.Longest-Palindrome)|52.2%|Easy|| |0410|Split Array Largest Sum|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0410.Split-Array-Largest-Sum)|46.4%|Hard|| |0411|Minimum Unique Word Abbreviation||37.3%|Hard|| -|0412|Fizz Buzz|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0412.Fizz-Buzz)|63.6%|Easy|| +|0412|Fizz Buzz|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0412.Fizz-Buzz)|63.5%|Easy|| |0413|Arithmetic Slices|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0413.Arithmetic-Slices)|59.9%|Medium|| |0414|Third Maximum Number|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0414.Third-Maximum-Number)|30.7%|Easy|| |0415|Add Strings||48.2%|Easy|| @@ -559,15 +559,15 @@ |0419|Battleships in a Board||71.1%|Medium|| |0420|Strong Password Checker||14.0%|Hard|| |0421|Maximum XOR of Two Numbers in an Array|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0421.Maximum-XOR-of-Two-Numbers-in-an-Array)|54.1%|Medium|| -|0422|Valid Word Square||38.1%|Easy|| +|0422|Valid Word Square||38.2%|Easy|| |0423|Reconstruct Original Digits from English||47.5%|Medium|| |0424|Longest Repeating Character Replacement|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0424.Longest-Repeating-Character-Replacement)|48.2%|Medium|| |0425|Word Squares||50.1%|Hard|| |0426|Convert Binary Search Tree to Sorted Doubly Linked List||61.3%|Medium|| |0427|Construct Quad Tree||62.7%|Medium|| -|0428|Serialize and Deserialize N-ary Tree||61.5%|Hard|| +|0428|Serialize and Deserialize N-ary Tree||61.6%|Hard|| |0429|N-ary Tree Level Order Traversal||66.7%|Medium|| -|0430|Flatten a Multilevel Doubly Linked List||56.8%|Medium|| +|0430|Flatten a Multilevel Doubly Linked List||56.9%|Medium|| |0431|Encode N-ary Tree to Binary Tree||74.6%|Hard|| |0432|All O`one Data Structure||33.2%|Hard|| |0433|Minimum Genetic Mutation|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0433.Minimum-Genetic-Mutation)|43.3%|Medium|| @@ -597,12 +597,12 @@ |0457|Circular Array Loop|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0457.Circular-Array-Loop)|30.2%|Medium|| |0458|Poor Pigs||54.5%|Hard|| |0459|Repeated Substring Pattern||43.3%|Easy|| -|0460|LFU Cache|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0460.LFU-Cache)|36.1%|Hard|| +|0460|LFU Cache|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0460.LFU-Cache)|36.2%|Hard|| |0461|Hamming Distance|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0461.Hamming-Distance)|73.2%|Easy|| |0462|Minimum Moves to Equal Array Elements II||54.4%|Medium|| |0463|Island Perimeter|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0463.Island-Perimeter)|66.7%|Easy|| |0464|Can I Win||29.6%|Medium|| -|0465|Optimal Account Balancing||48.2%|Hard|| +|0465|Optimal Account Balancing||48.3%|Hard|| |0466|Count The Repetitions||28.6%|Hard|| |0467|Unique Substrings in Wraparound String||36.1%|Medium|| |0468|Validate IP Address||25.0%|Medium|| @@ -650,7 +650,7 @@ |0510|Inorder Successor in BST II||60.1%|Medium|| |0511|Game Play Analysis I||81.4%|Easy|| |0512|Game Play Analysis II||56.1%|Easy|| -|0513|Find Bottom Left Tree Value|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0513.Find-Bottom-Left-Tree-Value)|62.6%|Medium|| +|0513|Find Bottom Left Tree Value|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0513.Find-Bottom-Left-Tree-Value)|62.7%|Medium|| |0514|Freedom Trail||45.0%|Hard|| |0515|Find Largest Value in Each Tree Row|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0515.Find-Largest-Value-in-Each-Tree-Row)|62.3%|Medium|| |0516|Longest Palindromic Subsequence||55.5%|Medium|| @@ -658,7 +658,7 @@ |0518|Coin Change 2||51.8%|Medium|| |0519|Random Flip Matrix||37.8%|Medium|| |0520|Detect Capital||53.9%|Easy|| -|0521|Longest Uncommon Subsequence I||58.6%|Easy|| +|0521|Longest Uncommon Subsequence I||58.7%|Easy|| |0522|Longest Uncommon Subsequence II||34.2%|Medium|| |0523|Continuous Subarray Sum||24.7%|Medium|| |0524|Longest Word in Dictionary through Deleting|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0524.Longest-Word-in-Dictionary-through-Deleting)|50.1%|Medium|| @@ -668,10 +668,10 @@ |0528|Random Pick with Weight|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0528.Random-Pick-with-Weight)|44.6%|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.5%|Medium|| +|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|| -|0534|Game Play Analysis III||79.4%|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|| |0537|Complex Number Multiplication|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0537.Complex-Number-Multiplication)|68.3%|Medium|| @@ -700,7 +700,7 @@ |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.0%|Easy|| +|0563|Binary Tree Tilt|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0563.Binary-Tree-Tilt)|53.1%|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|| @@ -708,7 +708,7 @@ |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.5%|Hard|| +|0571|Find Median Given Frequency of Numbers||45.4%|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|| @@ -722,13 +722,13 @@ |0582|Kill Process||63.7%|Medium|| |0583|Delete Operation for Two Strings||50.1%|Medium|| |0584|Find Customer Referee||74.1%|Easy|| -|0585|Investments in 2016||57.1%|Medium|| +|0585|Investments in 2016||57.0%|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|| |0589|N-ary Tree Preorder Traversal||73.4%|Easy|| |0590|N-ary Tree Postorder Traversal||73.4%|Easy|| -|0591|Tag Validator||34.8%|Hard|| +|0591|Tag Validator||34.7%|Hard|| |0592|Fraction Addition and Subtraction||50.2%|Medium|| |0593|Valid Square||43.3%|Medium|| |0594|Longest Harmonious Subsequence|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0594.Longest-Harmonious-Subsequence)|51.2%|Easy|| @@ -755,20 +755,20 @@ |0615|Average Salary: Departments VS Company||52.7%|Hard|| |0616|Add Bold Tag in String||44.7%|Medium|| |0617|Merge Two Binary Trees||75.4%|Easy|| -|0618|Students Report By Geography||60.0%|Hard|| +|0618|Students Report By Geography||60.1%|Hard|| |0619|Biggest Single Number||45.0%|Easy|| |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||50.4%|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|| |0624|Maximum Distance in Arrays||39.6%|Medium|| -|0625|Minimum Factorization||33.0%|Medium|| -|0626|Exchange Seats||65.7%|Medium|| +|0625|Minimum Factorization||32.9%|Medium|| +|0626|Exchange Seats||65.8%|Medium|| |0627|Swap Salary||77.7%|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|| -|0631|Design Excel Sum Formula||32.2%|Hard|| +|0631|Design Excel Sum Formula||32.1%|Hard|| |0632|Smallest Range Covering Elements from K Lists|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0632.Smallest-Range-Covering-Elements-from-K-Lists)|54.3%|Hard|| |0633|Sum of Square Numbers|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0633.Sum-of-Square-Numbers)|32.6%|Medium|| |0634|Find the Derangement of An Array||40.6%|Medium|| @@ -778,12 +778,12 @@ |0638|Shopping Offers|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0638.Shopping-Offers)|52.9%|Medium|| |0639|Decode Ways II||27.6%|Hard|| |0640|Solve the Equation||42.8%|Medium|| -|0641|Design Circular Deque||56.0%|Medium|| +|0641|Design Circular Deque||56.1%|Medium|| |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.2%|Easy|| -|0646|Maximum Length of Pair Chain||52.9%|Medium|| +|0645|Set Mismatch|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0645.Set-Mismatch)|42.1%|Easy|| +|0646|Maximum Length of Pair Chain||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|| |0649|Dota2 Senate||39.4%|Medium|| @@ -825,10 +825,10 @@ |0685|Redundant Connection II|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0685.Redundant-Connection-II)|33.0%|Hard|| |0686|Repeated String Match||32.9%|Medium|| |0687|Longest Univalue Path||37.3%|Medium|| -|0688|Knight Probability in Chessboard||50.2%|Medium|| +|0688|Knight Probability in Chessboard||50.1%|Medium|| |0689|Maximum Sum of 3 Non-Overlapping Subarrays||47.2%|Hard|| |0690|Employee Importance||58.8%|Easy|| -|0691|Stickers to Spell Word||44.7%|Hard|| +|0691|Stickers to Spell Word||44.8%|Hard|| |0692|Top K Frequent Words||53.1%|Medium|| |0693|Binary Number with Alternating Bits|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0693.Binary-Number-with-Alternating-Bits)|59.9%|Easy|| |0694|Number of Distinct Islands||57.9%|Medium|| @@ -840,10 +840,10 @@ |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.7%|Easy|| +|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|| |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.2%|Easy|| +|0706|Design HashMap|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0706.Design-HashMap)|64.3%|Easy|| |0707|Design Linked List|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0707.Design-Linked-List)|25.9%|Medium|| |0708|Insert into a Sorted Circular Linked List||32.5%|Medium|| |0709|To Lower Case||80.2%|Easy|| @@ -888,7 +888,7 @@ |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|| |0750|Number Of Corner Rectangles||67.2%|Medium|| -|0751|IP to CIDR||59.6%|Medium|| +|0751|IP to CIDR||59.5%|Medium|| |0752|Open the Lock||52.9%|Medium|| |0753|Cracking the Safe|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0753.Cracking-the-Safe)|52.4%|Hard|| |0754|Reach a Number||40.5%|Medium|| @@ -896,7 +896,7 @@ |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|| |0758|Bold Words in String||47.4%|Easy|| -|0759|Employee Free Time||68.2%|Hard|| +|0759|Employee Free Time||68.3%|Hard|| |0760|Find Anagram Mappings||81.9%|Easy|| |0761|Special Binary String||58.7%|Hard|| |0762|Prime Number of Set Bits in Binary Representation|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0762.Prime-Number-of-Set-Bits-in-Binary-Representation)|64.4%|Easy|| @@ -904,7 +904,7 @@ |0764|Largest Plus Sign||46.6%|Medium|| |0765|Couples Holding Hands|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0765.Couples-Holding-Hands)|55.5%|Hard|| |0766|Toeplitz Matrix|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0766.Toeplitz-Matrix)|65.9%|Easy|| -|0767|Reorganize String|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0767.Reorganize-String)|50.1%|Medium|| +|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|| @@ -914,7 +914,7 @@ |0774|Minimize Max Distance to Gas Station||48.3%|Hard|| |0775|Global and Local Inversions||42.6%|Medium|| |0776|Split BST||56.6%|Medium|| -|0777|Swap Adjacent in LR String||35.6%|Medium|| +|0777|Swap Adjacent in LR String||35.7%|Medium|| |0778|Swim in Rising Water|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0778.Swim-in-Rising-Water)|54.7%|Hard|| |0779|K-th Symbol in Grammar||38.6%|Medium|| |0780|Reaching Points||30.3%|Hard|| @@ -924,10 +924,10 @@ |0784|Letter Case Permutation|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0784.Letter-Case-Permutation)|68.6%|Medium|| |0785|Is Graph Bipartite?|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0785.Is-Graph-Bipartite?)|48.6%|Medium|| |0786|K-th Smallest Prime Fraction|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0786.K-th-Smallest-Prime-Fraction)|42.8%|Hard|| -|0787|Cheapest Flights Within K Stops||39.5%|Medium|| +|0787|Cheapest Flights Within K Stops||39.6%|Medium|| |0788|Rotated Digits||57.1%|Easy|| |0789|Escape The Ghosts||58.4%|Medium|| -|0790|Domino and Tromino Tiling||40.1%|Medium|| +|0790|Domino and Tromino Tiling||40.2%|Medium|| |0791|Custom Sort String||65.9%|Medium|| |0792|Number of Matching Subsequences||48.2%|Medium|| |0793|Preimage Size of Factorial Zeroes Function|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0793.Preimage-Size-of-Factorial-Zeroes-Function)|40.7%|Hard|| @@ -937,13 +937,13 @@ |0797|All Paths From Source to Target||78.5%|Medium|| |0798|Smallest Rotation with Highest Score||45.0%|Hard|| |0799|Champagne Tower||44.1%|Medium|| -|0800|Similar RGB Color||62.3%|Easy|| +|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|| -|0803|Bricks Falling When Hit|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0803.Bricks-Falling-When-Hit)|31.4%|Hard|| -|0804|Unique Morse Code Words||78.9%|Easy|| +|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|| -|0806|Number of Lines To Write String||65.4%|Easy|| +|0806|Number of Lines To Write String||65.5%|Easy|| |0807|Max Increase to Keep City Skyline||84.3%|Medium|| |0808|Soup Servings||41.0%|Medium|| |0809|Expressive Words||46.5%|Medium|| @@ -1010,7 +1010,7 @@ |0870|Advantage Shuffle||46.9%|Medium|| |0871|Minimum Number of Refueling Stops||32.4%|Hard|| |0872|Leaf-Similar Trees|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0872.Leaf-Similar-Trees)|64.5%|Easy|| -|0873|Length of Longest Fibonacci Subsequence||48.1%|Medium|| +|0873|Length of Longest Fibonacci Subsequence||48.2%|Medium|| |0874|Walking Robot Simulation||36.8%|Easy|| |0875|Koko Eating Bananas|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0875.Koko-Eating-Bananas)|53.5%|Medium|| |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|| @@ -1018,7 +1018,7 @@ |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|| |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)|48.9%|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|| @@ -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.2%|Hard|| +|0903|Valid Permutations for DI Sequence||54.1%|Hard|| |0904|Fruit Into Baskets|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0904.Fruit-Into-Baskets)|43.0%|Medium|| |0905|Sort Array By Parity||75.0%|Easy|| |0906|Super Palindromes||32.8%|Hard|| @@ -1057,7 +1057,7 @@ |0917|Reverse Only Letters||58.9%|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.7%|Hard|| +|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|| |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|| @@ -1094,7 +1094,7 @@ |0954|Array of Doubled Pairs||35.2%|Medium|| |0955|Delete Columns to Make Sorted II||33.8%|Medium|| |0956|Tallest Billboard||39.8%|Hard|| -|0957|Prison Cells After N Days||40.2%|Medium|| +|0957|Prison Cells After N Days||40.1%|Medium|| |0958|Check Completeness of a Binary Tree||52.5%|Medium|| |0959|Regions Cut By Slashes|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0959.Regions-Cut-By-Slashes)|67.2%|Medium|| |0960|Delete Columns to Make Sorted III||54.9%|Hard|| @@ -1102,7 +1102,7 @@ |0962|Maximum Width Ramp||46.6%|Medium|| |0963|Minimum Area Rectangle II||51.9%|Medium|| |0964|Least Operators to Express Number||45.1%|Hard|| -|0965|Univalued Binary Tree||67.8%|Easy|| +|0965|Univalued Binary Tree||67.9%|Easy|| |0966|Vowel Spellchecker||47.9%|Medium|| |0967|Numbers With Same Consecutive Differences||44.9%|Medium|| |0968|Binary Tree Cameras|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0968.Binary-Tree-Cameras)|38.8%|Hard|| @@ -1112,7 +1112,7 @@ |0972|Equal Rational Numbers||42.1%|Hard|| |0973|K Closest Points to Origin|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0973.K-Closest-Points-to-Origin)|64.6%|Medium|| |0974|Subarray Sums Divisible by K||50.9%|Medium|| -|0975|Odd Even Jump||41.6%|Hard|| +|0975|Odd Even Jump||41.5%|Hard|| |0976|Largest Perimeter Triangle|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0976.Largest-Perimeter-Triangle)|58.6%|Easy|| |0977|Squares of a Sorted Array|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0977.Squares-of-a-Sorted-Array)|72.0%|Easy|| |0978|Longest Turbulent Subarray|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0978.Longest-Turbulent-Subarray)|46.7%|Medium|| @@ -1127,7 +1127,7 @@ |0987|Vertical Order Traversal of a Binary Tree|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0987.Vertical-Order-Traversal-of-a-Binary-Tree)|38.9%|Hard|| |0988|Smallest String Starting From Leaf||46.7%|Medium|| |0989|Add to Array-Form of Integer|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0989.Add-to-Array-Form-of-Integer)|44.9%|Easy|| -|0990|Satisfiability of Equality Equations|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0990.Satisfiability-of-Equality-Equations)|46.8%|Medium|| +|0990|Satisfiability of Equality Equations|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0990.Satisfiability-of-Equality-Equations)|46.9%|Medium|| |0991|Broken Calculator|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0991.Broken-Calculator)|49.7%|Medium|| |0992|Subarrays with K Different Integers|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0992.Subarrays-with-K-Different-Integers)|50.7%|Hard|| |0993|Cousins in Binary Tree|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0993.Cousins-in-Binary-Tree)|52.3%|Easy|| @@ -1141,7 +1141,7 @@ |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|| -|1004|Max Consecutive Ones III|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1004.Max-Consecutive-Ones-III)|60.8%|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|| |1007|Minimum Domino Rotations For Equal Row||50.9%|Medium|| @@ -1152,12 +1152,12 @@ |1012|Numbers With Repeated Digits||37.8%|Hard|| |1013|Partition Array Into Three Parts With Equal Sum||48.7%|Easy|| |1014|Best Sightseeing Pair||52.9%|Medium|| -|1015|Smallest Integer Divisible by K||41.9%|Medium|| +|1015|Smallest Integer Divisible by K||41.8%|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|| |1019|Next Greater Node In Linked List|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1019.Next-Greater-Node-In-Linked-List)|58.3%|Medium|| -|1020|Number of Enclaves|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1020.Number-of-Enclaves)|59.0%|Medium|| +|1020|Number of Enclaves|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1020.Number-of-Enclaves)|59.1%|Medium|| |1021|Remove Outermost Parentheses|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1021.Remove-Outermost-Parentheses)|79.1%|Easy|| |1022|Sum of Root To Leaf Binary Numbers||71.5%|Easy|| |1023|Camelcase Matching||57.5%|Medium|| @@ -1178,11 +1178,11 @@ |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.1%|Medium|| +|1041|Robot Bounded In Circle||55.0%|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|| -|1045|Customers Who Bought All Products||68.4%|Medium|| +|1045|Customers Who Bought All Products||68.5%|Medium|| |1046|Last Stone Weight||62.4%|Easy|| |1047|Remove All Adjacent Duplicates In String|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1047.Remove-All-Adjacent-Duplicates-In-String)|70.9%|Easy|| |1048|Longest String Chain||55.5%|Medium|| @@ -1197,40 +1197,40 @@ |1057|Campus Bikes||57.7%|Medium|| |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.7%|Medium|| +|1060|Missing Element in Sorted Array||54.8%|Medium|| |1061|Lexicographically Smallest Equivalent String||66.8%|Medium|| |1062|Longest Repeating Substring||58.3%|Medium|| |1063|Number of Valid Subarrays||72.1%|Hard|| |1064|Fixed Point||65.0%|Easy|| |1065|Index Pairs of a String||61.0%|Easy|| |1066|Campus Bikes II||54.2%|Medium|| -|1067|Digit Count in Range||41.6%|Hard|| +|1067|Digit Count in Range||41.7%|Hard|| |1068|Product Sales Analysis I||82.1%|Easy|| |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|| -|1073|Adding Two Negabinary Numbers|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1073.Adding-Two-Negabinary-Numbers)|34.8%|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.2%|Easy|| -|1076|Project Employees II||53.0%|Easy|| +|1075|Project Employees I||66.1%|Easy|| +|1076|Project Employees II||52.9%|Easy|| |1077|Project Employees III||77.7%|Medium|| |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|| |1082|Sales Analysis I||73.8%|Easy|| -|1083|Sales Analysis II||50.9%|Easy|| +|1083|Sales Analysis II||50.8%|Easy|| |1084|Sales Analysis III||54.7%|Easy|| |1085|Sum of Digits in the Minimum Number||75.1%|Easy|| -|1086|High Five||77.8%|Easy|| +|1086|High Five||77.7%|Easy|| |1087|Brace Expansion||63.1%|Medium|| |1088|Confusing Number II||45.5%|Hard|| |1089|Duplicate Zeros|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1089.Duplicate-Zeros)|51.7%|Easy|| |1090|Largest Values From Labels||60.1%|Medium|| |1091|Shortest Path in Binary Matrix|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1091.Shortest-Path-in-Binary-Matrix)|40.0%|Medium|| |1092|Shortest Common Supersequence||53.1%|Hard|| -|1093|Statistics from a Large Sample|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1093.Statistics-from-a-Large-Sample)|49.5%|Medium|| +|1093|Statistics from a Large Sample|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1093.Statistics-from-a-Large-Sample)|49.4%|Medium|| |1094|Car Pooling||59.7%|Medium|| |1095|Find in Mountain Array||36.1%|Hard|| |1096|Brace Expansion II||62.5%|Hard|| @@ -1263,7 +1263,7 @@ |1123|Lowest Common Ancestor of Deepest Leaves|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1123.Lowest-Common-Ancestor-of-Deepest-Leaves)|68.0%|Medium|| |1124|Longest Well-Performing Interval||33.3%|Medium|| |1125|Smallest Sufficient Team||47.1%|Hard|| -|1126|Active Businesses||68.5%|Medium|| +|1126|Active Businesses||68.6%|Medium|| |1127|User Purchase Platform||50.4%|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|| @@ -1286,7 +1286,7 @@ |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.2%|Medium|| +|1149|Article Views II||48.3%|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|| @@ -1309,9 +1309,9 @@ |1169|Invalid Transactions||30.9%|Medium|| |1170|Compare Strings by Frequency of the Smallest Character|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1170.Compare-Strings-by-Frequency-of-the-Smallest-Character)|59.8%|Medium|| |1171|Remove Zero Sum Consecutive Nodes from Linked List|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1171.Remove-Zero-Sum-Consecutive-Nodes-from-Linked-List)|41.5%|Medium|| -|1172|Dinner Plate Stacks||37.8%|Hard|| +|1172|Dinner Plate Stacks||37.7%|Hard|| |1173|Immediate Food Delivery I||82.5%|Easy|| -|1174|Immediate Food Delivery II||61.9%|Medium|| +|1174|Immediate Food Delivery II||62.0%|Medium|| |1175|Prime Arrangements|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1175.Prime-Arrangements)|52.0%|Easy|| |1176|Diet Plan Performance||53.8%|Easy|| |1177|Can Make Palindrome from Substring||36.1%|Medium|| @@ -1325,9 +1325,9 @@ |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|| -|1188|Design Bounded Blocking Queue||73.0%|Medium|| +|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|| -|1190|Reverse Substrings Between Each Pair of Parentheses||64.2%|Medium|| +|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|| |1193|Monthly Transactions I||69.1%|Medium|| @@ -1345,9 +1345,9 @@ |1205|Monthly Transactions II||45.6%|Medium|| |1206|Design Skiplist||58.9%|Hard|| |1207|Unique Number of Occurrences|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1207.Unique-Number-of-Occurrences)|71.8%|Easy|| -|1208|Get Equal Substrings Within Budget|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1208.Get-Equal-Substrings-Within-Budget)|44.1%|Medium|| +|1208|Get Equal Substrings Within Budget|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1208.Get-Equal-Substrings-Within-Budget)|44.0%|Medium|| |1209|Remove All Adjacent Duplicates in String II||57.6%|Medium|| -|1210|Minimum Moves to Reach Target with Rotations||46.3%|Hard|| +|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|| @@ -1356,7 +1356,7 @@ |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.7%|Medium|| +|1219|Path with Maximum Gold||65.8%|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,19 +1367,19 @@ |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.2%|Medium|| +|1230|Toss Strange Coins||50.3%|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|| |1234|Replace the Substring for Balanced String|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1234.Replace-the-Substring-for-Balanced-String)|34.5%|Medium|| |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.6%|Medium|| +|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|| |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.8%|Easy|| -|1242|Web Crawler Multithreaded||47.7%|Medium|| +|1241|Number of Comments per Post||67.9%|Easy|| +|1242|Web Crawler Multithreaded||47.6%|Medium|| |1243|Array Transformation||50.0%|Easy|| |1244|Design A Leaderboard||66.1%|Medium|| |1245|Tree Diameter||61.1%|Medium|| @@ -1392,12 +1392,12 @@ |1252|Cells with Odd Values in a Matrix|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1252.Cells-with-Odd-Values-in-a-Matrix)|78.9%|Easy|| |1253|Reconstruct a 2-Row Binary Matrix||41.6%|Medium|| |1254|Number of Closed Islands|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1254.Number-of-Closed-Islands)|61.7%|Medium|| -|1255|Maximum Score Words Formed by Letters||69.9%|Hard|| +|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|| |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.9%|Easy|| +|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|| |1262|Greatest Sum Divisible by Three||49.7%|Medium|| |1263|Minimum Moves to Move a Box to Their Target Location||43.3%|Hard|| @@ -1430,7 +1430,7 @@ |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|| -|1293|Shortest Path in a Grid with Obstacles Elimination||43.0%|Hard|| +|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|| @@ -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.6%|Easy|| +|1309|Decrypt String from Alphabet to Integer Mapping||77.5%|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|| @@ -1458,7 +1458,7 @@ |1318|Minimum Flips to Make a OR b Equal to c||64.0%|Medium|| |1319|Number of Operations to Make Network Connected|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1319.Number-of-Operations-to-Make-Network-Connected)|55.5%|Medium|| |1320|Minimum Distance to Type a Word Using Two Fingers||61.8%|Hard|| -|1321|Restaurant Growth||71.2%|Medium|| +|1321|Restaurant Growth||71.3%|Medium|| |1322|Ads Performance||58.1%|Easy|| |1323|Maximum 69 Number||77.9%|Easy|| |1324|Print Words Vertically||58.9%|Medium|| @@ -1466,28 +1466,28 @@ |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|| -|1329|Sort the Matrix Diagonally|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1329.Sort-the-Matrix-Diagonally)|81.7%|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|| |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)|66.8%|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|| |1335|Minimum Difficulty of a Job Schedule||56.8%|Hard|| -|1336|Number of Transactions per Visit||48.2%|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|| |1338|Reduce Array Size to The Half||67.7%|Medium|| |1339|Maximum Product of Splitted Binary Tree||38.3%|Medium|| |1340|Jump Game V||59.3%|Hard|| |1341|Movie Rating||58.9%|Medium|| |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.9%|Medium|| +|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|| |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.4%|Easy|| +|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|| |1353|Maximum Number of Events That Can Be Attended||30.5%|Medium|| @@ -1496,7 +1496,7 @@ |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.4%|Hard|| +|1359|Count All Valid Pickup and Delivery Options||56.3%|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|| @@ -1505,25 +1505,25 @@ |1365|How Many Numbers Are Smaller Than the Current Number||86.0%|Easy|| |1366|Rank Teams by Votes||55.2%|Medium|| |1367|Linked List in Binary Tree||41.1%|Medium|| -|1368|Minimum Cost to Make at Least One Valid Path in a Grid||57.5%|Hard|| +|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|| -|1370|Increasing Decreasing String||77.0%|Easy|| +|1370|Increasing Decreasing String||77.1%|Easy|| |1371|Find the Longest Substring Containing Vowels in Even Counts||60.9%|Medium|| |1372|Longest ZigZag Path in a Binary Tree||54.9%|Medium|| |1373|Maximum Sum BST in Binary Tree||37.3%|Hard|| -|1374|Generate a String With Characters That Have Odd Counts||76.6%|Easy|| +|1374|Generate a String With Characters That Have Odd Counts||76.7%|Easy|| |1375|Bulb Switcher III||64.2%|Medium|| |1376|Time Needed to Inform All Employees||56.5%|Medium|| -|1377|Frog Position After T Seconds||35.3%|Hard|| +|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.7%|Medium|| +|1379|Find a Corresponding Node of a Binary Tree in a Clone of That Tree||84.6%|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|| |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.8%|Medium|| +|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|| |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|| @@ -1559,18 +1559,18 @@ |1419|Minimum Number of Frogs Croaking||47.5%|Medium|| |1420|Build Array Where You Can Find The Maximum Exactly K Comparisons||64.1%|Hard|| |1421|NPV Queries||82.1%|Medium|| -|1422|Maximum Score After Splitting a String||56.0%|Easy|| +|1422|Maximum Score After Splitting a String||56.1%|Easy|| |1423|Maximum Points You Can Obtain from Cards|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1423.Maximum-Points-You-Can-Obtain-from-Cards)|46.7%|Medium|| -|1424|Diagonal Traverse II||46.0%|Medium|| -|1425|Constrained Subsequence Sum||44.9%|Hard|| +|1424|Diagonal Traverse II||46.1%|Medium|| +|1425|Constrained Subsequence Sum||45.0%|Hard|| |1426|Counting Elements||59.1%|Easy|| |1427|Perform String Shifts||53.5%|Easy|| |1428|Leftmost Column with at Least a One||49.2%|Medium|| -|1429|First Unique Number||49.6%|Medium|| +|1429|First Unique Number||49.7%|Medium|| |1430|Check If a String Is a Valid Sequence from Root to Leaves Path in a Binary Tree||45.1%|Medium|| |1431|Kids With the Greatest Number of Candies||88.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.3%|Medium|| +|1433|Check If a String Can Break Another String||67.2%|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|| @@ -1584,15 +1584,15 @@ |1444|Number of Ways of Cutting a Pizza||53.8%|Hard|| |1445|Apples & Oranges||90.7%|Medium|| |1446|Consecutive Characters||61.0%|Easy|| -|1447|Simplified Fractions||62.2%|Medium|| +|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.1%|Hard|| +|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|| |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|| |1454|Active Users||38.9%|Medium|| -|1455|Check If a Word Occurs As a Prefix of Any Word in a Sentence|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1455.Check-If-a-Word-Occurs-As-a-Prefix-of-Any-Word-in-a-Sentence)|64.7%|Easy|| +|1455|Check If a Word Occurs As a Prefix of Any Word in a Sentence|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1455.Check-If-a-Word-Occurs-As-a-Prefix-of-Any-Word-in-a-Sentence)|64.9%|Easy|| |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|| @@ -1603,9 +1603,9 @@ |1463|Cherry Pickup II|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1463.Cherry-Pickup-II)|69.0%|Hard|| |1464|Maximum Product of Two Elements in an Array|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1464.Maximum-Product-of-Two-Elements-in-an-Array)|77.1%|Easy|| |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.7%|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||82.0%|Medium|| +|1468|Calculate Salaries||81.9%|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|| @@ -1616,24 +1616,24 @@ |1476|Subrectangle Queries||88.3%|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.5%|Hard|| +|1479|Sales by Day of the Week||83.3%|Hard|| |1480|Running Sum of 1d Array|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1480.Running-Sum-of-1d-Array)|88.9%|Easy|| |1481|Least Number of Unique Integers after K Removals||56.0%|Medium|| -|1482|Minimum Number of Days to Make m Bouquets||50.4%|Medium|| +|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|| |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.5%|Hard|| +|1489|Find Critical and Pseudo-Critical Edges in Minimum Spanning Tree||51.4%|Hard|| |1490|Clone N-ary Tree||83.6%|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|| |1494|Parallel Courses II||31.2%|Hard|| |1495|Friendly Movies Streamed Last Month||51.3%|Easy|| -|1496|Path Crossing||55.3%|Easy|| +|1496|Path Crossing||55.2%|Easy|| |1497|Check If Array Pairs Are Divisible by k||40.3%|Medium|| |1498|Number of Subsequences That Satisfy the Given Sum Condition||38.5%|Medium|| |1499|Max Value of Equation||45.0%|Hard|| @@ -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.5%|Easy|| +|1523|Count Odd Numbers in an Interval Range||54.6%|Easy|| |1524|Number of Sub-arrays With Odd Sum||39.9%|Medium|| -|1525|Number of Good Ways to Split a String||66.4%|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.1%|Easy|| +|1527|Patients With a Condition||66.0%|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.8%|Medium|| +|1532|The Most Recent Three Orders||72.9%|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|| @@ -1685,7 +1685,7 @@ |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|| -|1548|The Most Similar Path in a Graph||54.3%|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|| |1551|Minimum Operations to Make Array Equal||77.9%|Medium|| @@ -1693,15 +1693,15 @@ |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.5%|Easy|| +|1556|Thousand Separator||57.4%|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|| |1560|Most Visited Sector in a Circular Track||56.9%|Easy|| -|1561|Maximum Number of Coins You Can Get||77.4%|Medium|| +|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||65.9%|Medium|| +|1564|Put Boxes Into the Warehouse I||66.0%|Medium|| |1565|Unique Orders and Customers Per Month||83.1%|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|| @@ -1712,17 +1712,17 @@ |1572|Matrix Diagonal Sum||77.9%|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.2%|Hard|| +|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.4%|Medium|| +|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|| |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.6%|Easy|| +|1581|Customer Who Visited but Did Not Make Any Transactions||89.7%|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.2%|Hard|| +|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|| |1588|Sum of All Odd Length Subarrays||81.6%|Easy|| @@ -1732,17 +1732,17 @@ |1592|Rearrange Spaces Between Words||43.8%|Easy|| |1593|Split a String Into the Max Number of Unique Substrings||49.3%|Medium|| |1594|Maximum Non Negative Product in a Matrix||31.8%|Medium|| -|1595|Minimum Cost to Connect Two Groups of Points||43.2%|Hard|| +|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.4%|Hard|| +|1597|Build Binary Expression Tree From Infix Expression||60.2%|Hard|| |1598|Crawler Log Folder||63.9%|Easy|| |1599|Maximum Profit of Operating a Centennial Wheel||43.7%|Medium|| -|1600|Throne Inheritance||60.4%|Medium|| +|1600|Throne Inheritance||60.5%|Medium|| |1601|Maximum Number of Achievable Transfer Requests||47.8%|Hard|| |1602|Find Nearest Right Node in Binary Tree||73.8%|Medium|| -|1603|Design Parking System|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1603.Design-Parking-System)|86.4%|Easy|| +|1603|Design Parking System|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1603.Design-Parking-System)|86.3%|Easy|| |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.1%|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|| @@ -1755,27 +1755,27 @@ |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.5%|Medium|| +|1618|Maximum Font to Fit a Sentence in a Screen||56.4%|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|| |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.8%|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.0%|Medium|| -|1627|Graph Connectivity With Threshold||39.0%|Hard|| +|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.2%|Easy|| +|1629|Slowest Key|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1629.Slowest-Key)|59.1%|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.0%|Medium|| -|1632|Rank Transform of a Matrix||30.7%|Hard|| -|1633|Percentage of Users Attended a Contest||71.2%|Easy|| +|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.8%|Hard|| -|1636|Sort Array by Increasing Frequency|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1636.Sort-Array-by-Increasing-Frequency)|66.9%|Easy|| +|1635|Hopper Company Queries I||55.7%|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.4%|Medium|| +|1638|Count Substrings That Differ by One Character||69.5%|Medium|| |1639|Number of Ways to Form a Target String Given a Dictionary||39.7%|Hard|| |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|| @@ -1785,7 +1785,7 @@ |1645|Hopper Company Queries II||37.7%|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.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.5%|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|| @@ -1797,23 +1797,23 @@ |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.2%|Medium|| -|1661|Average Time of Process per Machine||79.4%|Easy|| +|1660|Correct a Binary Tree||77.1%|Medium|| +|1661|Average Time of Process per Machine||79.5%|Easy|| |1662|Check If Two String Arrays are Equivalent|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1662.Check-If-Two-String-Arrays-are-Equivalent)|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|| |1665|Minimum Initial Energy to Finish Tasks|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1665.Minimum-Initial-Energy-to-Finish-Tasks)|66.0%|Hard|| -|1666|Change the Root of a Binary Tree||67.7%|Medium|| -|1667|Fix Names in a Table||63.3%|Easy|| +|1666|Change the Root of a Binary Tree||67.6%|Medium|| +|1667|Fix Names in a Table||63.2%|Easy|| |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.4%|Medium|| +|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.7%|Hard|| +|1671|Minimum Number of Removals to Make Mountain Array||45.8%|Hard|| |1672|Richest Customer Wealth|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1672.Richest-Customer-Wealth)|88.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.4%|Medium|| +|1676|Lowest Common Ancestor of a Binary Tree IV||79.3%|Medium|| |1677|Product's Worth Over Invoices||73.3%|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|| @@ -1821,10 +1821,10 @@ |1681|Minimum Incompatibility|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1681.Minimum-Incompatibility)|35.6%|Hard|| |1682|Longest Palindromic Subsequence II||51.3%|Medium|| |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.4%|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.9%|Hard|| +|1687|Delivering Boxes from Storage to Ports||34.8%|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|| @@ -1832,99 +1832,99 @@ |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|| -|1695|Maximum Erasure Value|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1695.Maximum-Erasure-Value)|49.5%|Medium|| +|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|| |1697|Checking Existence of Edge Length Limited Paths||54.6%|Hard|| -|1698|Number of Distinct Substrings in a String||60.1%|Medium|| -|1699|Number of Calls Between Two Persons||86.5%|Medium|| +|1698|Number of Distinct Substrings in a String||59.9%|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.5%|Medium|| -|1702|Maximum Binary String After Change||60.1%|Medium|| +|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.2%|Easy|| +|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|| |1705|Maximum Number of Eaten Apples||41.9%|Medium|| -|1706|Where Will the Ball Fall||59.8%|Medium|| +|1706|Where Will the Ball Fall||59.9%|Medium|| |1707|Maximum XOR With an Element From Array||46.9%|Hard|| |1708|Largest Subarray Length K||62.7%|Easy|| -|1709|Biggest Window Between Visits||82.6%|Medium|| +|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|| -|1711|Count Good Meals||26.1%|Medium|| +|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.6%|Hard|| -|1714|Sum Of Special Evenly-Spaced Elements In Array||48.2%|Hard|| +|1713|Minimum Operations to Make a Subsequence||45.5%|Hard|| +|1714|Sum Of Special Evenly-Spaced Elements In Array||48.3%|Hard|| |1715|Count Apples and Oranges||79.7%|Medium|| -|1716|Calculate Money in Leetcode Bank|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1716.Calculate-Money-in-Leetcode-Bank)|66.6%|Easy|| +|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|| |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||44.0%|Hard|| +|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|| |1726|Tuple with Same Product||56.1%|Medium|| |1727|Largest Submatrix With Rearrangements||58.4%|Medium|| |1728|Cat and Mouse II||41.1%|Hard|| |1729|Find Followers Count||71.8%|Easy|| -|1730|Shortest Path to Get Food||57.4%|Medium|| -|1731|The Number of Employees Which Report to Each Employee||49.4%|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|| -|1733|Minimum Number of People to Teach||37.1%|Medium|| -|1734|Decode XORed Permutation||52.5%|Medium|| -|1735|Count Ways to Make Array With Product||48.3%|Hard|| +|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|| |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.5%|Medium|| +|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.6%|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.8%|Easy|| +|1740|Find Distance in a Binary Tree||69.4%|Medium|| +|1741|Find Total Time Spent by Each Employee||91.1%|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.3%|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.3%|Medium|| -|1747|Leetflex Banned Accounts||69.9%|Medium|| +|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.5%|Medium|| -|1751|Maximum Number of Events That Can Be Attended II||47.3%|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.7%|Easy|| +|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|| |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.6%|Medium|| -|1757|Recyclable and Low Fat Products||96.3%|Easy|| -|1758|Minimum Changes To Make Alternating Binary String|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1758.Minimum-Changes-To-Make-Alternating-Binary-String)|59.0%|Easy|| -|1759|Count Number of Homogenous Substrings||41.8%|Medium|| +|1756|Design Most Recently Used Queue||77.7%|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|| |1762|Buildings With an Ocean View||81.8%|Medium|| |1763|Longest Nice Substring||62.0%|Easy|| -|1764|Form Array by Concatenating Subarrays of Another Array||55.9%|Medium|| -|1765|Map of Highest Peak||54.6%|Medium|| -|1766|Tree of Coprimes||36.8%|Hard|| +|1764|Form Array by Concatenating Subarrays of Another Array||55.7%|Medium|| +|1765|Map of Highest Peak||54.4%|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.2%|Medium|| +|1769|Minimum Number of Operations to Move All Balls to Each Box||88.1%|Medium|| |1770|Maximum Score from Performing Multiplication Operations||28.8%|Medium|| -|1771|Maximize Palindrome Length From Subsequences||33.9%|Hard|| -|1772|Sort Features by Popularity||66.5%|Medium|| -|1773|Count Items Matching a Rule||86.9%|Easy|| -|1774|Closest Dessert Cost||60.3%|Medium|| -|1775|Equal Sum Arrays With Minimum Number of Operations||50.6%|Medium|| -|1776|Car Fleet II||43.7%|Hard|| -|1777|Product's Price for Each Store||87.3%|Easy|| -|1778|Shortest Path in a Hidden Grid||46.9%|Medium|| +|1771|Maximize Palindrome Length From Subsequences||34.0%|Hard|| +|1772|Sort Features by Popularity||65.9%|Medium|| +|1773|Count Items Matching a Rule||86.8%|Easy|| +|1774|Closest Dessert Cost||60.2%|Medium|| +|1775|Equal Sum Arrays With Minimum Number of Operations||50.5%|Medium|| +|1776|Car Fleet II||43.8%|Hard|| +|1777|Product's Price for Each Store||87.5%|Easy|| +|1778|Shortest Path in a Hidden Grid||46.2%|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.1%|Medium|| -|1781|Sum of Beauty of All Substrings||45.5%|Medium|| -|1782|Count Pairs Of Nodes||26.7%|Hard|| -|1783|Grand Slam Titles||94.8%|Medium|| -|1784|Check if Binary String Has at Most One Segment of Ones||42.8%|Easy|| -|1785|Minimum Elements to Add to Form a Given Sum||38.3%|Medium|| -|1786|Number of Restricted Paths From First to Last Node||34.4%|Medium|| -|1787|Make the XOR of All Segments Equal to Zero||30.6%|Hard|| +|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|| +|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|| |------------|-------------------------------------------------------|-------| ----------------| ---------------|-------------| ------------------------------------------------------------------ diff --git a/leetcode/0623.Add-One-Row-to-Tree/623. Add One Row to Tree.go b/leetcode/0623.Add-One-Row-to-Tree/623. Add One Row to Tree.go new file mode 100644 index 00000000..309ab55c --- /dev/null +++ b/leetcode/0623.Add-One-Row-to-Tree/623. Add One Row to Tree.go @@ -0,0 +1,42 @@ +package leetcode + +import ( + "github.com/halfrost/LeetCode-Go/structures" +) + +// TreeNode define +type TreeNode = structures.TreeNode + +/** + * Definition for a binary tree node. + * type TreeNode struct { + * Val int + * Left *TreeNode + * Right *TreeNode + * } + */ +func addOneRow(root *TreeNode, v int, d int) *TreeNode { + if d == 1 { + tmp := &TreeNode{Val: v, Left: root, Right: nil} + return tmp + } + level := 1 + addTreeRow(root, v, d, &level) + return root +} + +func addTreeRow(root *TreeNode, v, d int, currLevel *int) { + if *currLevel == d-1 { + root.Left = &TreeNode{Val: v, Left: root.Left, Right: nil} + root.Right = &TreeNode{Val: v, Left: nil, Right: root.Right} + return + } + *currLevel++ + if root.Left != nil { + addTreeRow(root.Left, v, d, currLevel) + } + if root.Right != nil { + addTreeRow(root.Right, v, d, currLevel) + } + *currLevel-- +} diff --git a/leetcode/0623.Add-One-Row-to-Tree/623. Add One Row to Tree_test.go b/leetcode/0623.Add-One-Row-to-Tree/623. Add One Row to Tree_test.go new file mode 100644 index 00000000..d13d3e51 --- /dev/null +++ b/leetcode/0623.Add-One-Row-to-Tree/623. Add One Row to Tree_test.go @@ -0,0 +1,68 @@ +package leetcode + +import ( + "fmt" + "testing" + + "github.com/halfrost/LeetCode-Go/structures" +) + +type question623 struct { + para623 + ans623 +} + +// para 是参数 +// one 代表第一个参数 +type para623 struct { + one []int + v int + d int +} + +// ans 是答案 +// one 代表第一个答案 +type ans623 struct { + one []int +} + +func Test_Problem623(t *testing.T) { + + qs := []question623{ + + { + para623{[]int{4, 2, 6, 3, 1, 5, structures.NULL}, 1, 2}, + ans623{[]int{4, 1, 1, 2, structures.NULL, structures.NULL, 6, 3, 1, 5, structures.NULL}}, + }, + + { + para623{[]int{4, 2, structures.NULL, 3, 1}, 1, 3}, + ans623{[]int{4, 2, structures.NULL, 1, 1, 3, structures.NULL, structures.NULL, 1}}, + }, + + { + para623{[]int{1, 2, 3, 4}, 5, 4}, + ans623{[]int{1, 2, 3, 4, structures.NULL, structures.NULL, structures.NULL, 5, 5}}, + }, + + { + para623{[]int{4, 2, 6, 3, 1, 5}, 1, 3}, + ans623{[]int{4, 2, 6, 1, 1, 1, 1, 3, structures.NULL, structures.NULL, 1, 5}}, + }, + + { + para623{[]int{4, 2, 6, 3, 1, 5}, 1, 1}, + ans623{[]int{1, 4, structures.NULL, 2, 6, 3, 1, 5}}, + }, + } + + fmt.Printf("------------------------Leetcode Problem 623------------------------\n") + + for _, q := range qs { + _, p := q.ans623, q.para623 + fmt.Printf("【input】:%v ", p) + root := structures.Ints2TreeNode(p.one) + fmt.Printf("【output】:%v \n", structures.Tree2Preorder(addOneRow(root, p.v, p.d))) + } + fmt.Printf("\n\n\n") +} diff --git a/leetcode/0623.Add-One-Row-to-Tree/README.md b/leetcode/0623.Add-One-Row-to-Tree/README.md new file mode 100644 index 00000000..05f39a43 --- /dev/null +++ b/leetcode/0623.Add-One-Row-to-Tree/README.md @@ -0,0 +1,110 @@ +# [623. Add One Row to Tree](https://leetcode.com/problems/add-one-row-to-tree/) + + +## 题目 + +Given the root of a binary tree, then value `v` and depth `d`, you need to add a row of nodes with value `v` at the given depth `d`. The root node is at depth 1. + +The adding rule is: given a positive integer depth `d`, for each NOT null tree nodes `N` in depth `d-1`, create two tree nodes with value `v` as `N's` left subtree root and right subtree root. And `N's` **original left subtree** should be the left subtree of the new left subtree root, its **original right subtree** should be the right subtree of the new right subtree root. If depth `d` is 1 that means there is no depth d-1 at all, then create a tree node with value **v** as the new root of the whole original tree, and the original tree is the new root's left subtree. + +**Example 1:** + +``` +Input: +A binary tree as following: + 4 + / \ + 2 6 + / \ / + 3 1 5 + +v = 1d = 2Output: + 4 + / \ + 1 1 + / \ + 2 6 + / \ / + 3 1 5 +``` + +**Example 2:** + +``` +Input: +A binary tree as following: + 4 + / + 2 + / \ + 3 1 + +v = 1d = 3Output: + 4 + / + 2 + / \ + 1 1 + / \ +3 1 +``` + +**Note:** + +1. The given d is in range [1, maximum depth of the given tree + 1]. +2. The given binary tree has at least one tree node. + +## 题目大意 + +给定一个二叉树,根节点为第1层,深度为 1。在其第 d 层追加一行值为 v 的节点。添加规则:给定一个深度值 d (正整数),针对深度为 d-1 层的每一非空节点 N,为 N 创建两个值为 v 的左子树和右子树。将 N 原先的左子树,连接为新节点 v 的左子树;将 N 原先的右子树,连接为新节点 v 的右子树。如果 d 的值为 1,深度 d - 1 不存在,则创建一个新的根节点 v,原先的整棵树将作为 v 的左子树。 + +## 解题思路 + +- 这一题虽然是 Medium,实际非常简单。给二叉树添加一行,用 DFS 或者 BFS,遍历过程中记录行数,到达目标行一行,增加节点即可。不过需要注意 2 个特殊情况,特殊情况一,`d==1`,此时需要添加的行即为根节点。特殊情况二,`d>height(root)`,即要添加的行数比树还要高,这时只需要在最下层的叶子节点添加一层。时间复杂度 O(n),空间复杂度 O(n)。 + +## 代码 + +```go +package leetcode + +import ( + "github.com/halfrost/LeetCode-Go/structures" +) + +// TreeNode define +type TreeNode = structures.TreeNode + +/** + * Definition for a binary tree node. + * type TreeNode struct { + * Val int + * Left *TreeNode + * Right *TreeNode + * } + */ +func addOneRow(root *TreeNode, v int, d int) *TreeNode { + if d == 1 { + tmp := &TreeNode{Val: v, Left: root, Right: nil} + return tmp + } + level := 1 + addTreeRow(root, v, d, &level) + return root +} + +func addTreeRow(root *TreeNode, v, d int, currLevel *int) { + if *currLevel == d-1 { + root.Left = &TreeNode{Val: v, Left: root.Left, Right: nil} + root.Right = &TreeNode{Val: v, Left: nil, Right: root.Right} + return + } + *currLevel++ + if root.Left != nil { + addTreeRow(root.Left, v, d, currLevel) + } + if root.Right != nil { + addTreeRow(root.Right, v, d, currLevel) + } + *currLevel-- +} +``` \ No newline at end of file diff --git a/website/content/ChapterFour/0600~0699/0605.Can-Place-Flowers.md b/website/content/ChapterFour/0600~0699/0605.Can-Place-Flowers.md index 0e26b084..43bca59e 100644 --- a/website/content/ChapterFour/0600~0699/0605.Can-Place-Flowers.md +++ b/website/content/ChapterFour/0600~0699/0605.Can-Place-Flowers.md @@ -63,5 +63,5 @@ func canPlaceFlowers(flowerbed []int, n int) bool { ----------------------------------------------

⬅️上一页

-

下一页➡️

+

下一页➡️

diff --git a/website/content/ChapterFour/0600~0699/0623.Add-One-Row-to-Tree.md b/website/content/ChapterFour/0600~0699/0623.Add-One-Row-to-Tree.md new file mode 100644 index 00000000..e209f96f --- /dev/null +++ b/website/content/ChapterFour/0600~0699/0623.Add-One-Row-to-Tree.md @@ -0,0 +1,117 @@ +# [623. Add One Row to Tree](https://leetcode.com/problems/add-one-row-to-tree/) + + +## 题目 + +Given the root of a binary tree, then value `v` and depth `d`, you need to add a row of nodes with value `v` at the given depth `d`. The root node is at depth 1. + +The adding rule is: given a positive integer depth `d`, for each NOT null tree nodes `N` in depth `d-1`, create two tree nodes with value `v` as `N's` left subtree root and right subtree root. And `N's` **original left subtree** should be the left subtree of the new left subtree root, its **original right subtree** should be the right subtree of the new right subtree root. If depth `d` is 1 that means there is no depth d-1 at all, then create a tree node with value **v** as the new root of the whole original tree, and the original tree is the new root's left subtree. + +**Example 1:** + +``` +Input: +A binary tree as following: + 4 + / \ + 2 6 + / \ / + 3 1 5 + +v = 1d = 2Output: + 4 + / \ + 1 1 + / \ + 2 6 + / \ / + 3 1 5 +``` + +**Example 2:** + +``` +Input: +A binary tree as following: + 4 + / + 2 + / \ + 3 1 + +v = 1d = 3Output: + 4 + / + 2 + / \ + 1 1 + / \ +3 1 +``` + +**Note:** + +1. The given d is in range [1, maximum depth of the given tree + 1]. +2. The given binary tree has at least one tree node. + +## 题目大意 + +给定一个二叉树,根节点为第1层,深度为 1。在其第 d 层追加一行值为 v 的节点。添加规则:给定一个深度值 d (正整数),针对深度为 d-1 层的每一非空节点 N,为 N 创建两个值为 v 的左子树和右子树。将 N 原先的左子树,连接为新节点 v 的左子树;将 N 原先的右子树,连接为新节点 v 的右子树。如果 d 的值为 1,深度 d - 1 不存在,则创建一个新的根节点 v,原先的整棵树将作为 v 的左子树。 + +## 解题思路 + +- 这一题虽然是 Medium,实际非常简单。给二叉树添加一行,用 DFS 或者 BFS,遍历过程中记录行数,到达目标行一行,增加节点即可。不过需要注意 2 个特殊情况,特殊情况一,`d==1`,此时需要添加的行即为根节点。特殊情况二,`d>height(root)`,即要添加的行数比树还要高,这时只需要在最下层的叶子节点添加一层。时间复杂度 O(n),空间复杂度 O(n)。 + +## 代码 + +```go +package leetcode + +import ( + "github.com/halfrost/LeetCode-Go/structures" +) + +// TreeNode define +type TreeNode = structures.TreeNode + +/** + * Definition for a binary tree node. + * type TreeNode struct { + * Val int + * Left *TreeNode + * Right *TreeNode + * } + */ +func addOneRow(root *TreeNode, v int, d int) *TreeNode { + if d == 1 { + tmp := &TreeNode{Val: v, Left: root, Right: nil} + return tmp + } + level := 1 + addTreeRow(root, v, d, &level) + return root +} + +func addTreeRow(root *TreeNode, v, d int, currLevel *int) { + if *currLevel == d-1 { + root.Left = &TreeNode{Val: v, Left: root.Left, Right: nil} + root.Right = &TreeNode{Val: v, Left: nil, Right: root.Right} + return + } + *currLevel++ + if root.Left != nil { + addTreeRow(root.Left, v, d, currLevel) + } + if root.Right != nil { + addTreeRow(root.Right, v, d, currLevel) + } + *currLevel-- +} +``` + + +---------------------------------------------- +
+

⬅️上一页

+

下一页➡️

+
diff --git a/website/content/ChapterFour/0600~0699/0628.Maximum-Product-of-Three-Numbers.md b/website/content/ChapterFour/0600~0699/0628.Maximum-Product-of-Three-Numbers.md index 94180ac3..db97a391 100755 --- a/website/content/ChapterFour/0600~0699/0628.Maximum-Product-of-Three-Numbers.md +++ b/website/content/ChapterFour/0600~0699/0628.Maximum-Product-of-Three-Numbers.md @@ -105,6 +105,6 @@ func maximumProduct1(nums []int) int { ----------------------------------------------
-

⬅️上一页

+

⬅️上一页

下一页➡️

diff --git a/website/content/ChapterTwo/Array.md b/website/content/ChapterTwo/Array.md index b10350b9..6f9d5095 100644 --- a/website/content/ChapterTwo/Array.md +++ b/website/content/ChapterTwo/Array.md @@ -63,7 +63,7 @@ weight: 1 |0209|Minimum Size Subarray Sum|[Go]({{< relref "/ChapterFour/0200~0299/0209.Minimum-Size-Subarray-Sum.md" >}})|Medium| O(n)| O(1)||39.5%| |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.6%| +|0219|Contains Duplicate II|[Go]({{< relref "/ChapterFour/0200~0299/0219.Contains-Duplicate-II.md" >}})|Easy| O(n)| O(n)||38.7%| |0228|Summary Ranges|[Go]({{< relref "/ChapterFour/0200~0299/0228.Summary-Ranges.md" >}})|Easy||||42.5%| |0229|Majority Element II|[Go]({{< relref "/ChapterFour/0200~0299/0229.Majority-Element-II.md" >}})|Medium||||38.8%| |0268|Missing Number|[Go]({{< relref "/ChapterFour/0200~0299/0268.Missing-Number.md" >}})|Easy||||54.9%| @@ -128,11 +128,11 @@ weight: 1 |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%| -|1208|Get Equal Substrings Within Budget|[Go]({{< relref "/ChapterFour/1200~1299/1208.Get-Equal-Substrings-Within-Budget.md" >}})|Medium||||44.1%| +|1208|Get Equal Substrings Within Budget|[Go]({{< relref "/ChapterFour/1200~1299/1208.Get-Equal-Substrings-Within-Budget.md" >}})|Medium||||44.0%| |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%| |1252|Cells with Odd Values in a Matrix|[Go]({{< relref "/ChapterFour/1200~1299/1252.Cells-with-Odd-Values-in-a-Matrix.md" >}})|Easy||||78.9%| -|1260|Shift 2D Grid|[Go]({{< relref "/ChapterFour/1200~1299/1260.Shift-2D-Grid.md" >}})|Easy||||61.9%| +|1260|Shift 2D Grid|[Go]({{< relref "/ChapterFour/1200~1299/1260.Shift-2D-Grid.md" >}})|Easy||||61.8%| |1266|Minimum Time Visiting All Points|[Go]({{< relref "/ChapterFour/1200~1299/1266.Minimum-Time-Visiting-All-Points.md" >}})|Easy||||79.4%| |1275|Find Winner on a Tic Tac Toe Game|[Go]({{< relref "/ChapterFour/1200~1299/1275.Find-Winner-on-a-Tic-Tac-Toe-Game.md" >}})|Easy||||52.9%| |1287|Element Appearing More Than 25% In Sorted Array|[Go]({{< relref "/ChapterFour/1200~1299/1287.Element-Appearing-More-Than-25-In-Sorted-Array.md" >}})|Easy||||60.1%| @@ -141,7 +141,7 @@ weight: 1 |1300|Sum of Mutated Array Closest to Target|[Go]({{< relref "/ChapterFour/1300~1399/1300.Sum-of-Mutated-Array-Closest-to-Target.md" >}})|Medium||||43.0%| |1304|Find N Unique Integers Sum up to Zero|[Go]({{< relref "/ChapterFour/1300~1399/1304.Find-N-Unique-Integers-Sum-up-to-Zero.md" >}})|Easy||||76.8%| |1313|Decompress Run-Length Encoded List|[Go]({{< relref "/ChapterFour/1300~1399/1313.Decompress-Run-Length-Encoded-List.md" >}})|Easy||||85.4%| -|1329|Sort the Matrix Diagonally|[Go]({{< relref "/ChapterFour/1300~1399/1329.Sort-the-Matrix-Diagonally.md" >}})|Medium||||81.7%| +|1329|Sort the Matrix Diagonally|[Go]({{< relref "/ChapterFour/1300~1399/1329.Sort-the-Matrix-Diagonally.md" >}})|Medium||||81.8%| |1337|The K Weakest Rows in a Matrix|[Go]({{< relref "/ChapterFour/1300~1399/1337.The-K-Weakest-Rows-in-a-Matrix.md" >}})|Easy||||72.0%| |1380|Lucky Numbers in a Matrix|[Go]({{< relref "/ChapterFour/1300~1399/1380.Lucky-Numbers-in-a-Matrix.md" >}})|Easy||||70.5%| |1385|Find the Distance Value Between Two Arrays|[Go]({{< relref "/ChapterFour/1300~1399/1385.Find-the-Distance-Value-Between-Two-Arrays.md" >}})|Easy||||66.3%| @@ -156,8 +156,8 @@ weight: 1 |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%| |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.2%| -|1636|Sort Array by Increasing Frequency|[Go]({{< relref "/ChapterFour/1600~1699/1636.Sort-Array-by-Increasing-Frequency.md" >}})|Easy||||66.9%| +|1629|Slowest Key|[Go]({{< relref "/ChapterFour/1600~1699/1629.Slowest-Key.md" >}})|Easy||||59.1%| +|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%| @@ -165,10 +165,10 @@ weight: 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%| -|1742|Maximum Number of Balls in a Box|[Go]({{< relref "/ChapterFour/1700~1799/1742.Maximum-Number-of-Balls-in-a-Box.md" >}})|Easy||||74.8%| +|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%| -|1758|Minimum Changes To Make Alternating Binary String|[Go]({{< relref "/ChapterFour/1700~1799/1758.Minimum-Changes-To-Make-Alternating-Binary-String.md" >}})|Easy||||59.0%| +|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 ab51fe03..c87d052d 100644 --- a/website/content/ChapterTwo/Backtracking.md +++ b/website/content/ChapterTwo/Backtracking.md @@ -102,12 +102,12 @@ func updateMatrix_BFS(matrix [][]int) [][]int { |:--------:|:------- | :--------: | :----------: | :----: | :-----: | :-----: |:-----: | |0017|Letter Combinations of a Phone Number|[Go]({{< relref "/ChapterFour/0001~0099/0017.Letter-Combinations-of-a-Phone-Number.md" >}})|Medium| O(log n)| O(1)||49.2%| |0022|Generate Parentheses|[Go]({{< relref "/ChapterFour/0001~0099/0022.Generate-Parentheses.md" >}})|Medium| O(log n)| O(1)||65.4%| -|0037|Sudoku Solver|[Go]({{< relref "/ChapterFour/0001~0099/0037.Sudoku-Solver.md" >}})|Hard| O(n^2)| O(n^2)|❤️|46.6%| +|0037|Sudoku Solver|[Go]({{< relref "/ChapterFour/0001~0099/0037.Sudoku-Solver.md" >}})|Hard| O(n^2)| O(n^2)|❤️|46.7%| |0039|Combination Sum|[Go]({{< relref "/ChapterFour/0001~0099/0039.Combination-Sum.md" >}})|Medium| O(n log n)| O(n)||59.4%| |0040|Combination Sum II|[Go]({{< relref "/ChapterFour/0001~0099/0040.Combination-Sum-II.md" >}})|Medium| O(n log n)| O(n)||50.2%| |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.7%| +|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%| |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%| diff --git a/website/content/ChapterTwo/Binary_Indexed_Tree.md b/website/content/ChapterTwo/Binary_Indexed_Tree.md index d2829985..ddcf4ae8 100644 --- a/website/content/ChapterTwo/Binary_Indexed_Tree.md +++ b/website/content/ChapterTwo/Binary_Indexed_Tree.md @@ -13,7 +13,7 @@ weight: 19 |0218|The Skyline Problem|[Go]({{< relref "/ChapterFour/0200~0299/0218.The-Skyline-Problem.md" >}})|Hard||||36.4%| |0307|Range Sum Query - Mutable|[Go]({{< relref "/ChapterFour/0300~0399/0307.Range-Sum-Query-Mutable.md" >}})|Medium||||36.8%| |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.0%| +|0327|Count of Range Sum|[Go]({{< relref "/ChapterFour/0300~0399/0327.Count-of-Range-Sum.md" >}})|Hard||||36.1%| |0493|Reverse Pairs|[Go]({{< relref "/ChapterFour/0400~0499/0493.Reverse-Pairs.md" >}})|Hard||||26.9%| |1649|Create Sorted Array through Instructions|[Go]({{< relref "/ChapterFour/1600~1699/1649.Create-Sorted-Array-through-Instructions.md" >}})|Hard||||36.4%| |------------|-------------------------------------------------------|-------| ----------------| ---------------|-------------|-------------|-------------| diff --git a/website/content/ChapterTwo/Binary_Search.md b/website/content/ChapterTwo/Binary_Search.md index dab00964..3caeba06 100644 --- a/website/content/ChapterTwo/Binary_Search.md +++ b/website/content/ChapterTwo/Binary_Search.md @@ -153,10 +153,10 @@ func peakIndexInMountainArray(A []int) int { |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%| |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.0%| +|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%| |0350|Intersection of Two Arrays II|[Go]({{< relref "/ChapterFour/0300~0399/0350.Intersection-of-Two-Arrays-II.md" >}})|Easy| O(n)| O(n) ||52.0%| -|0354|Russian Doll Envelopes|[Go]({{< relref "/ChapterFour/0300~0399/0354.Russian-Doll-Envelopes.md" >}})|Hard||||36.3%| +|0354|Russian Doll Envelopes|[Go]({{< relref "/ChapterFour/0300~0399/0354.Russian-Doll-Envelopes.md" >}})|Hard||||36.4%| |0367|Valid Perfect Square|[Go]({{< relref "/ChapterFour/0300~0399/0367.Valid-Perfect-Square.md" >}})|Easy||||42.0%| |0378|Kth Smallest Element in a Sorted Matrix|[Go]({{< relref "/ChapterFour/0300~0399/0378.Kth-Smallest-Element-in-a-Sorted-Matrix.md" >}})|Medium||||56.2%| |0392|Is Subsequence|[Go]({{< relref "/ChapterFour/0300~0399/0392.Is-Subsequence.md" >}})|Easy| O(n)| O(1)||49.5%| @@ -196,7 +196,7 @@ func peakIndexInMountainArray(A []int) int { |1283|Find the Smallest Divisor Given a Threshold|[Go]({{< relref "/ChapterFour/1200~1299/1283.Find-the-Smallest-Divisor-Given-a-Threshold.md" >}})|Medium||||49.6%| |1300|Sum of Mutated Array Closest to Target|[Go]({{< relref "/ChapterFour/1300~1399/1300.Sum-of-Mutated-Array-Closest-to-Target.md" >}})|Medium||||43.0%| |1337|The K Weakest Rows in a Matrix|[Go]({{< relref "/ChapterFour/1300~1399/1337.The-K-Weakest-Rows-in-a-Matrix.md" >}})|Easy||||72.0%| -|1631|Path With Minimum Effort|[Go]({{< relref "/ChapterFour/1600~1699/1631.Path-With-Minimum-Effort.md" >}})|Medium||||50.0%| +|1631|Path With Minimum Effort|[Go]({{< relref "/ChapterFour/1600~1699/1631.Path-With-Minimum-Effort.md" >}})|Medium||||50.1%| |1649|Create Sorted Array through Instructions|[Go]({{< relref "/ChapterFour/1600~1699/1649.Create-Sorted-Array-through-Instructions.md" >}})|Hard||||36.4%| |1658|Minimum Operations to Reduce X to Zero|[Go]({{< relref "/ChapterFour/1600~1699/1658.Minimum-Operations-to-Reduce-X-to-Zero.md" >}})|Medium||||33.4%| |------------|-------------------------------------------------------|-------| ----------------| ---------------|-------------|-------------|-------------| diff --git a/website/content/ChapterTwo/Bit_Manipulation.md b/website/content/ChapterTwo/Bit_Manipulation.md index 01ebf37c..ab6beb39 100644 --- a/website/content/ChapterTwo/Bit_Manipulation.md +++ b/website/content/ChapterTwo/Bit_Manipulation.md @@ -49,7 +49,7 @@ X & ~X = 0 |0137|Single Number II|[Go]({{< relref "/ChapterFour/0100~0199/0137.Single-Number-II.md" >}})|Medium| O(n)| O(1)|❤️|53.9%| |0169|Majority Element|[Go]({{< relref "/ChapterFour/0100~0199/0169.Majority-Element.md" >}})|Easy| O(n)| O(1)|❤️|60.1%| |0187|Repeated DNA Sequences|[Go]({{< relref "/ChapterFour/0100~0199/0187.Repeated-DNA-Sequences.md" >}})|Medium| O(n)| O(1)||41.5%| -|0190|Reverse Bits|[Go]({{< relref "/ChapterFour/0100~0199/0190.Reverse-Bits.md" >}})|Easy| O(n)| O(1)|❤️|42.2%| +|0190|Reverse Bits|[Go]({{< relref "/ChapterFour/0100~0199/0190.Reverse-Bits.md" >}})|Easy| O(n)| O(1)|❤️|42.3%| |0191|Number of 1 Bits|[Go]({{< relref "/ChapterFour/0100~0199/0191.Number-of-1-Bits.md" >}})|Easy| O(n)| O(1)||53.9%| |0201|Bitwise AND of Numbers Range|[Go]({{< relref "/ChapterFour/0200~0299/0201.Bitwise-AND-of-Numbers-Range.md" >}})|Medium| O(n)| O(1)|❤️|39.6%| |0231|Power of Two|[Go]({{< relref "/ChapterFour/0200~0299/0231.Power-of-Two.md" >}})|Easy| O(1)| O(1)||43.8%| diff --git a/website/content/ChapterTwo/Breadth_First_Search.md b/website/content/ChapterTwo/Breadth_First_Search.md index ba518e82..bf0e9f07 100644 --- a/website/content/ChapterTwo/Breadth_First_Search.md +++ b/website/content/ChapterTwo/Breadth_First_Search.md @@ -21,7 +21,7 @@ weight: 10 |0200|Number of Islands|[Go]({{< relref "/ChapterFour/0200~0299/0200.Number-of-Islands.md" >}})|Medium| O(n^2)| O(n^2)||49.2%| |0207|Course Schedule|[Go]({{< relref "/ChapterFour/0200~0299/0207.Course-Schedule.md" >}})|Medium| O(n^2)| O(n^2)||44.3%| |0210|Course Schedule II|[Go]({{< relref "/ChapterFour/0200~0299/0210.Course-Schedule-II.md" >}})|Medium| O(n^2)| O(n^2)||42.7%| -|0513|Find Bottom Left Tree Value|[Go]({{< relref "/ChapterFour/0500~0599/0513.Find-Bottom-Left-Tree-Value.md" >}})|Medium||||62.6%| +|0513|Find Bottom Left Tree Value|[Go]({{< relref "/ChapterFour/0500~0599/0513.Find-Bottom-Left-Tree-Value.md" >}})|Medium||||62.7%| |0515|Find Largest Value in Each Tree Row|[Go]({{< relref "/ChapterFour/0500~0599/0515.Find-Largest-Value-in-Each-Tree-Row.md" >}})|Medium| O(n)| O(n)||62.3%| |0529|Minesweeper|[Go]({{< relref "/ChapterFour/0500~0599/0529.Minesweeper.md" >}})|Medium||||61.2%| |0542|01 Matrix|[Go]({{< relref "/ChapterFour/0500~0599/0542.01-Matrix.md" >}})|Medium| O(n)| O(1)||41.0%| diff --git a/website/content/ChapterTwo/Depth_First_Search.md b/website/content/ChapterTwo/Depth_First_Search.md index ec25d7fb..80bf681f 100644 --- a/website/content/ChapterTwo/Depth_First_Search.md +++ b/website/content/ChapterTwo/Depth_First_Search.md @@ -39,14 +39,14 @@ weight: 9 |0394|Decode String|[Go]({{< relref "/ChapterFour/0300~0399/0394.Decode-String.md" >}})|Medium| O(n)| O(n)||52.7%| |0491|Increasing Subsequences|[Go]({{< relref "/ChapterFour/0400~0499/0491.Increasing-Subsequences.md" >}})|Medium||||47.5%| |0494|Target Sum|[Go]({{< relref "/ChapterFour/0400~0499/0494.Target-Sum.md" >}})|Medium||||45.7%| -|0513|Find Bottom Left Tree Value|[Go]({{< relref "/ChapterFour/0500~0599/0513.Find-Bottom-Left-Tree-Value.md" >}})|Medium||||62.6%| +|0513|Find Bottom Left Tree Value|[Go]({{< relref "/ChapterFour/0500~0599/0513.Find-Bottom-Left-Tree-Value.md" >}})|Medium||||62.7%| |0515|Find Largest Value in Each Tree Row|[Go]({{< relref "/ChapterFour/0500~0599/0515.Find-Largest-Value-in-Each-Tree-Row.md" >}})|Medium| O(n)| O(n)||62.3%| |0526|Beautiful Arrangement|[Go]({{< relref "/ChapterFour/0500~0599/0526.Beautiful-Arrangement.md" >}})|Medium||||61.9%| |0529|Minesweeper|[Go]({{< relref "/ChapterFour/0500~0599/0529.Minesweeper.md" >}})|Medium||||61.2%| |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.0%| +|0563|Binary Tree Tilt|[Go]({{< relref "/ChapterFour/0500~0599/0563.Binary-Tree-Tilt.md" >}})|Easy||||53.1%| |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%| @@ -72,7 +72,7 @@ weight: 9 |0979|Distribute Coins in Binary Tree|[Go]({{< relref "/ChapterFour/0900~0999/0979.Distribute-Coins-in-Binary-Tree.md" >}})|Medium||||69.8%| |0980|Unique Paths III|[Go]({{< relref "/ChapterFour/0900~0999/0980.Unique-Paths-III.md" >}})|Hard| O(n log n)| O(n)||77.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%| -|1020|Number of Enclaves|[Go]({{< relref "/ChapterFour/1000~1099/1020.Number-of-Enclaves.md" >}})|Medium||||59.0%| +|1020|Number of Enclaves|[Go]({{< relref "/ChapterFour/1000~1099/1020.Number-of-Enclaves.md" >}})|Medium||||59.1%| |1026|Maximum Difference Between Node and Ancestor|[Go]({{< relref "/ChapterFour/1000~1099/1026.Maximum-Difference-Between-Node-and-Ancestor.md" >}})|Medium||||69.5%| |1028|Recover a Tree From Preorder Traversal|[Go]({{< relref "/ChapterFour/1000~1099/1028.Recover-a-Tree-From-Preorder-Traversal.md" >}})|Hard||||70.9%| |1038|Binary Search Tree to Greater Sum Tree|[Go]({{< relref "/ChapterFour/1000~1099/1038.Binary-Search-Tree-to-Greater-Sum-Tree.md" >}})|Medium||||82.4%| @@ -84,7 +84,7 @@ weight: 9 |1302|Deepest Leaves Sum|[Go]({{< relref "/ChapterFour/1300~1399/1302.Deepest-Leaves-Sum.md" >}})|Medium||||84.2%| |1306|Jump Game III|[Go]({{< relref "/ChapterFour/1300~1399/1306.Jump-Game-III.md" >}})|Medium||||62.4%| |1319|Number of Operations to Make Network Connected|[Go]({{< relref "/ChapterFour/1300~1399/1319.Number-of-Operations-to-Make-Network-Connected.md" >}})|Medium||||55.5%| -|1631|Path With Minimum Effort|[Go]({{< relref "/ChapterFour/1600~1699/1631.Path-With-Minimum-Effort.md" >}})|Medium||||50.0%| +|1631|Path With Minimum Effort|[Go]({{< relref "/ChapterFour/1600~1699/1631.Path-With-Minimum-Effort.md" >}})|Medium||||50.1%| |------------|-------------------------------------------------------|-------| ----------------| ---------------|-------------|-------------|-------------| diff --git a/website/content/ChapterTwo/Dynamic_Programming.md b/website/content/ChapterTwo/Dynamic_Programming.md index aa51e2d1..794e361a 100644 --- a/website/content/ChapterTwo/Dynamic_Programming.md +++ b/website/content/ChapterTwo/Dynamic_Programming.md @@ -34,7 +34,7 @@ weight: 7 |0337|House Robber III|[Go]({{< relref "/ChapterFour/0300~0399/0337.House-Robber-III.md" >}})|Medium||||51.9%| |0338|Counting Bits|[Go]({{< relref "/ChapterFour/0300~0399/0338.Counting-Bits.md" >}})|Medium| O(n)| O(n)||70.4%| |0343|Integer Break|[Go]({{< relref "/ChapterFour/0300~0399/0343.Integer-Break.md" >}})|Medium| O(n^2)| O(n)||51.2%| -|0354|Russian Doll Envelopes|[Go]({{< relref "/ChapterFour/0300~0399/0354.Russian-Doll-Envelopes.md" >}})|Hard||||36.3%| +|0354|Russian Doll Envelopes|[Go]({{< relref "/ChapterFour/0300~0399/0354.Russian-Doll-Envelopes.md" >}})|Hard||||36.4%| |0357|Count Numbers with Unique Digits|[Go]({{< relref "/ChapterFour/0300~0399/0357.Count-Numbers-with-Unique-Digits.md" >}})|Medium| O(1)| O(1)||48.9%| |0392|Is Subsequence|[Go]({{< relref "/ChapterFour/0300~0399/0392.Is-Subsequence.md" >}})|Easy| O(n)| O(1)||49.5%| |0410|Split Array Largest Sum|[Go]({{< relref "/ChapterFour/0400~0499/0410.Split-Array-Largest-Sum.md" >}})|Hard||||46.4%| @@ -49,7 +49,7 @@ weight: 7 |0838|Push Dominoes|[Go]({{< relref "/ChapterFour/0800~0899/0838.Push-Dominoes.md" >}})|Medium| O(n)| O(n)||49.9%| |0887|Super Egg Drop|[Go]({{< relref "/ChapterFour/0800~0899/0887.Super-Egg-Drop.md" >}})|Hard||||27.0%| |0898|Bitwise ORs of Subarrays|[Go]({{< relref "/ChapterFour/0800~0899/0898.Bitwise-ORs-of-Subarrays.md" >}})|Medium||||34.3%| -|0920|Number of Music Playlists|[Go]({{< relref "/ChapterFour/0900~0999/0920.Number-of-Music-Playlists.md" >}})|Hard||||47.7%| +|0920|Number of Music Playlists|[Go]({{< relref "/ChapterFour/0900~0999/0920.Number-of-Music-Playlists.md" >}})|Hard||||47.8%| |0968|Binary Tree Cameras|[Go]({{< relref "/ChapterFour/0900~0999/0968.Binary-Tree-Cameras.md" >}})|Hard||||38.8%| |0978|Longest Turbulent Subarray|[Go]({{< relref "/ChapterFour/0900~0999/0978.Longest-Turbulent-Subarray.md" >}})|Medium||||46.7%| |1025|Divisor Game|[Go]({{< relref "/ChapterFour/1000~1099/1025.Divisor-Game.md" >}})|Easy| O(1)| O(1)||66.1%| diff --git a/website/content/ChapterTwo/Hash_Table.md b/website/content/ChapterTwo/Hash_Table.md index f487fb6b..19a2a2ac 100644 --- a/website/content/ChapterTwo/Hash_Table.md +++ b/website/content/ChapterTwo/Hash_Table.md @@ -10,11 +10,11 @@ weight: 13 | No. | Title | Solution | Difficulty | TimeComplexity | SpaceComplexity |Favorite| Acceptance | |:--------:|:------- | :--------: | :----------: | :----: | :-----: | :-----: |:-----: | |0001|Two Sum|[Go]({{< relref "/ChapterFour/0001~0099/0001.Two-Sum.md" >}})|Easy| O(n)| O(n)||46.5%| -|0003|Longest Substring Without Repeating Characters|[Go]({{< relref "/ChapterFour/0001~0099/0003.Longest-Substring-Without-Repeating-Characters.md" >}})|Medium| O(n)| O(1)|❤️|31.4%| +|0003|Longest Substring Without Repeating Characters|[Go]({{< relref "/ChapterFour/0001~0099/0003.Longest-Substring-Without-Repeating-Characters.md" >}})|Medium| O(n)| O(1)|❤️|31.5%| |0018|4Sum|[Go]({{< relref "/ChapterFour/0001~0099/0018.4Sum.md" >}})|Medium| O(n^3)| O(n^2)|❤️|34.9%| |0030|Substring with Concatenation of All Words|[Go]({{< relref "/ChapterFour/0001~0099/0030.Substring-with-Concatenation-of-All-Words.md" >}})|Hard| O(n)| O(n)|❤️|26.2%| -|0036|Valid Sudoku|[Go]({{< relref "/ChapterFour/0001~0099/0036.Valid-Sudoku.md" >}})|Medium| O(n^2)| O(n^2)||50.6%| -|0037|Sudoku Solver|[Go]({{< relref "/ChapterFour/0001~0099/0037.Sudoku-Solver.md" >}})|Hard| O(n^2)| O(n^2)|❤️|46.6%| +|0036|Valid Sudoku|[Go]({{< relref "/ChapterFour/0001~0099/0036.Valid-Sudoku.md" >}})|Medium| O(n^2)| O(n^2)||50.7%| +|0037|Sudoku Solver|[Go]({{< relref "/ChapterFour/0001~0099/0037.Sudoku-Solver.md" >}})|Hard| O(n^2)| O(n^2)|❤️|46.7%| |0049|Group Anagrams|[Go]({{< relref "/ChapterFour/0001~0099/0049.Group-Anagrams.md" >}})|Medium| O(n log n)| O(n)||59.4%| |0076|Minimum Window Substring|[Go]({{< relref "/ChapterFour/0001~0099/0076.Minimum-Window-Substring.md" >}})|Hard| O(n)| O(n)|❤️|36.0%| |0094|Binary Tree Inorder Traversal|[Go]({{< relref "/ChapterFour/0001~0099/0094.Binary-Tree-Inorder-Traversal.md" >}})|Medium| O(n)| O(1)||66.0%| @@ -25,11 +25,11 @@ weight: 13 |0204|Count Primes|[Go]({{< relref "/ChapterFour/0200~0299/0204.Count-Primes.md" >}})|Easy||||32.3%| |0205|Isomorphic Strings|[Go]({{< relref "/ChapterFour/0200~0299/0205.Isomorphic-Strings.md" >}})|Easy| O(log n)| O(n)||40.5%| |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.6%| +|0219|Contains Duplicate II|[Go]({{< relref "/ChapterFour/0200~0299/0219.Contains-Duplicate-II.md" >}})|Easy| O(n)| O(n)||38.7%| |0242|Valid Anagram|[Go]({{< relref "/ChapterFour/0200~0299/0242.Valid-Anagram.md" >}})|Easy| O(n)| O(n) ||58.6%| |0274|H-Index|[Go]({{< relref "/ChapterFour/0200~0299/0274.H-Index.md" >}})|Medium| O(n)| O(n) ||36.4%| |0290|Word Pattern|[Go]({{< relref "/ChapterFour/0200~0299/0290.Word-Pattern.md" >}})|Easy| O(n)| O(n) ||38.4%| -|0347|Top K Frequent Elements|[Go]({{< relref "/ChapterFour/0300~0399/0347.Top-K-Frequent-Elements.md" >}})|Medium| O(n)| O(n) ||62.4%| +|0347|Top K Frequent Elements|[Go]({{< relref "/ChapterFour/0300~0399/0347.Top-K-Frequent-Elements.md" >}})|Medium| O(n)| O(n) ||62.5%| |0349|Intersection of Two Arrays|[Go]({{< relref "/ChapterFour/0300~0399/0349.Intersection-of-Two-Arrays.md" >}})|Easy| O(n)| O(n) ||64.9%| |0350|Intersection of Two Arrays II|[Go]({{< relref "/ChapterFour/0300~0399/0350.Intersection-of-Two-Arrays-II.md" >}})|Easy| O(n)| O(n) ||52.0%| |0387|First Unique Character in a String|[Go]({{< relref "/ChapterFour/0300~0399/0387.First-Unique-Character-in-a-String.md" >}})|Easy||||53.8%| @@ -46,11 +46,11 @@ 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.2%| +|0645|Set Mismatch|[Go]({{< relref "/ChapterFour/0600~0699/0645.Set-Mismatch.md" >}})|Easy||||42.1%| |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%| -|0706|Design HashMap|[Go]({{< relref "/ChapterFour/0700~0799/0706.Design-HashMap.md" >}})|Easy||||64.2%| +|0706|Design HashMap|[Go]({{< relref "/ChapterFour/0700~0799/0706.Design-HashMap.md" >}})|Easy||||64.3%| |0710|Random Pick with Blacklist|[Go]({{< relref "/ChapterFour/0700~0799/0710.Random-Pick-with-Blacklist.md" >}})|Hard| O(n)| O(n) ||32.9%| |0718|Maximum Length of Repeated Subarray|[Go]({{< relref "/ChapterFour/0700~0799/0718.Maximum-Length-of-Repeated-Subarray.md" >}})|Medium||||50.4%| |0720|Longest Word in Dictionary|[Go]({{< relref "/ChapterFour/0700~0799/0720.Longest-Word-in-Dictionary.md" >}})|Easy| O(n)| O(n) ||49.3%| diff --git a/website/content/ChapterTwo/Linked_List.md b/website/content/ChapterTwo/Linked_List.md index c686cd6b..d06f2d12 100644 --- a/website/content/ChapterTwo/Linked_List.md +++ b/website/content/ChapterTwo/Linked_List.md @@ -39,7 +39,7 @@ weight: 4 |0141|Linked List Cycle|[Go]({{< relref "/ChapterFour/0100~0199/0141.Linked-List-Cycle.md" >}})|Easy| O(n)| O(1)|❤️|42.9%| |0142|Linked List Cycle II|[Go]({{< relref "/ChapterFour/0100~0199/0142.Linked-List-Cycle-II.md" >}})|Medium| O(n)| O(1)|❤️|39.8%| |0143|Reorder List|[Go]({{< relref "/ChapterFour/0100~0199/0143.Reorder-List.md" >}})|Medium| O(n)| O(1)|❤️|40.7%| -|0147|Insertion Sort List|[Go]({{< relref "/ChapterFour/0100~0199/0147.Insertion-Sort-List.md" >}})|Medium| O(n)| O(1)|❤️|44.4%| +|0147|Insertion Sort List|[Go]({{< relref "/ChapterFour/0100~0199/0147.Insertion-Sort-List.md" >}})|Medium| O(n)| O(1)|❤️|44.5%| |0148|Sort List|[Go]({{< relref "/ChapterFour/0100~0199/0148.Sort-List.md" >}})|Medium| O(n log n)| O(n)|❤️|46.4%| |0160|Intersection of Two Linked Lists|[Go]({{< relref "/ChapterFour/0100~0199/0160.Intersection-of-Two-Linked-Lists.md" >}})|Easy| O(n)| O(1)|❤️|44.1%| |0203|Remove Linked List Elements|[Go]({{< relref "/ChapterFour/0200~0299/0203.Remove-Linked-List-Elements.md" >}})|Easy| O(n)| O(1)||39.2%| @@ -55,7 +55,7 @@ weight: 4 |1019|Next Greater Node In Linked List|[Go]({{< relref "/ChapterFour/1000~1099/1019.Next-Greater-Node-In-Linked-List.md" >}})|Medium| O(n)| O(1)||58.3%| |1171|Remove Zero Sum Consecutive Nodes from Linked List|[Go]({{< relref "/ChapterFour/1100~1199/1171.Remove-Zero-Sum-Consecutive-Nodes-from-Linked-List.md" >}})|Medium||||41.5%| |1290|Convert Binary Number in a Linked List to Integer|[Go]({{< relref "/ChapterFour/1200~1299/1290.Convert-Binary-Number-in-a-Linked-List-to-Integer.md" >}})|Easy||||81.8%| -|1669|Merge In Between Linked Lists|[Go]({{< relref "/ChapterFour/1600~1699/1669.Merge-In-Between-Linked-Lists.md" >}})|Medium||||76.4%| +|1669|Merge In Between Linked Lists|[Go]({{< relref "/ChapterFour/1600~1699/1669.Merge-In-Between-Linked-Lists.md" >}})|Medium||||76.3%| |1670|Design Front Middle Back Queue|[Go]({{< relref "/ChapterFour/1600~1699/1670.Design-Front-Middle-Back-Queue.md" >}})|Medium||||54.4%| |------------|-------------------------------------------------------|-------| ----------------| ---------------|-------------|-------------|-------------| diff --git a/website/content/ChapterTwo/Math.md b/website/content/ChapterTwo/Math.md index 0650f1f8..6c7e5623 100644 --- a/website/content/ChapterTwo/Math.md +++ b/website/content/ChapterTwo/Math.md @@ -19,7 +19,7 @@ weight: 12 |0067|Add Binary|[Go]({{< relref "/ChapterFour/0001~0099/0067.Add-Binary.md" >}})|Easy||||47.0%| |0069|Sqrt(x)|[Go]({{< relref "/ChapterFour/0001~0099/0069.Sqrtx.md" >}})|Easy| O(log n)| O(1)||35.1%| |0168|Excel Sheet Column Title|[Go]({{< relref "/ChapterFour/0100~0199/0168.Excel-Sheet-Column-Title.md" >}})|Easy||||31.8%| -|0171|Excel Sheet Column Number|[Go]({{< relref "/ChapterFour/0100~0199/0171.Excel-Sheet-Column-Number.md" >}})|Easy||||56.9%| +|0171|Excel Sheet Column Number|[Go]({{< relref "/ChapterFour/0100~0199/0171.Excel-Sheet-Column-Number.md" >}})|Easy||||57.0%| |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%| @@ -33,7 +33,7 @@ weight: 12 |0343|Integer Break|[Go]({{< relref "/ChapterFour/0300~0399/0343.Integer-Break.md" >}})|Medium| O(n^2)| O(n)||51.2%| |0357|Count Numbers with Unique Digits|[Go]({{< relref "/ChapterFour/0300~0399/0357.Count-Numbers-with-Unique-Digits.md" >}})|Medium| O(1)| O(1)||48.9%| |0367|Valid Perfect Square|[Go]({{< relref "/ChapterFour/0300~0399/0367.Valid-Perfect-Square.md" >}})|Easy||||42.0%| -|0372|Super Pow|[Go]({{< relref "/ChapterFour/0300~0399/0372.Super-Pow.md" >}})|Medium||||36.7%| +|0372|Super Pow|[Go]({{< relref "/ChapterFour/0300~0399/0372.Super-Pow.md" >}})|Medium||||36.8%| |0397|Integer Replacement|[Go]({{< relref "/ChapterFour/0300~0399/0397.Integer-Replacement.md" >}})|Medium||||33.5%| |0413|Arithmetic Slices|[Go]({{< relref "/ChapterFour/0400~0499/0413.Arithmetic-Slices.md" >}})|Medium||||59.9%| |0441|Arranging Coins|[Go]({{< relref "/ChapterFour/0400~0499/0441.Arranging-Coins.md" >}})|Easy||||42.4%| @@ -45,7 +45,7 @@ weight: 12 |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.2%| +|0645|Set Mismatch|[Go]({{< relref "/ChapterFour/0600~0699/0645.Set-Mismatch.md" >}})|Easy||||42.1%| |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%| @@ -68,8 +68,8 @@ weight: 12 |1017|Convert to Base -2|[Go]({{< relref "/ChapterFour/1000~1099/1017.Convert-to-Base-2.md" >}})|Medium||||59.8%| |1025|Divisor Game|[Go]({{< relref "/ChapterFour/1000~1099/1025.Divisor-Game.md" >}})|Easy| O(1)| O(1)||66.1%| |1037|Valid Boomerang|[Go]({{< relref "/ChapterFour/1000~1099/1037.Valid-Boomerang.md" >}})|Easy||||37.8%| -|1073|Adding Two Negabinary Numbers|[Go]({{< relref "/ChapterFour/1000~1099/1073.Adding-Two-Negabinary-Numbers.md" >}})|Medium||||34.8%| -|1093|Statistics from a Large Sample|[Go]({{< relref "/ChapterFour/1000~1099/1093.Statistics-from-a-Large-Sample.md" >}})|Medium||||49.5%| +|1073|Adding Two Negabinary Numbers|[Go]({{< relref "/ChapterFour/1000~1099/1073.Adding-Two-Negabinary-Numbers.md" >}})|Medium||||34.9%| +|1093|Statistics from a Large Sample|[Go]({{< relref "/ChapterFour/1000~1099/1093.Statistics-from-a-Large-Sample.md" >}})|Medium||||49.4%| |1154|Day of the Year|[Go]({{< relref "/ChapterFour/1100~1199/1154.Day-of-the-Year.md" >}})|Easy||||49.2%| |1175|Prime Arrangements|[Go]({{< relref "/ChapterFour/1100~1199/1175.Prime-Arrangements.md" >}})|Easy||||52.0%| |1201|Ugly Number III|[Go]({{< relref "/ChapterFour/1200~1299/1201.Ugly-Number-III.md" >}})|Medium||||26.4%| @@ -79,10 +79,10 @@ weight: 12 |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%| |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.6%| +|1648|Sell Diminishing-Valued Colored Balls|[Go]({{< relref "/ChapterFour/1600~1699/1648.Sell-Diminishing-Valued-Colored-Balls.md" >}})|Medium||||30.5%| |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.6%| +|1716|Calculate Money in Leetcode Bank|[Go]({{< relref "/ChapterFour/1700~1799/1716.Calculate-Money-in-Leetcode-Bank.md" >}})|Easy||||66.5%| |------------|-------------------------------------------------------|-------| ----------------| ---------------|-------------|-------------|-------------| diff --git a/website/content/ChapterTwo/Segment_Tree.md b/website/content/ChapterTwo/Segment_Tree.md index a3a0e23d..442ceca9 100644 --- a/website/content/ChapterTwo/Segment_Tree.md +++ b/website/content/ChapterTwo/Segment_Tree.md @@ -40,7 +40,7 @@ weight: 18 |0218|The Skyline Problem|[Go]({{< relref "/ChapterFour/0200~0299/0218.The-Skyline-Problem.md" >}})|Hard| O(n log n)| O(n)|❤️|36.4%| |0307|Range Sum Query - Mutable|[Go]({{< relref "/ChapterFour/0300~0399/0307.Range-Sum-Query-Mutable.md" >}})|Medium| O(1)| O(n)||36.8%| |0315|Count of Smaller Numbers After Self|[Go]({{< relref "/ChapterFour/0300~0399/0315.Count-of-Smaller-Numbers-After-Self.md" >}})|Hard| O(n log n)| O(n)||42.5%| -|0327|Count of Range Sum|[Go]({{< relref "/ChapterFour/0300~0399/0327.Count-of-Range-Sum.md" >}})|Hard| O(n log n)| O(n)|❤️|36.0%| +|0327|Count of Range Sum|[Go]({{< relref "/ChapterFour/0300~0399/0327.Count-of-Range-Sum.md" >}})|Hard| O(n log n)| O(n)|❤️|36.1%| |0493|Reverse Pairs|[Go]({{< relref "/ChapterFour/0400~0499/0493.Reverse-Pairs.md" >}})|Hard| O(n log n)| O(n)||26.9%| |0699|Falling Squares|[Go]({{< relref "/ChapterFour/0600~0699/0699.Falling-Squares.md" >}})|Hard| O(n log n)| O(n)|❤️|42.6%| |0715|Range Module|[Go]({{< relref "/ChapterFour/0700~0799/0715.Range-Module.md" >}})|Hard| O(log n)| O(n)|❤️|40.3%| diff --git a/website/content/ChapterTwo/Sliding_Window.md b/website/content/ChapterTwo/Sliding_Window.md index 414bdbc0..3961d4a9 100644 --- a/website/content/ChapterTwo/Sliding_Window.md +++ b/website/content/ChapterTwo/Sliding_Window.md @@ -29,7 +29,7 @@ weight: 17 | No. | Title | Solution | Difficulty | TimeComplexity | SpaceComplexity |Favorite| Acceptance | |:--------:|:------- | :--------: | :----------: | :----: | :-----: | :-----: |:-----: | -|0003|Longest Substring Without Repeating Characters|[Go]({{< relref "/ChapterFour/0001~0099/0003.Longest-Substring-Without-Repeating-Characters.md" >}})|Medium| O(n)| O(1)|❤️|31.4%| +|0003|Longest Substring Without Repeating Characters|[Go]({{< relref "/ChapterFour/0001~0099/0003.Longest-Substring-Without-Repeating-Characters.md" >}})|Medium| O(n)| O(1)|❤️|31.5%| |0076|Minimum Window Substring|[Go]({{< relref "/ChapterFour/0001~0099/0076.Minimum-Window-Substring.md" >}})|Hard| O(n)| O(n)|❤️|36.0%| |0239|Sliding Window Maximum|[Go]({{< relref "/ChapterFour/0200~0299/0239.Sliding-Window-Maximum.md" >}})|Hard| O(n * k)| O(n)|❤️|44.7%| |0395|Longest Substring with At Least K Repeating Characters|[Go]({{< relref "/ChapterFour/0300~0399/0395.Longest-Substring-with-At-Least-K-Repeating-Characters.md" >}})|Medium||||43.6%| @@ -39,11 +39,11 @@ weight: 17 |0978|Longest Turbulent Subarray|[Go]({{< relref "/ChapterFour/0900~0999/0978.Longest-Turbulent-Subarray.md" >}})|Medium| O(n)| O(1)|❤️|46.7%| |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%| |0995|Minimum Number of K Consecutive Bit Flips|[Go]({{< relref "/ChapterFour/0900~0999/0995.Minimum-Number-of-K-Consecutive-Bit-Flips.md" >}})|Hard| O(n)| O(1)|❤️|49.9%| -|1004|Max Consecutive Ones III|[Go]({{< relref "/ChapterFour/1000~1099/1004.Max-Consecutive-Ones-III.md" >}})|Medium| O(n)| O(1) ||60.8%| +|1004|Max Consecutive Ones III|[Go]({{< relref "/ChapterFour/1000~1099/1004.Max-Consecutive-Ones-III.md" >}})|Medium| O(n)| O(1) ||60.9%| |1040|Moving Stones Until Consecutive II|[Go]({{< relref "/ChapterFour/1000~1099/1040.Moving-Stones-Until-Consecutive-II.md" >}})|Medium| O(n log n)| O(1) |❤️|54.1%| |1052|Grumpy Bookstore Owner|[Go]({{< relref "/ChapterFour/1000~1099/1052.Grumpy-Bookstore-Owner.md" >}})|Medium| O(n log n)| O(1) ||55.8%| |1074|Number of Submatrices That Sum to Target|[Go]({{< relref "/ChapterFour/1000~1099/1074.Number-of-Submatrices-That-Sum-to-Target.md" >}})|Hard| O(n^3)| O(n) |❤️|61.8%| -|1208|Get Equal Substrings Within Budget|[Go]({{< relref "/ChapterFour/1200~1299/1208.Get-Equal-Substrings-Within-Budget.md" >}})|Medium||||44.1%| +|1208|Get Equal Substrings Within Budget|[Go]({{< relref "/ChapterFour/1200~1299/1208.Get-Equal-Substrings-Within-Budget.md" >}})|Medium||||44.0%| |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%| |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%| |1658|Minimum Operations to Reduce X to Zero|[Go]({{< relref "/ChapterFour/1600~1699/1658.Minimum-Operations-to-Reduce-X-to-Zero.md" >}})|Medium||||33.4%| diff --git a/website/content/ChapterTwo/Sort.md b/website/content/ChapterTwo/Sort.md index 02295159..a154a7bb 100644 --- a/website/content/ChapterTwo/Sort.md +++ b/website/content/ChapterTwo/Sort.md @@ -21,7 +21,7 @@ weight: 14 |0056|Merge Intervals|[Go]({{< relref "/ChapterFour/0001~0099/0056.Merge-Intervals.md" >}})|Medium| O(n log n)| O(log n)||41.1%| |0057|Insert Interval|[Go]({{< relref "/ChapterFour/0001~0099/0057.Insert-Interval.md" >}})|Medium| O(n)| O(1)||35.1%| |0075|Sort Colors|[Go]({{< relref "/ChapterFour/0001~0099/0075.Sort-Colors.md" >}})|Medium| O(n)| O(1)|❤️|49.5%| -|0147|Insertion Sort List|[Go]({{< relref "/ChapterFour/0100~0199/0147.Insertion-Sort-List.md" >}})|Medium| O(n^2)| O(1) |❤️|44.4%| +|0147|Insertion Sort List|[Go]({{< relref "/ChapterFour/0100~0199/0147.Insertion-Sort-List.md" >}})|Medium| O(n^2)| O(1) |❤️|44.5%| |0148|Sort List|[Go]({{< relref "/ChapterFour/0100~0199/0148.Sort-List.md" >}})|Medium|O(n log n)| O(log n)|❤️|46.4%| |0164|Maximum Gap|[Go]({{< relref "/ChapterFour/0100~0199/0164.Maximum-Gap.md" >}})|Hard| O(n log n)| O(log n) |❤️|36.9%| |0179|Largest Number|[Go]({{< relref "/ChapterFour/0100~0199/0179.Largest-Number.md" >}})|Medium| O(n log n)| O(log n) |❤️|30.7%| @@ -30,13 +30,13 @@ weight: 14 |0274|H-Index|[Go]({{< relref "/ChapterFour/0200~0299/0274.H-Index.md" >}})|Medium| O(n)| O(n) ||36.4%| |0315|Count of Smaller Numbers After Self|[Go]({{< relref "/ChapterFour/0300~0399/0315.Count-of-Smaller-Numbers-After-Self.md" >}})|Hard||||42.5%| |0324|Wiggle Sort II|[Go]({{< relref "/ChapterFour/0300~0399/0324.Wiggle-Sort-II.md" >}})|Medium| O(n)| O(n)|❤️|30.7%| -|0327|Count of Range Sum|[Go]({{< relref "/ChapterFour/0300~0399/0327.Count-of-Range-Sum.md" >}})|Hard||||36.0%| +|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%| |0350|Intersection of Two Arrays II|[Go]({{< relref "/ChapterFour/0300~0399/0350.Intersection-of-Two-Arrays-II.md" >}})|Easy| O(n)| O(n) ||52.0%| |0493|Reverse Pairs|[Go]({{< relref "/ChapterFour/0400~0499/0493.Reverse-Pairs.md" >}})|Hard||||26.9%| |0524|Longest Word in Dictionary through Deleting|[Go]({{< relref "/ChapterFour/0500~0599/0524.Longest-Word-in-Dictionary-through-Deleting.md" >}})|Medium| O(n)| O(1) ||50.1%| |0710|Random Pick with Blacklist|[Go]({{< relref "/ChapterFour/0700~0799/0710.Random-Pick-with-Blacklist.md" >}})|Hard| O(n)| O(n) ||32.9%| -|0767|Reorganize String|[Go]({{< relref "/ChapterFour/0700~0799/0767.Reorganize-String.md" >}})|Medium| O(n log n)| O(log n) |❤️|50.1%| +|0767|Reorganize String|[Go]({{< relref "/ChapterFour/0700~0799/0767.Reorganize-String.md" >}})|Medium| O(n log n)| O(log n) |❤️|50.2%| |0853|Car Fleet|[Go]({{< relref "/ChapterFour/0800~0899/0853.Car-Fleet.md" >}})|Medium| O(n log n)| O(log n) ||44.1%| |0922|Sort Array By Parity II|[Go]({{< relref "/ChapterFour/0900~0999/0922.Sort-Array-By-Parity-II.md" >}})|Easy| O(n)| O(1) ||70.6%| |0969|Pancake Sorting|[Go]({{< relref "/ChapterFour/0900~0999/0969.Pancake-Sorting.md" >}})|Medium| O(n log n)| O(log n) |❤️|68.7%| @@ -47,11 +47,11 @@ weight: 14 |1122|Relative Sort Array|[Go]({{< relref "/ChapterFour/1100~1199/1122.Relative-Sort-Array.md" >}})|Easy||||68.1%| |1235|Maximum Profit in Job Scheduling|[Go]({{< relref "/ChapterFour/1200~1299/1235.Maximum-Profit-in-Job-Scheduling.md" >}})|Hard||||47.5%| |1305|All Elements in Two Binary Search Trees|[Go]({{< relref "/ChapterFour/1300~1399/1305.All-Elements-in-Two-Binary-Search-Trees.md" >}})|Medium||||77.8%| -|1329|Sort the Matrix Diagonally|[Go]({{< relref "/ChapterFour/1300~1399/1329.Sort-the-Matrix-Diagonally.md" >}})|Medium||||81.7%| -|1636|Sort Array by Increasing Frequency|[Go]({{< relref "/ChapterFour/1600~1699/1636.Sort-Array-by-Increasing-Frequency.md" >}})|Easy||||66.9%| +|1329|Sort the Matrix Diagonally|[Go]({{< relref "/ChapterFour/1300~1399/1329.Sort-the-Matrix-Diagonally.md" >}})|Medium||||81.8%| +|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%| |1647|Minimum Deletions to Make Character Frequencies Unique|[Go]({{< relref "/ChapterFour/1600~1699/1647.Minimum-Deletions-to-Make-Character-Frequencies-Unique.md" >}})|Medium||||54.7%| -|1648|Sell Diminishing-Valued Colored Balls|[Go]({{< relref "/ChapterFour/1600~1699/1648.Sell-Diminishing-Valued-Colored-Balls.md" >}})|Medium||||30.6%| +|1648|Sell Diminishing-Valued Colored Balls|[Go]({{< relref "/ChapterFour/1600~1699/1648.Sell-Diminishing-Valued-Colored-Balls.md" >}})|Medium||||30.5%| |1691|Maximum Height by Stacking Cuboids|[Go]({{< relref "/ChapterFour/1600~1699/1691.Maximum-Height-by-Stacking-Cuboids.md" >}})|Hard||||50.1%| |1710|Maximum Units on a Truck|[Go]({{< relref "/ChapterFour/1700~1799/1710.Maximum-Units-on-a-Truck.md" >}})|Easy||||70.2%| |------------|-------------------------------------------------------|-------| ----------------| ---------------|-------------|-------------|-------------| diff --git a/website/content/ChapterTwo/Stack.md b/website/content/ChapterTwo/Stack.md index 15bc1722..a4ccfbde 100644 --- a/website/content/ChapterTwo/Stack.md +++ b/website/content/ChapterTwo/Stack.md @@ -27,9 +27,9 @@ weight: 5 |0145|Binary Tree Postorder Traversal|[Go]({{< relref "/ChapterFour/0100~0199/0145.Binary-Tree-Postorder-Traversal.md" >}})|Medium| O(n)| O(1)||57.7%| |0150|Evaluate Reverse Polish Notation|[Go]({{< relref "/ChapterFour/0100~0199/0150.Evaluate-Reverse-Polish-Notation.md" >}})|Medium| O(n)| O(1)||38.0%| |0155|Min Stack|[Go]({{< relref "/ChapterFour/0100~0199/0155.Min-Stack.md" >}})|Easy| O(n)| O(n)||46.5%| -|0173|Binary Search Tree Iterator|[Go]({{< relref "/ChapterFour/0100~0199/0173.Binary-Search-Tree-Iterator.md" >}})|Medium| O(n)| O(1)||60.2%| +|0173|Binary Search Tree Iterator|[Go]({{< relref "/ChapterFour/0100~0199/0173.Binary-Search-Tree-Iterator.md" >}})|Medium| O(n)| O(1)||60.3%| |0224|Basic Calculator|[Go]({{< relref "/ChapterFour/0200~0299/0224.Basic-Calculator.md" >}})|Hard| O(n)| O(n)||38.2%| -|0225|Implement Stack using Queues|[Go]({{< relref "/ChapterFour/0200~0299/0225.Implement-Stack-using-Queues.md" >}})|Easy| O(n)| O(n)||47.5%| +|0225|Implement Stack using Queues|[Go]({{< relref "/ChapterFour/0200~0299/0225.Implement-Stack-using-Queues.md" >}})|Easy| O(n)| O(n)||47.6%| |0232|Implement Queue using Stacks|[Go]({{< relref "/ChapterFour/0200~0299/0232.Implement-Queue-using-Stacks.md" >}})|Easy| O(n)| O(n)||52.3%| |0331|Verify Preorder Serialization of a Binary Tree|[Go]({{< relref "/ChapterFour/0300~0399/0331.Verify-Preorder-Serialization-of-a-Binary-Tree.md" >}})|Medium| O(n)| O(1)||41.0%| |0385|Mini Parser|[Go]({{< relref "/ChapterFour/0300~0399/0385.Mini-Parser.md" >}})|Medium||||34.5%| diff --git a/website/content/ChapterTwo/String.md b/website/content/ChapterTwo/String.md index 1c3b6503..d5e33efb 100644 --- a/website/content/ChapterTwo/String.md +++ b/website/content/ChapterTwo/String.md @@ -9,7 +9,7 @@ weight: 2 | No. | Title | Solution | Difficulty | TimeComplexity | SpaceComplexity |Favorite| Acceptance | |:--------:|:------- | :--------: | :----------: | :----: | :-----: | :-----: |:-----: | -|0003|Longest Substring Without Repeating Characters|[Go]({{< relref "/ChapterFour/0001~0099/0003.Longest-Substring-Without-Repeating-Characters.md" >}})|Medium| O(n)| O(1)|❤️|31.4%| +|0003|Longest Substring Without Repeating Characters|[Go]({{< relref "/ChapterFour/0001~0099/0003.Longest-Substring-Without-Repeating-Characters.md" >}})|Medium| O(n)| O(1)|❤️|31.5%| |0005|Longest Palindromic Substring|[Go]({{< relref "/ChapterFour/0001~0099/0005.Longest-Palindromic-Substring.md" >}})|Medium||||30.5%| |0013|Roman to Integer|[Go]({{< relref "/ChapterFour/0001~0099/0013.Roman-to-Integer.md" >}})|Easy||||56.9%| |0017|Letter Combinations of a Phone Number|[Go]({{< relref "/ChapterFour/0001~0099/0017.Letter-Combinations-of-a-Phone-Number.md" >}})|Medium| O(log n)| O(1)||49.2%| @@ -34,7 +34,7 @@ weight: 2 |0541|Reverse String II|[Go]({{< relref "/ChapterFour/0500~0599/0541.Reverse-String-II.md" >}})|Easy||||49.2%| |0557|Reverse Words in a String III|[Go]({{< relref "/ChapterFour/0500~0599/0557.Reverse-Words-in-a-String-III.md" >}})|Easy||||72.1%| |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%| -|0767|Reorganize String|[Go]({{< relref "/ChapterFour/0700~0799/0767.Reorganize-String.md" >}})|Medium| O(n log n)| O(log n) |❤️|50.1%| +|0767|Reorganize String|[Go]({{< relref "/ChapterFour/0700~0799/0767.Reorganize-String.md" >}})|Medium| O(n log n)| O(log n) |❤️|50.2%| |0819|Most Common Word|[Go]({{< relref "/ChapterFour/0800~0899/0819.Most-Common-Word.md" >}})|Easy||||45.5%| |0842|Split Array into Fibonacci Sequence|[Go]({{< relref "/ChapterFour/0800~0899/0842.Split-Array-into-Fibonacci-Sequence.md" >}})|Medium| O(n^2)| O(1)|❤️|36.9%| |0856|Score of Parentheses|[Go]({{< relref "/ChapterFour/0800~0899/0856.Score-of-Parentheses.md" >}})|Medium| O(n)| O(n)||64.8%| @@ -46,18 +46,18 @@ weight: 2 |1221|Split a String in Balanced Strings|[Go]({{< relref "/ChapterFour/1200~1299/1221.Split-a-String-in-Balanced-Strings.md" >}})|Easy||||84.3%| |1234|Replace the Substring for Balanced String|[Go]({{< relref "/ChapterFour/1200~1299/1234.Replace-the-Substring-for-Balanced-String.md" >}})|Medium||||34.5%| |1249|Minimum Remove to Make Valid Parentheses|[Go]({{< relref "/ChapterFour/1200~1299/1249.Minimum-Remove-to-Make-Valid-Parentheses.md" >}})|Medium||||64.2%| -|1332|Remove Palindromic Subsequences|[Go]({{< relref "/ChapterFour/1300~1399/1332.Remove-Palindromic-Subsequences.md" >}})|Easy||||66.7%| -|1455|Check If a Word Occurs As a Prefix of Any Word in a Sentence|[Go]({{< relref "/ChapterFour/1400~1499/1455.Check-If-a-Word-Occurs-As-a-Prefix-of-Any-Word-in-a-Sentence.md" >}})|Easy||||64.7%| +|1332|Remove Palindromic Subsequences|[Go]({{< relref "/ChapterFour/1300~1399/1332.Remove-Palindromic-Subsequences.md" >}})|Easy||||68.0%| +|1455|Check If a Word Occurs As a Prefix of Any Word in a Sentence|[Go]({{< relref "/ChapterFour/1400~1499/1455.Check-If-a-Word-Occurs-As-a-Prefix-of-Any-Word-in-a-Sentence.md" >}})|Easy||||64.9%| |1573|Number of Ways to Split a String|[Go]({{< relref "/ChapterFour/1500~1599/1573.Number-of-Ways-to-Split-a-String.md" >}})|Medium||||31.2%| |1614|Maximum Nesting Depth of the Parentheses|[Go]({{< relref "/ChapterFour/1600~1699/1614.Maximum-Nesting-Depth-of-the-Parentheses.md" >}})|Easy||||82.8%| -|1624|Largest Substring Between Two Equal Characters|[Go]({{< relref "/ChapterFour/1600~1699/1624.Largest-Substring-Between-Two-Equal-Characters.md" >}})|Easy||||58.8%| +|1624|Largest Substring Between Two Equal Characters|[Go]({{< relref "/ChapterFour/1600~1699/1624.Largest-Substring-Between-Two-Equal-Characters.md" >}})|Easy||||58.7%| |1653|Minimum Deletions to Make String Balanced|[Go]({{< relref "/ChapterFour/1600~1699/1653.Minimum-Deletions-to-Make-String-Balanced.md" >}})|Medium||||51.3%| |1662|Check If Two String Arrays are Equivalent|[Go]({{< relref "/ChapterFour/1600~1699/1662.Check-If-Two-String-Arrays-are-Equivalent.md" >}})|Easy||||82.9%| |1668|Maximum Repeating Substring|[Go]({{< relref "/ChapterFour/1600~1699/1668.Maximum-Repeating-Substring.md" >}})|Easy||||38.8%| |1678|Goal Parser Interpretation|[Go]({{< relref "/ChapterFour/1600~1699/1678.Goal-Parser-Interpretation.md" >}})|Easy||||85.4%| |1684|Count the Number of Consistent Strings|[Go]({{< relref "/ChapterFour/1600~1699/1684.Count-the-Number-of-Consistent-Strings.md" >}})|Easy||||82.4%| |1694|Reformat Phone Number|[Go]({{< relref "/ChapterFour/1600~1699/1694.Reformat-Phone-Number.md" >}})|Easy||||65.8%| -|1704|Determine if String Halves Are Alike|[Go]({{< relref "/ChapterFour/1700~1799/1704.Determine-if-String-Halves-Are-Alike.md" >}})|Easy||||77.2%| +|1704|Determine if String Halves Are Alike|[Go]({{< relref "/ChapterFour/1700~1799/1704.Determine-if-String-Halves-Are-Alike.md" >}})|Easy||||77.1%| |1736|Latest Time by Replacing Hidden Digits|[Go]({{< relref "/ChapterFour/1700~1799/1736.Latest-Time-by-Replacing-Hidden-Digits.md" >}})|Easy||||41.1%| |------------|-------------------------------------------------------|-------| ----------------| ---------------|-------------|-------------|-------------| diff --git a/website/content/ChapterTwo/Tree.md b/website/content/ChapterTwo/Tree.md index 2d03d2f3..aa2bc8ad 100644 --- a/website/content/ChapterTwo/Tree.md +++ b/website/content/ChapterTwo/Tree.md @@ -32,7 +32,7 @@ weight: 6 |0129|Sum Root to Leaf Numbers|[Go]({{< relref "/ChapterFour/0100~0199/0129.Sum-Root-to-Leaf-Numbers.md" >}})|Medium| O(n)| O(1)||51.0%| |0144|Binary Tree Preorder Traversal|[Go]({{< relref "/ChapterFour/0100~0199/0144.Binary-Tree-Preorder-Traversal.md" >}})|Medium| O(n)| O(1)||57.6%| |0145|Binary Tree Postorder Traversal|[Go]({{< relref "/ChapterFour/0100~0199/0145.Binary-Tree-Postorder-Traversal.md" >}})|Medium| O(n)| O(1)||57.7%| -|0173|Binary Search Tree Iterator|[Go]({{< relref "/ChapterFour/0100~0199/0173.Binary-Search-Tree-Iterator.md" >}})|Medium| O(n)| O(1)||60.2%| +|0173|Binary Search Tree Iterator|[Go]({{< relref "/ChapterFour/0100~0199/0173.Binary-Search-Tree-Iterator.md" >}})|Medium| O(n)| O(1)||60.3%| |0199|Binary Tree Right Side View|[Go]({{< relref "/ChapterFour/0100~0199/0199.Binary-Tree-Right-Side-View.md" >}})|Medium| O(n)| O(1)||56.4%| |0222|Count Complete Tree Nodes|[Go]({{< relref "/ChapterFour/0200~0299/0222.Count-Complete-Tree-Nodes.md" >}})|Medium| O(n)| O(1)||49.4%| |0226|Invert Binary Tree|[Go]({{< relref "/ChapterFour/0200~0299/0226.Invert-Binary-Tree.md" >}})|Easy| O(n)| O(1)||67.1%| @@ -44,11 +44,12 @@ weight: 6 |0404|Sum of Left Leaves|[Go]({{< relref "/ChapterFour/0400~0499/0404.Sum-of-Left-Leaves.md" >}})|Easy| O(n)| O(1)||52.3%| |0437|Path Sum III|[Go]({{< relref "/ChapterFour/0400~0499/0437.Path-Sum-III.md" >}})|Medium| O(n)| O(1)||48.2%| |0508|Most Frequent Subtree Sum|[Go]({{< relref "/ChapterFour/0500~0599/0508.Most-Frequent-Subtree-Sum.md" >}})|Medium||||59.1%| -|0513|Find Bottom Left Tree Value|[Go]({{< relref "/ChapterFour/0500~0599/0513.Find-Bottom-Left-Tree-Value.md" >}})|Medium||||62.6%| +|0513|Find Bottom Left Tree Value|[Go]({{< relref "/ChapterFour/0500~0599/0513.Find-Bottom-Left-Tree-Value.md" >}})|Medium||||62.7%| |0515|Find Largest Value in Each Tree Row|[Go]({{< relref "/ChapterFour/0500~0599/0515.Find-Largest-Value-in-Each-Tree-Row.md" >}})|Medium| O(n)| O(n)||62.3%| |0538|Convert BST to Greater Tree|[Go]({{< relref "/ChapterFour/0500~0599/0538.Convert-BST-to-Greater-Tree.md" >}})|Medium||||59.5%| -|0563|Binary Tree Tilt|[Go]({{< relref "/ChapterFour/0500~0599/0563.Binary-Tree-Tilt.md" >}})|Easy||||53.0%| +|0563|Binary Tree Tilt|[Go]({{< relref "/ChapterFour/0500~0599/0563.Binary-Tree-Tilt.md" >}})|Easy||||53.1%| |0572|Subtree of Another Tree|[Go]({{< relref "/ChapterFour/0500~0599/0572.Subtree-of-Another-Tree.md" >}})|Easy||||44.5%| +|0623|Add One Row to Tree|[Go]({{< relref "/ChapterFour/0600~0699/0623.Add-One-Row-to-Tree.md" >}})|Medium||||51.6%| |0637|Average of Levels in Binary Tree|[Go]({{< relref "/ChapterFour/0600~0699/0637.Average-of-Levels-in-Binary-Tree.md" >}})|Easy| O(n)| O(n)||66.0%| |0653|Two Sum IV - Input is a BST|[Go]({{< relref "/ChapterFour/0600~0699/0653.Two-Sum-IV-Input-is-a-BST.md" >}})|Easy||||56.3%| |0662|Maximum Width of Binary Tree|[Go]({{< relref "/ChapterFour/0600~0699/0662.Maximum-Width-of-Binary-Tree.md" >}})|Medium||||39.8%| @@ -74,7 +75,6 @@ weight: 6 |------------|-------------------------------------------------------|-------| ----------------| ---------------|-------------|-------------|-------------| - ----------------------------------------------

⬅️上一页

diff --git a/website/content/ChapterTwo/Two_Pointers.md b/website/content/ChapterTwo/Two_Pointers.md index bb1f34b9..f5ae8d9f 100644 --- a/website/content/ChapterTwo/Two_Pointers.md +++ b/website/content/ChapterTwo/Two_Pointers.md @@ -32,7 +32,7 @@ weight: 3 | No. | Title | Solution | Difficulty | TimeComplexity | SpaceComplexity |Favorite| Acceptance | |:--------:|:------- | :--------: | :----------: | :----: | :-----: | :-----: |:-----: | -|0003|Longest Substring Without Repeating Characters|[Go]({{< relref "/ChapterFour/0001~0099/0003.Longest-Substring-Without-Repeating-Characters.md" >}})|Medium| O(n)| O(1)|❤️|31.4%| +|0003|Longest Substring Without Repeating Characters|[Go]({{< relref "/ChapterFour/0001~0099/0003.Longest-Substring-Without-Repeating-Characters.md" >}})|Medium| O(n)| O(1)|❤️|31.5%| |0011|Container With Most Water|[Go]({{< relref "/ChapterFour/0001~0099/0011.Container-With-Most-Water.md" >}})|Medium| O(n)| O(1)||52.8%| |0015|3Sum|[Go]({{< relref "/ChapterFour/0001~0099/0015.3Sum.md" >}})|Medium| O(n^2)| O(n)|❤️|28.1%| |0016|3Sum Closest|[Go]({{< relref "/ChapterFour/0001~0099/0016.3Sum-Closest.md" >}})|Medium| O(n^2)| O(1)|❤️|46.3%| @@ -74,7 +74,7 @@ weight: 3 |0838|Push Dominoes|[Go]({{< relref "/ChapterFour/0800~0899/0838.Push-Dominoes.md" >}})|Medium| O(n)| O(n)||49.9%| |0844|Backspace String Compare|[Go]({{< relref "/ChapterFour/0800~0899/0844.Backspace-String-Compare.md" >}})|Easy| O(n)| O(n) ||47.1%| |0845|Longest Mountain in Array|[Go]({{< relref "/ChapterFour/0800~0899/0845.Longest-Mountain-in-Array.md" >}})|Medium| O(n)| O(1) ||38.6%| -|0881|Boats to Save People|[Go]({{< relref "/ChapterFour/0800~0899/0881.Boats-to-Save-People.md" >}})|Medium| O(n log n)| O(1) ||48.9%| +|0881|Boats to Save People|[Go]({{< relref "/ChapterFour/0800~0899/0881.Boats-to-Save-People.md" >}})|Medium| O(n log n)| O(1) ||49.0%| |0904|Fruit Into Baskets|[Go]({{< relref "/ChapterFour/0900~0999/0904.Fruit-Into-Baskets.md" >}})|Medium| O(n log n)| O(1) ||43.0%| |0923|3Sum With Multiplicity|[Go]({{< relref "/ChapterFour/0900~0999/0923.3Sum-With-Multiplicity.md" >}})|Medium| O(n^2)| O(n) ||36.3%| |0925|Long Pressed Name|[Go]({{< relref "/ChapterFour/0900~0999/0925.Long-Pressed-Name.md" >}})|Easy| O(n)| O(1)||37.8%| @@ -82,11 +82,11 @@ weight: 3 |0977|Squares of a Sorted Array|[Go]({{< relref "/ChapterFour/0900~0999/0977.Squares-of-a-Sorted-Array.md" >}})|Easy| O(n)| O(1)||72.0%| |0986|Interval List Intersections|[Go]({{< relref "/ChapterFour/0900~0999/0986.Interval-List-Intersections.md" >}})|Medium| O(n)| O(1)||68.4%| |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%| -|1004|Max Consecutive Ones III|[Go]({{< relref "/ChapterFour/1000~1099/1004.Max-Consecutive-Ones-III.md" >}})|Medium| O(n)| O(1) ||60.8%| -|1093|Statistics from a Large Sample|[Go]({{< relref "/ChapterFour/1000~1099/1093.Statistics-from-a-Large-Sample.md" >}})|Medium| O(n)| O(1) ||49.5%| +|1004|Max Consecutive Ones III|[Go]({{< relref "/ChapterFour/1000~1099/1004.Max-Consecutive-Ones-III.md" >}})|Medium| O(n)| O(1) ||60.9%| +|1093|Statistics from a Large Sample|[Go]({{< relref "/ChapterFour/1000~1099/1093.Statistics-from-a-Large-Sample.md" >}})|Medium| O(n)| O(1) ||49.4%| |1234|Replace the Substring for Balanced String|[Go]({{< relref "/ChapterFour/1200~1299/1234.Replace-the-Substring-for-Balanced-String.md" >}})|Medium||||34.5%| |1658|Minimum Operations to Reduce X to Zero|[Go]({{< relref "/ChapterFour/1600~1699/1658.Minimum-Operations-to-Reduce-X-to-Zero.md" >}})|Medium||||33.4%| -|1695|Maximum Erasure Value|[Go]({{< relref "/ChapterFour/1600~1699/1695.Maximum-Erasure-Value.md" >}})|Medium||||49.5%| +|1695|Maximum Erasure Value|[Go]({{< relref "/ChapterFour/1600~1699/1695.Maximum-Erasure-Value.md" >}})|Medium||||49.6%| |------------|-------------------------------------------------------|-------| ----------------| ---------------|-------------|-------------|-------------| diff --git a/website/content/ChapterTwo/Union_Find.md b/website/content/ChapterTwo/Union_Find.md index 754b80cd..8a82773e 100644 --- a/website/content/ChapterTwo/Union_Find.md +++ b/website/content/ChapterTwo/Union_Find.md @@ -29,18 +29,18 @@ weight: 16 |0721|Accounts Merge|[Go]({{< relref "/ChapterFour/0700~0799/0721.Accounts-Merge.md" >}})|Medium| O(n)| O(n)|❤️|51.9%| |0765|Couples Holding Hands|[Go]({{< relref "/ChapterFour/0700~0799/0765.Couples-Holding-Hands.md" >}})|Hard| O(n)| O(n)|❤️|55.5%| |0778|Swim in Rising Water|[Go]({{< relref "/ChapterFour/0700~0799/0778.Swim-in-Rising-Water.md" >}})|Hard| O(n^2)| O(n)|❤️|54.7%| -|0803|Bricks Falling When Hit|[Go]({{< relref "/ChapterFour/0800~0899/0803.Bricks-Falling-When-Hit.md" >}})|Hard| O(n^2)| O(n)|❤️|31.4%| +|0803|Bricks Falling When Hit|[Go]({{< relref "/ChapterFour/0800~0899/0803.Bricks-Falling-When-Hit.md" >}})|Hard| O(n^2)| O(n)|❤️|31.5%| |0839|Similar String Groups|[Go]({{< relref "/ChapterFour/0800~0899/0839.Similar-String-Groups.md" >}})|Hard| O(n^2)| O(n)||41.0%| |0924|Minimize Malware Spread|[Go]({{< relref "/ChapterFour/0900~0999/0924.Minimize-Malware-Spread.md" >}})|Hard| O(m\*n)| O(n)||41.9%| |0928|Minimize Malware Spread II|[Go]({{< relref "/ChapterFour/0900~0999/0928.Minimize-Malware-Spread-II.md" >}})|Hard| O(m\*n)| O(n)|❤️|41.4%| |0947|Most Stones Removed with Same Row or Column|[Go]({{< relref "/ChapterFour/0900~0999/0947.Most-Stones-Removed-with-Same-Row-or-Column.md" >}})|Medium| O(n)| O(n)||55.4%| |0952|Largest Component Size by Common Factor|[Go]({{< relref "/ChapterFour/0900~0999/0952.Largest-Component-Size-by-Common-Factor.md" >}})|Hard| O(n)| O(n)|❤️|36.2%| |0959|Regions Cut By Slashes|[Go]({{< relref "/ChapterFour/0900~0999/0959.Regions-Cut-By-Slashes.md" >}})|Medium| O(n^2)| O(n^2)|❤️|67.2%| -|0990|Satisfiability of Equality Equations|[Go]({{< relref "/ChapterFour/0900~0999/0990.Satisfiability-of-Equality-Equations.md" >}})|Medium| O(n)| O(n)||46.8%| +|0990|Satisfiability of Equality Equations|[Go]({{< relref "/ChapterFour/0900~0999/0990.Satisfiability-of-Equality-Equations.md" >}})|Medium| O(n)| O(n)||46.9%| |1202|Smallest String With Swaps|[Go]({{< relref "/ChapterFour/1200~1299/1202.Smallest-String-With-Swaps.md" >}})|Medium||||48.8%| |1319|Number of Operations to Make Network Connected|[Go]({{< relref "/ChapterFour/1300~1399/1319.Number-of-Operations-to-Make-Network-Connected.md" >}})|Medium||||55.5%| |1579|Remove Max Number of Edges to Keep Graph Fully Traversable|[Go]({{< relref "/ChapterFour/1500~1599/1579.Remove-Max-Number-of-Edges-to-Keep-Graph-Fully-Traversable.md" >}})|Hard||||46.2%| -|1631|Path With Minimum Effort|[Go]({{< relref "/ChapterFour/1600~1699/1631.Path-With-Minimum-Effort.md" >}})|Medium||||50.0%| +|1631|Path With Minimum Effort|[Go]({{< relref "/ChapterFour/1600~1699/1631.Path-With-Minimum-Effort.md" >}})|Medium||||50.1%| |------------|-------------------------------------------------------|-------| ----------------| ---------------|-------------|-------------|-------------|