From 048c42db23ff2910901c21358e92508ed9d7fb04 Mon Sep 17 00:00:00 2001 From: YDZ Date: Thu, 11 Feb 2021 14:04:56 +0800 Subject: [PATCH] =?UTF-8?q?Add=20solution=200284=E3=80=810703?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 283 +++++++++--------- .../173. Binary Search Tree Iterator.go | 4 +- .../284. Peeking Iterator.go | 53 ++++ .../284. Peeking Iterator_test.go | 9 + leetcode/0284.Peeking-Iterator/README.md | 87 ++++++ .../703. Kth Largest Element in a Stream.go | 38 +++ ...3. Kth Largest Element in a Stream_test.go | 15 + .../README.md | 93 ++++++ .../ChapterFour/0200~0299/0283.Move-Zeroes.md | 2 +- .../0200~0299/0284.Peeking-Iterator.md | 94 ++++++ .../0287.Find-the-Duplicate-Number.md | 2 +- .../0600~0699/0699.Falling-Squares.md | 2 +- .../0703.Kth-Largest-Element-in-a-Stream.md | 100 +++++++ .../0700~0799/0704.Binary-Search.md | 2 +- website/content/ChapterTwo/Array.md | 16 +- website/content/ChapterTwo/Backtracking.md | 4 +- .../content/ChapterTwo/Binary_Indexed_Tree.md | 4 +- website/content/ChapterTwo/Binary_Search.md | 8 +- .../content/ChapterTwo/Bit_Manipulation.md | 2 +- .../content/ChapterTwo/Depth_First_Search.md | 4 +- .../content/ChapterTwo/Dynamic_Programming.md | 2 +- website/content/ChapterTwo/Hash_Table.md | 8 +- website/content/ChapterTwo/Linked_List.md | 12 +- website/content/ChapterTwo/Math.md | 6 +- website/content/ChapterTwo/Segment_Tree.md | 4 +- website/content/ChapterTwo/Sort.md | 6 +- website/content/ChapterTwo/Stack.md | 6 +- website/content/ChapterTwo/String.md | 4 +- website/content/ChapterTwo/Tree.md | 4 +- website/content/ChapterTwo/Two_Pointers.md | 6 +- website/content/ChapterTwo/Union_Find.md | 2 +- 31 files changed, 686 insertions(+), 196 deletions(-) create mode 100644 leetcode/0284.Peeking-Iterator/284. Peeking Iterator.go create mode 100644 leetcode/0284.Peeking-Iterator/284. Peeking Iterator_test.go create mode 100644 leetcode/0284.Peeking-Iterator/README.md create mode 100644 leetcode/0703.Kth-Largest-Element-in-a-Stream/703. Kth Largest Element in a Stream.go create mode 100644 leetcode/0703.Kth-Largest-Element-in-a-Stream/703. Kth Largest Element in a Stream_test.go create mode 100644 leetcode/0703.Kth-Largest-Element-in-a-Stream/README.md create mode 100644 website/content/ChapterFour/0200~0299/0284.Peeking-Iterator.md create mode 100644 website/content/ChapterFour/0700~0799/0703.Kth-Largest-Element-in-a-Stream.md diff --git a/README.md b/README.md index 887a2693..a7f9b1fc 100755 --- a/README.md +++ b/README.md @@ -125,21 +125,21 @@ | | Easy | Medium | Hard | Total | |:--------:|:--------:|:--------:|:--------:|:--------:| -|Optimizing|39|49|19|107| +|Optimizing|38|48|19|105| |Accepted|**253**|**328**|**99**|**680**| -|Total|461|921|373|1755| -|Perfection Rate|84.6%|85.1%|80.8%|84.3%| +|Total|461|922|373|1756| +|Perfection Rate|85.0%|85.4%|80.8%|84.6%| |Completion Rate|54.9%|35.6%|26.5%|38.7%| |------------|----------------------------|----------------------------|----------------------------|----------------------------| ## 二. 目录 -以下已经收录了 573 道题的题解,还有 14 道题在尝试优化到 beats 100% +以下已经收录了 575 道题的题解,还有 14 道题在尝试优化到 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.4%|Easy|| -|0002|Add Two Numbers|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0002.Add-Two-Numbers)|35.3%|Medium|| +|0002|Add Two Numbers|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0002.Add-Two-Numbers)|35.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.4%|Medium|| |0004|Median of Two Sorted Arrays|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0004.Median-of-Two-Sorted-Arrays)|31.0%|Hard|| |0005|Longest Palindromic Substring||30.4%|Medium|| @@ -162,7 +162,7 @@ |0022|Generate Parentheses|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0022.Generate-Parentheses)|65.1%|Medium|| |0023|Merge k Sorted Lists|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0023.Merge-k-Sorted-Lists)|42.5%|Hard|| |0024|Swap Nodes in Pairs|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0024.Swap-Nodes-in-Pairs)|52.9%|Medium|| -|0025|Reverse Nodes in k-Group|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0025.Reverse-Nodes-in-k-Group)|44.6%|Hard|| +|0025|Reverse Nodes in k-Group|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0025.Reverse-Nodes-in-k-Group)|44.7%|Hard|| |0026|Remove Duplicates from Sorted Array|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0026.Remove-Duplicates-from-Sorted-Array)|46.5%|Easy|| |0027|Remove Element|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0027.Remove-Element)|49.2%|Easy|| |0028|Implement strStr()|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0028.Implement-strStr())|35.1%|Easy|| @@ -229,14 +229,14 @@ |0089|Gray Code|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0089.Gray-Code)|50.3%|Medium|| |0090|Subsets II|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0090.Subsets-II)|48.7%|Medium|| |0091|Decode Ways|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0091.Decode-Ways)|26.4%|Medium|| -|0092|Reverse Linked List II|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0092.Reverse-Linked-List-II)|40.4%|Medium|| +|0092|Reverse Linked List II|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0092.Reverse-Linked-List-II)|40.5%|Medium|| |0093|Restore IP Addresses|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0093.Restore-IP-Addresses)|37.4%|Medium|| |0094|Binary Tree Inorder Traversal|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0094.Binary-Tree-Inorder-Traversal)|65.7%|Medium|| |0095|Unique Binary Search Trees II|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0095.Unique-Binary-Search-Trees-II)|42.4%|Medium|| |0096|Unique Binary Search Trees|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0096.Unique-Binary-Search-Trees)|54.3%|Medium|| |0097|Interleaving String||32.5%|Hard|| |0098|Validate Binary Search Tree|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0098.Validate-Binary-Search-Tree)|28.7%|Medium|| -|0099|Recover Binary Search Tree|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0099.Recover-Binary-Search-Tree)|42.3%|Hard|| +|0099|Recover Binary Search Tree|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0099.Recover-Binary-Search-Tree)|42.4%|Hard|| |0100|Same Tree|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0100.Same-Tree)|54.1%|Easy|| |0101|Symmetric Tree|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0101.Symmetric-Tree)|48.0%|Easy|| |0102|Binary Tree Level Order Traversal|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0102.Binary-Tree-Level-Order-Traversal)|56.5%|Medium|| @@ -275,7 +275,7 @@ |0135|Candy||32.9%|Hard|| |0136|Single Number|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0136.Single-Number)|66.5%|Easy|| |0137|Single Number II|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0137.Single-Number-II)|53.7%|Medium|| -|0138|Copy List with Random Pointer|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0138.Copy-List-with-Random-Pointer)|40.3%|Medium|| +|0138|Copy List with Random Pointer|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0138.Copy-List-with-Random-Pointer)|40.5%|Medium|| |0139|Word Break||41.6%|Medium|| |0140|Word Break II||34.5%|Hard|| |0141|Linked List Cycle|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0141.Linked-List-Cycle)|42.8%|Easy|| @@ -290,12 +290,12 @@ |0150|Evaluate Reverse Polish Notation|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0150.Evaluate-Reverse-Polish-Notation)|37.8%|Medium|| |0151|Reverse Words in a String|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0151.Reverse-Words-in-a-String)|23.6%|Medium|| |0152|Maximum Product Subarray|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0152.Maximum-Product-Subarray)|32.7%|Medium|| -|0153|Find Minimum in Rotated Sorted Array|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0153.Find-Minimum-in-Rotated-Sorted-Array)|46.0%|Medium|| +|0153|Find Minimum in Rotated Sorted Array|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0153.Find-Minimum-in-Rotated-Sorted-Array)|46.1%|Medium|| |0154|Find Minimum in Rotated Sorted Array II|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0154.Find-Minimum-in-Rotated-Sorted-Array-II)|42.0%|Hard|| |0155|Min Stack|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0155.Min-Stack)|46.3%|Easy|| |0156|Binary Tree Upside Down||56.3%|Medium|| |0157|Read N Characters Given Read4||37.1%|Easy|| -|0158|Read N Characters Given Read4 II - Call multiple times||36.6%|Hard|| +|0158|Read N Characters Given Read4 II - Call multiple times||36.7%|Hard|| |0159|Longest Substring with At Most Two Distinct Characters||50.4%|Medium|| |0160|Intersection of Two Linked Lists|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0160.Intersection-of-Two-Linked-Lists)|43.0%|Easy|| |0161|One Edit Distance||33.0%|Medium|| @@ -314,7 +314,7 @@ |0174|Dungeon Game|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0174.Dungeon-Game)|33.2%|Hard|| |0175|Combine Two Tables||63.9%|Easy|| |0176|Second Highest Salary||33.1%|Easy|| -|0177|Nth Highest Salary||33.1%|Medium|| +|0177|Nth Highest Salary||33.2%|Medium|| |0178|Rank Scores||49.8%|Medium|| |0179|Largest Number|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0179.Largest-Number)|30.6%|Medium|| |0180|Consecutive Numbers||42.0%|Medium|| @@ -329,7 +329,7 @@ |0189|Rotate Array|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0189.Rotate-Array)|36.5%|Medium|| |0190|Reverse Bits|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0190.Reverse-Bits)|41.9%|Easy|| |0191|Number of 1 Bits|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0191.Number-of-1-Bits)|53.6%|Easy|| -|0192|Word Frequency||25.8%|Medium|| +|0192|Word Frequency||25.7%|Medium|| |0193|Valid Phone Numbers||25.3%|Easy|| |0194|Transpose File||24.4%|Medium|| |0195|Tenth Line||32.9%|Easy|| @@ -346,13 +346,13 @@ |0206|Reverse Linked List|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0206.Reverse-Linked-List)|65.1%|Easy|| |0207|Course Schedule|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0207.Course-Schedule)|44.3%|Medium|| |0208|Implement Trie (Prefix Tree)|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0208.Implement-Trie-(Prefix-Tree))|51.9%|Medium|| -|0209|Minimum Size Subarray Sum|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0209.Minimum-Size-Subarray-Sum)|39.3%|Medium|| +|0209|Minimum Size Subarray Sum|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0209.Minimum-Size-Subarray-Sum)|39.4%|Medium|| |0210|Course Schedule II|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0210.Course-Schedule-II)|42.5%|Medium|| |0211|Design Add and Search Words Data Structure|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0211.Design-Add-and-Search-Words-Data-Structure)|40.0%|Medium|| |0212|Word Search II|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0212.Word-Search-II)|36.9%|Hard|| |0213|House Robber II|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0213.House-Robber-II)|37.5%|Medium|| |0214|Shortest Palindrome||30.6%|Hard|| -|0215|Kth Largest Element in an Array|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0215.Kth-Largest-Element-in-an-Array)|58.2%|Medium|| +|0215|Kth Largest Element in an Array|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0215.Kth-Largest-Element-in-an-Array)|58.3%|Medium|| |0216|Combination Sum III|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0216.Combination-Sum-III)|60.2%|Medium|| |0217|Contains Duplicate|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0217.Contains-Duplicate)|56.6%|Easy|| |0218|The Skyline Problem|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0218.The-Skyline-Problem)|36.2%|Hard|| @@ -375,7 +375,7 @@ |0235|Lowest Common Ancestor of a Binary Search Tree|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0235.Lowest-Common-Ancestor-of-a-Binary-Search-Tree)|51.6%|Easy|| |0236|Lowest Common Ancestor of a Binary Tree|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0236.Lowest-Common-Ancestor-of-a-Binary-Tree)|48.5%|Medium|| |0237|Delete Node in a Linked List|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0237.Delete-Node-in-a-Linked-List)|66.7%|Easy|| -|0238|Product of Array Except Self||61.3%|Medium|| +|0238|Product of Array Except Self||61.4%|Medium|| |0239|Sliding Window Maximum|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0239.Sliding-Window-Maximum)|44.6%|Hard|| |0240|Search a 2D Matrix II|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0240.Search-a-2D-Matrix-II)|44.4%|Medium|| |0241|Different Ways to Add Parentheses||57.2%|Medium|| @@ -421,7 +421,7 @@ |0281|Zigzag Iterator||59.4%|Medium|| |0282|Expression Add Operators||36.7%|Hard|| |0283|Move Zeroes|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0283.Move-Zeroes)|58.5%|Easy|| -|0284|Peeking Iterator||50.4%|Medium|| +|0284|Peeking Iterator|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0284.Peeking-Iterator)|50.4%|Medium|| |0285|Inorder Successor in BST||42.7%|Medium|| |0286|Walls and Gates||56.3%|Medium|| |0287|Find the Duplicate Number|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0287.Find-the-Duplicate-Number)|57.4%|Medium|| @@ -452,7 +452,7 @@ |0312|Burst Balloons||53.7%|Hard|| |0313|Super Ugly Number||46.1%|Medium|| |0314|Binary Tree Vertical Order Traversal||46.9%|Medium|| -|0315|Count of Smaller Numbers After Self|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0315.Count-of-Smaller-Numbers-After-Self)|42.6%|Hard|| +|0315|Count of Smaller Numbers After Self|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0315.Count-of-Smaller-Numbers-After-Self)|42.5%|Hard|| |0316|Remove Duplicate Letters||39.0%|Medium|| |0317|Shortest Distance from All Buildings||42.7%|Hard|| |0318|Maximum Product of Word Lengths|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0318.Maximum-Product-of-Word-Lengths)|52.2%|Medium|| @@ -468,7 +468,7 @@ |0328|Odd Even Linked List|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0328.Odd-Even-Linked-List)|57.0%|Medium|| |0329|Longest Increasing Path in a Matrix|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0329.Longest-Increasing-Path-in-a-Matrix)|44.7%|Hard|| |0330|Patching Array||34.9%|Hard|| -|0331|Verify Preorder Serialization of a Binary Tree|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0331.Verify-Preorder-Serialization-of-a-Binary-Tree)|40.9%|Medium|| +|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.8%|Medium|| |0333|Largest BST Subtree||37.7%|Medium|| |0334|Increasing Triplet Subsequence||40.7%|Medium|| @@ -486,7 +486,7 @@ |0346|Moving Average from Data Stream||73.1%|Easy|| |0347|Top K Frequent Elements|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0347.Top-K-Frequent-Elements)|62.3%|Medium|| |0348|Design Tic-Tac-Toe||55.5%|Medium|| -|0349|Intersection of Two Arrays|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0349.Intersection-of-Two-Arrays)|64.6%|Easy|| +|0349|Intersection of Two Arrays|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0349.Intersection-of-Two-Arrays)|64.7%|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.6%|Medium|| |0352|Data Stream as Disjoint Intervals||48.6%|Hard|| @@ -603,12 +603,12 @@ |0463|Island Perimeter|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0463.Island-Perimeter)|66.6%|Easy|| |0464|Can I Win||29.6%|Medium|| |0465|Optimal Account Balancing||48.2%|Hard|| -|0466|Count The Repetitions||28.5%|Hard|| +|0466|Count The Repetitions||28.6%|Hard|| |0467|Unique Substrings in Wraparound String||36.0%|Medium|| |0468|Validate IP Address||24.9%|Medium|| |0469|Convex Polygon||37.4%|Medium|| |0470|Implement Rand10() Using Rand7()|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0470.Implement-Rand10()-Using-Rand7())|46.0%|Medium|| -|0471|Encode String with Shortest Length||49.1%|Hard|| +|0471|Encode String with Shortest Length||49.2%|Hard|| |0472|Concatenated Words||44.2%|Hard|| |0473|Matchsticks to Square||38.2%|Medium|| |0474|Ones and Zeroes|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0474.Ones-and-Zeroes)|43.6%|Medium|| @@ -625,7 +625,7 @@ |0485|Max Consecutive Ones|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0485.Max-Consecutive-Ones)|53.0%|Easy|| |0486|Predict the Winner||48.5%|Medium|| |0487|Max Consecutive Ones II||47.9%|Medium|| -|0488|Zuma Game||38.5%|Hard|| +|0488|Zuma Game||38.4%|Hard|| |0489|Robot Room Cleaner||72.3%|Hard|| |0490|The Maze||52.7%|Medium|| |0491|Increasing Subsequences|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0491.Increasing-Subsequences)|47.5%|Medium|| @@ -648,7 +648,7 @@ |0508|Most Frequent Subtree Sum|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0508.Most-Frequent-Subtree-Sum)|59.0%|Medium|| |0509|Fibonacci Number|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0509.Fibonacci-Number)|67.4%|Easy|| |0510|Inorder Successor in BST II||59.9%|Medium|| -|0511|Game Play Analysis I||81.2%|Easy|| +|0511|Game Play Analysis I||81.3%|Easy|| |0512|Game Play Analysis II||55.9%|Easy|| |0513|Find Bottom Left Tree Value|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0513.Find-Bottom-Left-Tree-Value)|62.5%|Medium|| |0514|Freedom Trail||44.9%|Hard|| @@ -750,20 +750,20 @@ |0610|Triangle Judgement||68.3%|Easy|| |0611|Valid Triangle Number||49.2%|Medium|| |0612|Shortest Distance in a Plane||61.1%|Medium|| -|0613|Shortest Distance in a Line||79.4%|Easy|| +|0613|Shortest Distance in a Line||79.5%|Easy|| |0614|Second Degree Follower||32.4%|Medium|| |0615|Average Salary: Departments VS Company||52.0%|Hard|| |0616|Add Bold Tag in String||44.6%|Medium|| |0617|Merge Two Binary Trees||75.3%|Easy|| |0618|Students Report By Geography||59.5%|Hard|| |0619|Biggest Single Number||44.8%|Easy|| -|0620|Not Boring Movies||69.6%|Easy|| +|0620|Not Boring Movies||69.7%|Easy|| |0621|Task Scheduler||51.7%|Medium|| |0622|Design Circular Queue||45.3%|Medium|| -|0623|Add One Row to Tree||50.3%|Medium|| +|0623|Add One Row to Tree||50.4%|Medium|| |0624|Maximum Distance in Arrays||39.5%|Medium|| |0625|Minimum Factorization||32.9%|Medium|| -|0626|Exchange Seats||65.3%|Medium|| +|0626|Exchange Seats||65.4%|Medium|| |0627|Swap Salary||77.5%|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|| @@ -773,7 +773,7 @@ |0633|Sum of Square Numbers|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0633.Sum-of-Square-Numbers)|32.5%|Medium|| |0634|Find the Derangement of An Array||40.5%|Medium|| |0635|Design Log Storage System||59.7%|Medium|| -|0636|Exclusive Time of Functions|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0636.Exclusive-Time-of-Functions)|54.2%|Medium|| +|0636|Exclusive Time of Functions|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0636.Exclusive-Time-of-Functions)|54.3%|Medium|| |0637|Average of Levels in Binary Tree|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0637.Average-of-Levels-in-Binary-Tree)|64.7%|Easy|| |0638|Shopping Offers|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0638.Shopping-Offers)|52.8%|Medium|| |0639|Decode Ways II||27.5%|Hard|| @@ -801,7 +801,7 @@ |0661|Image Smoother|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0661.Image-Smoother)|52.3%|Easy|| |0662|Maximum Width of Binary Tree|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0662.Maximum-Width-of-Binary-Tree)|39.9%|Medium|| |0663|Equal Tree Partition||39.7%|Medium|| -|0664|Strange Printer||41.3%|Hard|| +|0664|Strange Printer||41.4%|Hard|| |0665|Non-decreasing Array||19.7%|Medium|| |0666|Path Sum IV||56.0%|Medium|| |0667|Beautiful Arrangement II||55.1%|Medium|| @@ -822,7 +822,7 @@ |0682|Baseball Game|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0682.Baseball-Game)|66.7%|Easy|| |0683|K Empty Slots||36.0%|Hard|| |0684|Redundant Connection|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0684.Redundant-Connection)|58.9%|Medium|| -|0685|Redundant Connection II|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0685.Redundant-Connection-II)|33.0%|Hard|| +|0685|Redundant Connection II|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0685.Redundant-Connection-II)|32.9%|Hard|| |0686|Repeated String Match||32.8%|Medium|| |0687|Longest Univalue Path||37.2%|Medium|| |0688|Knight Probability in Chessboard||50.0%|Medium|| @@ -840,7 +840,7 @@ |0700|Search in a Binary Search Tree||73.4%|Easy|| |0701|Insert into a Binary Search Tree||75.8%|Medium|| |0702|Search in a Sorted Array of Unknown Size||68.7%|Medium|| -|0703|Kth Largest Element in a Stream||50.6%|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.6%|Easy|| |0704|Binary Search|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0704.Binary-Search)|54.0%|Easy|| |0705|Design HashSet|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0705.Design-HashSet)|64.7%|Easy|| |0706|Design HashMap|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0706.Design-HashMap)|62.7%|Easy|| @@ -854,7 +854,7 @@ |0714|Best Time to Buy and Sell Stock with Transaction Fee|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0714.Best-Time-to-Buy-and-Sell-Stock-with-Transaction-Fee)|56.0%|Medium|| |0715|Range Module|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0715.Range-Module)|40.1%|Hard|| |0716|Max Stack||43.0%|Easy|| -|0717|1-bit and 2-bit Characters|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0717.1-bit-and-2-bit-Characters)|47.4%|Easy|| +|0717|1-bit and 2-bit Characters|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0717.1-bit-and-2-bit-Characters)|47.3%|Easy|| |0718|Maximum Length of Repeated Subarray|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0718.Maximum-Length-of-Repeated-Subarray)|50.3%|Medium|| |0719|Find K-th Smallest Pair Distance|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0719.Find-K-th-Smallest-Pair-Distance)|32.5%|Hard|| |0720|Longest Word in Dictionary|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0720.Longest-Word-in-Dictionary)|49.1%|Easy|| @@ -919,16 +919,16 @@ |0779|K-th Symbol in Grammar||38.5%|Medium|| |0780|Reaching Points||30.3%|Hard|| |0781|Rabbits in Forest|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0781.Rabbits-in-Forest)|55.4%|Medium|| -|0782|Transform to Chessboard||46.9%|Hard|| +|0782|Transform to Chessboard||47.0%|Hard|| |0783|Minimum Distance Between BST Nodes||53.8%|Easy|| -|0784|Letter Case Permutation|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0784.Letter-Case-Permutation)|66.4%|Medium|| +|0784|Letter Case Permutation|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0784.Letter-Case-Permutation)|66.5%|Medium|| |0785|Is Graph Bipartite?|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0785.Is-Graph-Bipartite?)|48.3%|Medium|| |0786|K-th Smallest Prime Fraction|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0786.K-th-Smallest-Prime-Fraction)|42.3%|Hard|| |0787|Cheapest Flights Within K Stops||39.5%|Medium|| |0788|Rotated Digits||57.1%|Easy|| |0789|Escape The Ghosts||58.3%|Medium|| |0790|Domino and Tromino Tiling||40.0%|Medium|| -|0791|Custom Sort String||66.0%|Medium|| +|0791|Custom Sort String||65.9%|Medium|| |0792|Number of Matching Subsequences||48.1%|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|| |0794|Valid Tic-Tac-Toe State||33.7%|Medium|| @@ -973,7 +973,7 @@ |0833|Find And Replace in String||51.4%|Medium|| |0834|Sum of Distances in Tree|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0834.Sum-of-Distances-in-Tree)|45.8%|Hard|| |0835|Image Overlap||61.8%|Medium|| -|0836|Rectangle Overlap|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0836.Rectangle-Overlap)|44.8%|Easy|| +|0836|Rectangle Overlap|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0836.Rectangle-Overlap)|44.7%|Easy|| |0837|New 21 Game||35.3%|Medium|| |0838|Push Dominoes|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0838.Push-Dominoes)|49.8%|Medium|| |0839|Similar String Groups|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0839.Similar-String-Groups)|40.5%|Hard|| @@ -990,7 +990,7 @@ |0850|Rectangle Area II|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0850.Rectangle-Area-II)|48.3%|Hard|| |0851|Loud and Rich|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0851.Loud-and-Rich)|52.6%|Medium|| |0852|Peak Index in a Mountain Array|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0852.Peak-Index-in-a-Mountain-Array)|71.7%|Easy|| -|0853|Car Fleet|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0853.Car-Fleet)|43.7%|Medium|| +|0853|Car Fleet|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0853.Car-Fleet)|43.8%|Medium|| |0854|K-Similar Strings||38.7%|Hard|| |0855|Exam Room||43.4%|Medium|| |0856|Score of Parentheses|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0856.Score-of-Parentheses)|62.4%|Medium|| @@ -1011,7 +1011,7 @@ |0871|Minimum Number of Refueling Stops||32.3%|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|| -|0874|Walking Robot Simulation||36.7%|Easy|| +|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|| |0877|Stone Game||66.4%|Medium|| @@ -1044,7 +1044,7 @@ |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|| -|0907|Sum of Subarray Minimums|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0907.Sum-of-Subarray-Minimums)|33.2%|Medium|| +|0907|Sum of Subarray Minimums|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0907.Sum-of-Subarray-Minimums)|33.1%|Medium|| |0908|Smallest Range I||66.4%|Easy|| |0909|Snakes and Ladders||39.2%|Medium|| |0910|Smallest Range II|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0910.Smallest-Range-II)|31.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.9%|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.0%|Medium|| |0960|Delete Columns to Make Sorted III||54.8%|Hard|| @@ -1112,9 +1112,9 @@ |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.8%|Medium|| -|0975|Odd Even Jump||41.5%|Hard|| +|0975|Odd Even Jump||41.6%|Hard|| |0976|Largest Perimeter Triangle|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0976.Largest-Perimeter-Triangle)|58.5%|Easy|| -|0977|Squares of a Sorted Array|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0977.Squares-of-a-Sorted-Array)|72.2%|Easy|| +|0977|Squares of a Sorted Array|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0977.Squares-of-a-Sorted-Array)|72.1%|Easy|| |0978|Longest Turbulent Subarray|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0978.Longest-Turbulent-Subarray)|46.7%|Medium|| |0979|Distribute Coins in Binary Tree|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0979.Distribute-Coins-in-Binary-Tree)|69.6%|Medium|| |0980|Unique Paths III|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0980.Unique-Paths-III)|77.2%|Hard|| @@ -1138,8 +1138,8 @@ |0998|Maximum Binary Tree II||63.8%|Medium|| |0999|Available Captures for Rook|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0999.Available-Captures-for-Rook)|67.7%|Easy|| |1000|Minimum Cost to Merge Stones||40.4%|Hard|| -|1001|Grid Illumination||36.9%|Hard|| -|1002|Find Common Characters|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1002.Find-Common-Characters)|68.6%|Easy|| +|1001|Grid Illumination||36.8%|Hard|| +|1002|Find Common Characters|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1002.Find-Common-Characters)|68.5%|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.3%|Medium|| |1004|Max Consecutive Ones III|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1004.Max-Consecutive-Ones-III)|60.7%|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|| @@ -1199,7 +1199,7 @@ |1059|All Paths from Source Lead to Destination||43.2%|Medium|| |1060|Missing Element in Sorted Array||54.7%|Medium|| |1061|Lexicographically Smallest Equivalent String||66.7%|Medium|| -|1062|Longest Repeating Substring||58.2%|Medium|| +|1062|Longest Repeating Substring||58.3%|Medium|| |1063|Number of Valid Subarrays||72.1%|Hard|| |1064|Fixed Point||65.3%|Easy|| |1065|Index Pairs of a String||61.0%|Easy|| @@ -1212,7 +1212,7 @@ |1072|Flip Columns For Maximum Number of Equal Rows||61.3%|Medium|| |1073|Adding Two Negabinary Numbers|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1073.Adding-Two-Negabinary-Numbers)|34.8%|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.7%|Hard|| -|1075|Project Employees I||66.1%|Easy|| +|1075|Project Employees I||66.2%|Easy|| |1076|Project Employees II||53.0%|Easy|| |1077|Project Employees III||77.4%|Medium|| |1078|Occurrences After Bigram|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1078.Occurrences-After-Bigram)|64.9%|Easy|| @@ -1229,16 +1229,16 @@ |1089|Duplicate Zeros|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1089.Duplicate-Zeros)|51.9%|Easy|| |1090|Largest Values From Labels||60.0%|Medium|| |1091|Shortest Path in Binary Matrix||39.1%|Medium|| -|1092|Shortest Common Supersequence ||52.9%|Hard|| +|1092|Shortest Common Supersequence ||53.0%|Hard|| |1093|Statistics from a Large Sample|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1093.Statistics-from-a-Large-Sample)|49.3%|Medium|| |1094|Car Pooling||59.0%|Medium|| |1095|Find in Mountain Array||36.1%|Hard|| |1096|Brace Expansion II||62.5%|Hard|| -|1097|Game Play Analysis V||56.2%|Hard|| -|1098|Unpopular Books||45.5%|Medium|| +|1097|Game Play Analysis V||56.3%|Hard|| +|1098|Unpopular Books||45.4%|Medium|| |1099|Two Sum Less Than K||60.8%|Easy|| |1100|Find K-Length Substrings With No Repeated Characters||73.2%|Medium|| -|1101|The Earliest Moment When Everyone Become Friends||67.9%|Medium|| +|1101|The Earliest Moment When Everyone Become Friends||68.0%|Medium|| |1102|Path With Maximum Minimum Value||50.4%|Medium|| |1103|Distribute Candies to People||63.5%|Easy|| |1104|Path In Zigzag Labelled Binary Tree||73.1%|Medium|| @@ -1251,7 +1251,7 @@ |1111|Maximum Nesting Depth of Two Valid Parentheses Strings|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1111.Maximum-Nesting-Depth-of-Two-Valid-Parentheses-Strings)|72.8%|Medium|| |1112|Highest Grade For Each Student||71.9%|Medium|| |1113|Reported Posts||65.7%|Easy|| -|1114|Print in Order||67.0%|Easy|| +|1114|Print in Order||67.1%|Easy|| |1115|Print FooBar Alternately||59.0%|Medium|| |1116|Print Zero Even Odd||57.7%|Medium|| |1117|Building H2O||53.1%|Medium|| @@ -1262,9 +1262,9 @@ |1122|Relative Sort Array|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1122.Relative-Sort-Array)|68.1%|Easy|| |1123|Lowest Common Ancestor of Deepest Leaves|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1123.Lowest-Common-Ancestor-of-Deepest-Leaves)|67.9%|Medium|| |1124|Longest Well-Performing Interval||33.3%|Medium|| -|1125|Smallest Sufficient Team||47.0%|Hard|| -|1126|Active Businesses||68.7%|Medium|| -|1127|User Purchase Platform||50.1%|Hard|| +|1125|Smallest Sufficient Team||47.1%|Hard|| +|1126|Active Businesses||68.6%|Medium|| +|1127|User Purchase Platform||50.2%|Hard|| |1128|Number of Equivalent Domino Pairs|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1128.Number-of-Equivalent-Domino-Pairs)|46.6%|Easy|| |1129|Shortest Path with Alternating Colors||40.2%|Medium|| |1130|Minimum Cost Tree From Leaf Values||67.3%|Medium|| @@ -1276,7 +1276,7 @@ |1136|Parallel Courses||61.2%|Hard|| |1137|N-th Tribonacci Number|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1137.N-th-Tribonacci-Number)|56.0%|Easy|| |1138|Alphabet Board Path||51.0%|Medium|| -|1139|Largest 1-Bordered Square||48.5%|Medium|| +|1139|Largest 1-Bordered Square||48.6%|Medium|| |1140|Stone Game II||64.7%|Medium|| |1141|User Activity for the Past 30 Days I||54.4%|Easy|| |1142|User Activity for the Past 30 Days II||35.4%|Easy|| @@ -1287,9 +1287,9 @@ |1147|Longest Chunked Palindrome Decomposition||59.5%|Hard|| |1148|Article Views I||77.1%|Easy|| |1149|Article Views II||48.3%|Medium|| -|1150|Check If a Number Is Majority Element in a Sorted Array||57.6%|Easy|| +|1150|Check If a Number Is Majority Element in a Sorted Array||57.5%|Easy|| |1151|Minimum Swaps to Group All 1's Together||58.5%|Medium|| -|1152|Analyze User Website Visit Pattern||43.4%|Medium|| +|1152|Analyze User Website Visit Pattern||43.3%|Medium|| |1153|String Transforms Into Another String||36.0%|Hard|| |1154|Day of the Year|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1154.Day-of-the-Year)|49.3%|Easy|| |1155|Number of Dice Rolls With Target Sum||47.5%|Medium|| @@ -1304,8 +1304,8 @@ |1164|Product Price at a Given Date||68.4%|Medium|| |1165|Single-Row Keyboard||84.8%|Easy|| |1166|Design File System||58.5%|Medium|| -|1167|Minimum Cost to Connect Sticks||64.3%|Medium|| -|1168|Optimize Water Distribution in a Village||61.4%|Hard|| +|1167|Minimum Cost to Connect Sticks||64.4%|Medium|| +|1168|Optimize Water Distribution in a Village||61.5%|Hard|| |1169|Invalid Transactions||31.2%|Medium|| |1170|Compare Strings by Frequency of the Smallest Character|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1170.Compare-Strings-by-Frequency-of-the-Smallest-Character)|59.5%|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.4%|Medium|| @@ -1323,7 +1323,7 @@ |1183|Maximum Number of Ones||57.2%|Hard|| |1184|Distance Between Bus Stops|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1184.Distance-Between-Bus-Stops)|54.1%|Easy|| |1185|Day of the Week|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1185.Day-of-the-Week)|61.6%|Easy|| -|1186|Maximum Subarray Sum with One Deletion||38.6%|Medium|| +|1186|Maximum Subarray Sum with One Deletion||38.7%|Medium|| |1187|Make Array Strictly Increasing||41.8%|Hard|| |1188|Design Bounded Blocking Queue||72.7%|Medium|| |1189|Maximum Number of Balloons|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1189.Maximum-Number-of-Balloons)|61.7%|Easy|| @@ -1351,20 +1351,20 @@ |1211|Queries Quality and Percentage||69.8%|Easy|| |1212|Team Scores in Football Tournament||56.8%|Medium|| |1213|Intersection of Three Sorted Arrays||79.3%|Easy|| -|1214|Two Sum BSTs||67.8%|Medium|| +|1214|Two Sum BSTs||67.7%|Medium|| |1215|Stepping Numbers||43.3%|Medium|| |1216|Valid Palindrome III||49.7%|Hard|| |1217|Minimum Cost to Move Chips to The Same Position|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1217.Minimum-Cost-to-Move-Chips-to-The-Same-Position)|71.2%|Easy|| |1218|Longest Arithmetic Subsequence of Given Difference||46.5%|Medium|| -|1219|Path with Maximum Gold||65.6%|Medium|| -|1220|Count Vowels Permutation||54.3%|Hard|| +|1219|Path with Maximum Gold||65.7%|Medium|| +|1220|Count Vowels Permutation||54.2%|Hard|| |1221|Split a String in Balanced Strings|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1221.Split-a-String-in-Balanced-Strings)|84.1%|Easy|| |1222|Queens That Can Attack the King||69.4%|Medium|| |1223|Dice Roll Simulation||46.7%|Hard|| |1224|Maximum Equal Frequency||34.5%|Hard|| |1225|Report Contiguous Dates||62.6%|Hard|| |1226|The Dining Philosophers||59.8%|Medium|| -|1227|Airplane Seat Assignment Probability||62.1%|Medium|| +|1227|Airplane Seat Assignment Probability||62.0%|Medium|| |1228|Missing Number In Arithmetic Progression||51.5%|Easy|| |1229|Meeting Scheduler||54.4%|Medium|| |1230|Toss Strange Coins||49.9%|Medium|| @@ -1384,10 +1384,10 @@ |1244|Design A Leaderboard||65.7%|Medium|| |1245|Tree Diameter||61.3%|Medium|| |1246|Palindrome Removal||45.9%|Hard|| -|1247|Minimum Swaps to Make Strings Equal||62.4%|Medium|| +|1247|Minimum Swaps to Make Strings Equal||62.3%|Medium|| |1248|Count Number of Nice Subarrays||56.1%|Medium|| |1249|Minimum Remove to Make Valid Parentheses||63.7%|Medium|| -|1250|Check If It Is a Good Array||56.3%|Hard|| +|1250|Check If It Is a Good Array||56.2%|Hard|| |1251|Average Selling Price||82.5%|Easy|| |1252|Cells with Odd Values in a Matrix|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1252.Cells-with-Odd-Values-in-a-Matrix)|78.8%|Easy|| |1253|Reconstruct a 2-Row Binary Matrix||41.6%|Medium|| @@ -1402,9 +1402,9 @@ |1262|Greatest Sum Divisible by Three||49.5%|Medium|| |1263|Minimum Moves to Move a Box to Their Target Location||43.2%|Hard|| |1264|Page Recommendations||69.2%|Medium|| -|1265|Print Immutable Linked List in Reverse||94.3%|Medium|| +|1265|Print Immutable Linked List in Reverse||94.4%|Medium|| |1266|Minimum Time Visiting All Points|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1266.Minimum-Time-Visiting-All-Points)|79.5%|Easy|| -|1267|Count Servers that Communicate||57.7%|Medium|| +|1267|Count Servers that Communicate||57.8%|Medium|| |1268|Search Suggestions System||64.6%|Medium|| |1269|Number of Ways to Stay in the Same Place After Some Steps||43.2%|Hard|| |1270|All People Report to the Given Manager||88.2%|Medium|| @@ -1431,7 +1431,7 @@ |1291|Sequential Digits||57.4%|Medium|| |1292|Maximum Side Length of a Square with Sum Less than or Equal to Threshold||50.5%|Medium|| |1293|Shortest Path in a Grid with Obstacles Elimination||42.9%|Hard|| -|1294|Weather Type in Each Country||66.8%|Easy|| +|1294|Weather Type in Each Country||66.7%|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.2%|Easy|| |1296|Divide Array in Sets of K Consecutive Numbers||55.4%|Medium|| |1297|Maximum Number of Occurrences of a Substring||49.8%|Medium|| @@ -1458,7 +1458,7 @@ |1318|Minimum Flips to Make a OR b Equal to c||63.9%|Medium|| |1319|Number of Operations to Make Network Connected|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1319.Number-of-Operations-to-Make-Network-Connected)|55.3%|Medium|| |1320|Minimum Distance to Type a Word Using Two Fingers||62.1%|Hard|| -|1321|Restaurant Growth||70.9%|Medium|| +|1321|Restaurant Growth||71.0%|Medium|| |1322|Ads Performance||58.0%|Easy|| |1323|Maximum 69 Number||78.0%|Easy|| |1324|Print Words Vertically||58.8%|Medium|| @@ -1469,7 +1469,7 @@ |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.6%|Hard|| |1331|Rank Transform of an Array||57.6%|Easy|| -|1332|Remove Palindromic Subsequences||62.8%|Easy|| +|1332|Remove Palindromic Subsequences||62.7%|Easy|| |1333|Filter Restaurants by Vegan-Friendly, Price and Distance||57.1%|Medium|| |1334|Find the City With the Smallest Number of Neighbors at a Threshold Distance||46.8%|Medium|| |1335|Minimum Difficulty of a Job Schedule||57.0%|Hard|| @@ -1484,7 +1484,7 @@ |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.3%|Easy|| -|1347|Minimum Number of Steps to Make Two Strings Anagram||75.2%|Medium|| +|1347|Minimum Number of Steps to Make Two Strings Anagram||75.3%|Medium|| |1348|Tweet Counts Per Frequency||35.3%|Medium|| |1349|Maximum Students Taking Exam||44.2%|Hard|| |1350|Students With Invalid Departments||90.4%|Easy|| @@ -1492,14 +1492,14 @@ |1352|Product of the Last K Numbers||44.2%|Medium|| |1353|Maximum Number of Events That Can Be Attended||30.5%|Medium|| |1354|Construct Target Array With Multiple Sums||31.3%|Hard|| -|1355|Activity Participants||74.3%|Medium|| +|1355|Activity Participants||74.4%|Medium|| |1356|Sort Integers by The Number of 1 Bits||69.7%|Easy|| |1357|Apply Discount Every n Orders||66.7%|Medium|| |1358|Number of Substrings Containing All Three Characters||60.5%|Medium|| |1359|Count All Valid Pickup and Delivery Options||56.5%|Hard|| |1360|Number of Days Between Two Dates||46.9%|Easy|| |1361|Validate Binary Tree Nodes||43.9%|Medium|| -|1362|Closest Divisors||57.7%|Medium|| +|1362|Closest Divisors||57.6%|Medium|| |1363|Largest Multiple of Three||34.1%|Hard|| |1364|Number of Trusted Contacts of a Customer||78.4%|Medium|| |1365|How Many Numbers Are Smaller Than the Current Number||86.0%|Easy|| @@ -1530,12 +1530,12 @@ |1390|Four Divisors||39.1%|Medium|| |1391|Check if There is a Valid Path in a Grid||44.9%|Medium|| |1392|Longest Happy Prefix||41.8%|Hard|| -|1393|Capital Gain/Loss||90.6%|Medium|| +|1393|Capital Gain/Loss||90.5%|Medium|| |1394|Find Lucky Integer in an Array||63.2%|Easy|| |1395|Count Number of Teams||78.8%|Medium|| |1396|Design Underground System||69.5%|Medium|| |1397|Find All Good Strings||38.3%|Hard|| -|1398|Customers Who Bought Products A and B but Not C||82.0%|Medium|| +|1398|Customers Who Bought Products A and B but Not C||81.9%|Medium|| |1399|Count Largest Group||65.3%|Easy|| |1400|Construct K Palindrome Strings||62.8%|Medium|| |1401|Circle and Rectangle Overlapping||42.4%|Medium|| @@ -1552,7 +1552,7 @@ |1412|Find the Quiet Students in All Exams||65.1%|Hard|| |1413|Minimum Value to Get Positive Step by Step Sum||65.5%|Easy|| |1414|Find the Minimum Number of Fibonacci Numbers Whose Sum Is K||63.1%|Medium|| -|1415|The k-th Lexicographical String of All Happy Strings of Length n||69.9%|Medium|| +|1415|The k-th Lexicographical String of All Happy Strings of Length n||69.8%|Medium|| |1416|Restore The Array||36.3%|Hard|| |1417|Reformat The String||55.2%|Easy|| |1418|Display Table of Food Orders in a Restaurant||68.7%|Medium|| @@ -1580,11 +1580,11 @@ |1440|Evaluate Boolean Expression||74.4%|Medium|| |1441|Build an Array With Stack Operations||69.7%|Easy|| |1442|Count Triplets That Can Form Two Arrays of Equal XOR||71.3%|Medium|| -|1443|Minimum Time to Collect All Apples in a Tree||54.7%|Medium|| +|1443|Minimum Time to Collect All Apples in a Tree||54.6%|Medium|| |1444|Number of Ways of Cutting a Pizza||53.7%|Hard|| |1445|Apples & Oranges||90.6%|Medium|| |1446|Consecutive Characters||61.0%|Easy|| -|1447|Simplified Fractions||62.2%|Medium|| +|1447|Simplified Fractions||62.3%|Medium|| |1448|Count Good Nodes in Binary Tree||70.5%|Medium|| |1449|Form Largest Integer With Digits That Add up to Target||43.9%|Hard|| |1450|Number of Students Doing Homework at a Given Time||77.3%|Easy|| @@ -1628,7 +1628,7 @@ |1488|Avoid Flood in The City||24.6%|Medium|| |1489|Find Critical and Pseudo-Critical Edges in Minimum Spanning Tree||52.7%|Hard|| |1490|Clone N-ary Tree||83.4%|Medium|| -|1491|Average Salary Excluding the Minimum and Maximum Salary||68.8%|Easy|| +|1491|Average Salary Excluding the Minimum and Maximum Salary||68.7%|Easy|| |1492|The kth Factor of n||63.4%|Medium|| |1493|Longest Subarray of 1's After Deleting One Element||58.0%|Medium|| |1494|Parallel Courses II||31.4%|Hard|| @@ -1636,9 +1636,9 @@ |1496|Path Crossing||55.3%|Easy|| |1497|Check If Array Pairs Are Divisible by k||40.5%|Medium|| |1498|Number of Subsequences That Satisfy the Given Sum Condition||38.3%|Medium|| -|1499|Max Value of Equation||45.0%|Hard|| +|1499|Max Value of Equation||45.1%|Hard|| |1500|Design a File Sharing System||46.9%|Medium|| -|1501|Countries You Can Safely Invest In||60.4%|Medium|| +|1501|Countries You Can Safely Invest In||60.5%|Medium|| |1502|Can Make Arithmetic Progression From Sequence||71.2%|Easy|| |1503|Last Moment Before All Ants Fall Out of a Plank||53.1%|Medium|| |1504|Count Submatrices With All Ones||60.9%|Medium|| @@ -1649,12 +1649,12 @@ |1509|Minimum Difference Between Largest and Smallest Value in Three Moves||52.0%|Medium|| |1510|Stone Game IV||58.9%|Hard|| |1511|Customer Order Frequency||73.6%|Easy|| -|1512|Number of Good Pairs|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1512.Number-of-Good-Pairs)|87.8%|Easy|| +|1512|Number of Good Pairs|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1512.Number-of-Good-Pairs)|87.7%|Easy|| |1513|Number of Substrings With Only 1s||41.6%|Medium|| |1514|Path with Maximum Probability||39.9%|Medium|| |1515|Best Position for a Service Centre||37.1%|Hard|| |1516|Move Sub-Tree of N-Ary Tree||63.2%|Hard|| -|1517|Find Users With Valid E-Mails||71.9%|Easy|| +|1517|Find Users With Valid E-Mails||71.8%|Easy|| |1518|Water Bottles||60.6%|Easy|| |1519|Number of Nodes in the Sub-Tree With the Same Label||37.0%|Medium|| |1520|Maximum Number of Non-Overlapping Substrings||36.2%|Hard|| @@ -1664,18 +1664,18 @@ |1524|Number of Sub-arrays With Odd Sum||39.8%|Medium|| |1525|Number of Good Ways to Split a String||66.4%|Medium|| |1526|Minimum Number of Increments on Subarrays to Form a Target Array||60.0%|Hard|| -|1527|Patients With a Condition||69.7%|Easy|| +|1527|Patients With a Condition||69.5%|Easy|| |1528|Shuffle String||85.8%|Easy|| |1529|Bulb Switcher IV||70.9%|Medium|| |1530|Number of Good Leaf Nodes Pairs||56.1%|Medium|| |1531|String Compression II||33.8%|Hard|| |1532|The Most Recent Three Orders||72.9%|Medium|| -|1533|Find the Index of the Large Integer||54.8%|Medium|| +|1533|Find the Index of the Large Integer||54.7%|Medium|| |1534|Count Good Triplets||80.4%|Easy|| |1535|Find the Winner of an Array Game||47.4%|Medium|| |1536|Minimum Swaps to Arrange a Binary Grid||43.3%|Medium|| |1537|Get the Maximum Score||36.4%|Hard|| -|1538|Guess the Majority in a Hidden Array||61.4%|Medium|| +|1538|Guess the Majority in a Hidden Array||61.3%|Medium|| |1539|Kth Missing Positive Number|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1539.Kth-Missing-Positive-Number)|55.1%|Easy|| |1540|Can Convert String in K Moves||30.7%|Medium|| |1541|Minimum Insertions to Balance a Parentheses String||42.7%|Medium|| @@ -1686,16 +1686,16 @@ |1546|Maximum Number of Non-Overlapping Subarrays With Sum Equals Target||43.7%|Medium|| |1547|Minimum Cost to Cut a Stick||52.4%|Hard|| |1548|The Most Similar Path in a Graph||54.2%|Hard|| -|1549|The Most Recent Orders for Each Product||66.6%|Medium|| +|1549|The Most Recent Orders for Each Product||66.7%|Medium|| |1550|Three Consecutive Odds||64.9%|Easy|| |1551|Minimum Operations to Make Array Equal||77.9%|Medium|| |1552|Magnetic Force Between Two Balls||48.8%|Medium|| |1553|Minimum Number of Days to Eat N Oranges||29.5%|Hard|| -|1554|Strings Differ by One Character||63.3%|Medium|| +|1554|Strings Differ by One Character||63.4%|Medium|| |1555|Bank Account Summary||52.7%|Medium|| |1556|Thousand Separator||57.8%|Easy|| |1557|Minimum Number of Vertices to Reach All Nodes||75.5%|Medium|| -|1558|Minimum Numbers of Function Calls to Make Target Array||62.6%|Medium|| +|1558|Minimum Numbers of Function Calls to Make Target Array||63.5%|Medium|| |1559|Detect Cycles in 2D Grid||44.3%|Hard|| |1560|Most Visited Sector in a Circular Track||56.9%|Easy|| |1561|Maximum Number of Coins You Can Get||77.7%|Medium|| @@ -1721,20 +1721,20 @@ |1581|Customer Who Visited but Did Not Make Any Transactions||89.8%|Easy|| |1582|Special Positions in a Binary Matrix||64.3%|Easy|| |1583|Count Unhappy Friends||54.3%|Medium|| -|1584|Min Cost to Connect All Points||51.5%|Medium|| +|1584|Min Cost to Connect All Points||51.6%|Medium|| |1585|Check If String Is Transformable With Substring Sort Operations||48.2%|Hard|| |1586|Binary Search Tree Iterator II||66.5%|Medium|| |1587|Bank Account Summary II||89.9%|Easy|| |1588|Sum of All Odd Length Subarrays||82.0%|Easy|| |1589|Maximum Sum Obtained of Any Permutation||34.8%|Medium|| -|1590|Make Sum Divisible by P||27.0%|Medium|| +|1590|Make Sum Divisible by P||27.1%|Medium|| |1591|Strange Printer II||55.1%|Hard|| -|1592|Rearrange Spaces Between Words||43.7%|Easy|| -|1593|Split a String Into the Max Number of Unique Substrings||48.8%|Medium|| +|1592|Rearrange Spaces Between Words||43.8%|Easy|| +|1593|Split a String Into the Max Number of Unique Substrings||48.9%|Medium|| |1594|Maximum Non Negative Product in a Matrix||32.0%|Medium|| |1595|Minimum Cost to Connect Two Groups of Points||42.9%|Hard|| |1596|The Most Frequently Ordered Products for Each Customer||83.9%|Medium|| -|1597|Build Binary Expression Tree From Infix Expression||63.2%|Hard|| +|1597|Build Binary Expression Tree From Infix Expression||63.1%|Hard|| |1598|Crawler Log Folder||64.1%|Easy|| |1599|Maximum Profit of Operating a Centennial Wheel||43.6%|Medium|| |1600|Throne Inheritance||60.2%|Medium|| @@ -1742,62 +1742,62 @@ |1602|Find Nearest Right Node in Binary Tree||73.9%|Medium|| |1603|Design Parking System||86.5%|Easy|| |1604|Alert Using Same Key-Card Three or More Times in a One Hour Period||42.3%|Medium|| -|1605|Find Valid Matrix Given Row and Column Sums||77.3%|Medium|| +|1605|Find Valid Matrix Given Row and Column Sums||77.2%|Medium|| |1606|Find Servers That Handled Most Number of Requests||36.9%|Hard|| |1607|Sellers With No Sales||55.5%|Easy|| |1608|Special Array With X Elements Greater Than or Equal X||61.7%|Easy|| |1609|Even Odd Tree||53.0%|Medium|| |1610|Maximum Number of Visible Points||29.0%|Hard|| |1611|Minimum One Bit Operations to Make Integers Zero||57.5%|Hard|| -|1612|Check If Two Expression Trees are Equivalent||69.9%|Medium|| +|1612|Check If Two Expression Trees are Equivalent||70.0%|Medium|| |1613|Find the Missing IDs||73.4%|Medium|| |1614|Maximum Nesting Depth of the Parentheses||83.2%|Easy|| |1615|Maximal Network Rank||51.9%|Medium|| |1616|Split Two Strings to Make Palindrome||36.2%|Medium|| |1617|Count Subtrees With Max Distance Between Cities||63.7%|Hard|| -|1618|Maximum Font to Fit a Sentence in a Screen||57.4%|Medium|| +|1618|Maximum Font to Fit a Sentence in a Screen||57.3%|Medium|| |1619|Mean of Array After Removing Some Elements||65.1%|Easy|| |1620|Coordinate With Maximum Network Quality||37.1%|Medium|| -|1621|Number of Sets of K Non-Overlapping Line Segments||41.2%|Medium|| +|1621|Number of Sets of K Non-Overlapping Line Segments||41.0%|Medium|| |1622|Fancy Sequence||15.3%|Hard|| -|1623|All Valid Triplets That Can Represent a Country||88.8%|Easy|| +|1623|All Valid Triplets That Can Represent a Country||88.9%|Easy|| |1624|Largest Substring Between Two Equal Characters||59.0%|Easy|| |1625|Lexicographically Smallest String After Applying Operations||63.7%|Medium|| |1626|Best Team With No Conflicts||37.7%|Medium|| |1627|Graph Connectivity With Threshold||38.5%|Hard|| -|1628|Design an Expression Tree With Evaluate Function||80.4%|Medium|| +|1628|Design an Expression Tree With Evaluate Function||80.2%|Medium|| |1629|Slowest Key||59.2%|Easy|| |1630|Arithmetic Subarrays||77.7%|Medium|| |1631|Path With Minimum Effort||50.1%|Medium|| |1632|Rank Transform of a Matrix||30.7%|Hard|| -|1633|Percentage of Users Attended a Contest||72.0%|Easy|| -|1634|Add Two Polynomials Represented as Linked Lists||55.4%|Medium|| -|1635|Hopper Company Queries I||56.2%|Hard|| +|1633|Percentage of Users Attended a Contest||72.1%|Easy|| +|1634|Add Two Polynomials Represented as Linked Lists||55.7%|Medium|| +|1635|Hopper Company Queries I||56.4%|Hard|| |1636|Sort Array by Increasing Frequency||66.8%|Easy|| |1637|Widest Vertical Area Between Two Points Containing No Points||83.9%|Medium|| -|1638|Count Substrings That Differ by One Character||68.7%|Medium|| +|1638|Count Substrings That Differ by One Character||68.8%|Medium|| |1639|Number of Ways to Form a Target String Given a Dictionary||39.5%|Hard|| |1640|Check Array Formation Through Concatenation|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1640.Check-Array-Formation-Through-Concatenation)|60.2%|Easy|| |1641|Count Sorted Vowel Strings|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1641.Count-Sorted-Vowel-Strings)|77.0%|Medium|| |1642|Furthest Building You Can Reach||50.6%|Medium|| |1643|Kth Smallest Instructions||43.4%|Hard|| |1644|Lowest Common Ancestor of a Binary Tree II||57.2%|Medium|| -|1645|Hopper Company Queries II||39.6%|Hard|| +|1645|Hopper Company Queries II||39.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.5%|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.4%|Medium|| |1648|Sell Diminishing-Valued Colored Balls|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1648.Sell-Diminishing-Valued-Colored-Balls)|30.8%|Medium|| |1649|Create Sorted Array through Instructions|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1649.Create-Sorted-Array-through-Instructions)|36.3%|Hard|| -|1650|Lowest Common Ancestor of a Binary Tree III||77.1%|Medium|| -|1651|Hopper Company Queries III||67.3%|Hard|| -|1652|Defuse the Bomb|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1652.Defuse-the-Bomb)|63.1%|Easy|| +|1650|Lowest Common Ancestor of a Binary Tree III||77.0%|Medium|| +|1651|Hopper Company Queries III||67.4%|Hard|| +|1652|Defuse the Bomb|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1652.Defuse-the-Bomb)|63.0%|Easy|| |1653|Minimum Deletions to Make String Balanced|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1653.Minimum-Deletions-to-Make-String-Balanced)|50.6%|Medium|| |1654|Minimum Jumps to Reach Home|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1654.Minimum-Jumps-to-Reach-Home)|26.2%|Medium|| |1655|Distribute Repeating Integers|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1655.Distribute-Repeating-Integers)|40.4%|Hard|| |1656|Design an Ordered Stream|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1656.Design-an-Ordered-Stream)|82.2%|Easy|| |1657|Determine if Two Strings Are Close|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1657.Determine-if-Two-Strings-Are-Close)|55.4%|Medium|| |1658|Minimum Operations to Reduce X to Zero|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1658.Minimum-Operations-to-Reduce-X-to-Zero)|33.4%|Medium|| -|1659|Maximize Grid Happiness|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1659.Maximize-Grid-Happiness)|35.5%|Hard|| -|1660|Correct a Binary Tree||78.8%|Medium|| +|1659|Maximize Grid Happiness|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1659.Maximize-Grid-Happiness)|35.4%|Hard|| +|1660|Correct a Binary Tree||78.7%|Medium|| |1661|Average Time of Process per Machine||79.3%|Easy|| |1662|Check If Two String Arrays are Equivalent|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1662.Check-If-Two-String-Arrays-are-Equivalent)|83.3%|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|| @@ -1806,8 +1806,8 @@ |1666|Change the Root of a Binary Tree||69.5%|Medium|| |1667|Fix Names in a Table||63.5%|Easy|| |1668|Maximum Repeating Substring|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1668.Maximum-Repeating-Substring)|38.5%|Easy|| -|1669|Merge In Between Linked Lists|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1669.Merge-In-Between-Linked-Lists)|77.3%|Medium|| -|1670|Design Front Middle Back Queue|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1670.Design-Front-Middle-Back-Queue)|54.6%|Medium|| +|1669|Merge In Between Linked Lists|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1669.Merge-In-Between-Linked-Lists)|77.2%|Medium|| +|1670|Design Front Middle Back Queue|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1670.Design-Front-Middle-Back-Queue)|54.5%|Medium|| |1671|Minimum Number of Removals to Make Mountain Array||45.6%|Hard|| |1672|Richest Customer Wealth|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1672.Richest-Customer-Wealth)|88.4%|Easy|| |1673|Find the Most Competitive Subsequence|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1673.Find-the-Most-Competitive-Subsequence)|45.2%|Medium|| @@ -1815,12 +1815,12 @@ |1675|Minimize Deviation in Array||48.6%|Hard|| |1676|Lowest Common Ancestor of a Binary Tree IV||78.5%|Medium|| |1677|Product's Worth Over Invoices||73.9%|Easy|| -|1678|Goal Parser Interpretation|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1678.Goal-Parser-Interpretation)|85.8%|Easy|| +|1678|Goal Parser Interpretation|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1678.Goal-Parser-Interpretation)|85.7%|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.2%|Medium|| |1680|Concatenation of Consecutive Binary Numbers|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1680.Concatenation-of-Consecutive-Binary-Numbers)|52.4%|Medium|| |1681|Minimum Incompatibility|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1681.Minimum-Incompatibility)|35.4%|Hard|| -|1682|Longest Palindromic Subsequence II||51.0%|Medium|| -|1683|Invalid Tweets||91.1%|Easy|| +|1682|Longest Palindromic Subsequence II||50.8%|Medium|| +|1683|Invalid Tweets||91.2%|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)|83.4%|Easy|| |1685|Sum of Absolute Differences in a Sorted Array|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1685.Sum-of-Absolute-Differences-in-a-Sorted-Array)|61.9%|Medium|| |1686|Stone Game VI||49.0%|Medium|| @@ -1831,12 +1831,12 @@ |1691|Maximum Height by Stacking Cuboids ||49.9%|Hard|| |1692|Count Ways to Distribute Candies||62.1%|Hard|| |1693|Daily Leads and Partners||90.9%|Easy|| -|1694|Reformat Phone Number|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1694.Reformat-Phone-Number)|66.3%|Easy|| +|1694|Reformat Phone Number|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1694.Reformat-Phone-Number)|66.2%|Easy|| |1695|Maximum Erasure Value|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1695.Maximum-Erasure-Value)|49.6%|Medium|| -|1696|Jump Game VI|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1696.Jump-Game-VI)|54.1%|Medium|| +|1696|Jump Game VI|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1696.Jump-Game-VI)|54.0%|Medium|| |1697|Checking Existence of Edge Length Limited Paths||55.7%|Hard|| -|1698|Number of Distinct Substrings in a String||57.1%|Medium|| -|1699|Number of Calls Between Two Persons||86.6%|Medium|| +|1698|Number of Distinct Substrings in a String||57.4%|Medium|| +|1699|Number of Calls Between Two Persons||86.7%|Medium|| |1700|Number of Students Unable to Eat Lunch||69.4%|Easy|| |1701|Average Waiting Time||61.4%|Medium|| |1702|Maximum Binary String After Change||60.4%|Medium|| @@ -1845,54 +1845,55 @@ |1705|Maximum Number of Eaten Apples||42.1%|Medium|| |1706|Where Will the Ball Fall||59.1%|Medium|| |1707|Maximum XOR With an Element From Array||47.2%|Hard|| -|1708|Largest Subarray Length K||64.0%|Easy|| -|1709|Biggest Window Between Visits||82.3%|Medium|| +|1708|Largest Subarray Length K||63.9%|Easy|| +|1709|Biggest Window Between Visits||82.4%|Medium|| |1710|Maximum Units on a Truck||70.6%|Easy|| |1711|Count Good Meals||26.0%|Medium|| |1712|Ways to Split Array Into Three Subarrays||29.8%|Medium|| |1713|Minimum Operations to Make a Subsequence||45.8%|Hard|| -|1714|Sum Of Special Evenly-Spaced Elements In Array||48.0%|Hard|| -|1715|Count Apples and Oranges||79.4%|Medium|| +|1714|Sum Of Special Evenly-Spaced Elements In Array||47.9%|Hard|| +|1715|Count Apples and Oranges||79.3%|Medium|| |1716|Calculate Money in Leetcode Bank||67.5%|Easy|| |1717|Maximum Score From Removing Substrings||39.6%|Medium|| |1718|Construct the Lexicographically Largest Valid Sequence||44.4%|Medium|| |1719|Number Of Ways To Reconstruct A Tree||39.4%|Hard|| -|1720|Decode XORed Array||85.9%|Easy|| +|1720|Decode XORed Array||85.8%|Easy|| |1721|Swapping Nodes in a Linked List||64.8%|Medium|| |1722|Minimize Hamming Distance After Swap Operations||55.3%|Medium|| |1723|Find Minimum Time to Finish All Jobs||44.4%|Hard|| |1724|Checking Existence of Edge Length Limited Paths II||58.6%|Hard|| -|1725|Number Of Rectangles That Can Form The Largest Square||77.7%|Easy|| +|1725|Number Of Rectangles That Can Form The Largest Square||77.8%|Easy|| |1726|Tuple with Same Product||55.3%|Medium|| |1727|Largest Submatrix With Rearrangements||58.4%|Medium|| |1728|Cat and Mouse II||41.0%|Hard|| |1729|Find Followers Count||72.2%|Easy|| -|1730|Shortest Path to Get Food||59.4%|Medium|| +|1730|Shortest Path to Get Food||59.2%|Medium|| |1731|The Number of Employees Which Report to Each Employee||49.6%|Easy|| -|1732|Find the Highest Altitude||81.9%|Easy|| +|1732|Find the Highest Altitude||81.8%|Easy|| |1733|Minimum Number of People to Teach||36.6%|Medium|| -|1734|Decode XORed Permutation||51.0%|Medium|| +|1734|Decode XORed Permutation||51.1%|Medium|| |1735|Count Ways to Make Array With Product||49.1%|Hard|| |1736|Latest Time by Replacing Hidden Digits||41.3%|Easy|| -|1737|Change Minimum Characters to Satisfy One of Three Conditions||29.1%|Medium|| +|1737|Change Minimum Characters to Satisfy One of Three Conditions||29.0%|Medium|| |1738|Find Kth Largest XOR Coordinate Value||62.2%|Medium|| |1739|Building Boxes||49.5%|Hard|| -|1740|Find Distance in a Binary Tree||70.6%|Medium|| -|1741|Find Total Time Spent by Each Employee||91.2%|Easy|| +|1740|Find Distance in a Binary Tree||70.7%|Medium|| +|1741|Find Total Time Spent by Each Employee||90.9%|Easy|| |1742|Maximum Number of Balls in a Box||75.0%|Easy|| |1743|Restore the Array From Adjacent Pairs||62.0%|Medium|| |1744|Can You Eat Your Favorite Candy on Your Favorite Day?||30.3%|Medium|| |1745|Palindrome Partitioning IV||48.8%|Hard|| |1746|Maximum Subarray Sum After One Operation||62.3%|Medium|| -|1747|Leetflex Banned Accounts||71.6%|Medium|| -|1748|Sum of Unique Elements||77.9%|Easy|| -|1749|Maximum Absolute Sum of Any Subarray||49.4%|Medium|| -|1750|Minimum Length of String After Deleting Similar Ends||41.1%|Medium|| +|1747|Leetflex Banned Accounts||70.9%|Medium|| +|1748|Sum of Unique Elements||77.8%|Easy|| +|1749|Maximum Absolute Sum of Any Subarray||49.5%|Medium|| +|1750|Minimum Length of String After Deleting Similar Ends||41.2%|Medium|| |1751|Maximum Number of Events That Can Be Attended II||47.0%|Hard|| -|1752|Check if Array Is Sorted and Rotated||49.5%|Easy|| -|1753|Maximum Score From Removing Stones||60.2%|Medium|| -|1754|Largest Merge Of Two Strings||37.7%|Medium|| -|1755|Closest Subsequence Sum||31.6%|Hard|| +|1752|Check if Array Is Sorted and Rotated||72.7%|Easy|| +|1753|Maximum Score From Removing Stones||60.3%|Medium|| +|1754|Largest Merge Of Two Strings||38.0%|Medium|| +|1755|Closest Subsequence Sum||34.5%|Hard|| +|1756|Design Most Recently Used Queue||77.3%|Medium|| |------------|-------------------------------------------------------|-------| ----------------| ---------------|-------------| ------------------------------------------------------------------ diff --git a/leetcode/0173.Binary-Search-Tree-Iterator/173. Binary Search Tree Iterator.go b/leetcode/0173.Binary-Search-Tree-Iterator/173. Binary Search Tree Iterator.go index 35f1a69b..c7e8f2b2 100644 --- a/leetcode/0173.Binary-Search-Tree-Iterator/173. Binary Search Tree Iterator.go +++ b/leetcode/0173.Binary-Search-Tree-Iterator/173. Binary Search Tree Iterator.go @@ -1,8 +1,8 @@ package leetcode -import "container/heap" - import ( + "container/heap" + "github.com/halfrost/LeetCode-Go/structures" ) diff --git a/leetcode/0284.Peeking-Iterator/284. Peeking Iterator.go b/leetcode/0284.Peeking-Iterator/284. Peeking Iterator.go new file mode 100644 index 00000000..4b5b578b --- /dev/null +++ b/leetcode/0284.Peeking-Iterator/284. Peeking Iterator.go @@ -0,0 +1,53 @@ +package leetcode + +//Below is the interface for Iterator, which is already defined for you. + +type Iterator struct { +} + +func (this *Iterator) hasNext() bool { + // Returns true if the iteration has more elements. + return true +} + +func (this *Iterator) next() int { + // Returns the next element in the iteration. + return 0 +} + +type PeekingIterator struct { + nextEl int + hasEl bool + iter *Iterator +} + +func Constructor(iter *Iterator) *PeekingIterator { + return &PeekingIterator{ + iter: iter, + } +} + +func (this *PeekingIterator) hasNext() bool { + if this.hasEl { + return true + } + return this.iter.hasNext() +} + +func (this *PeekingIterator) next() int { + if this.hasEl { + this.hasEl = false + return this.nextEl + } else { + return this.iter.next() + } +} + +func (this *PeekingIterator) peek() int { + if this.hasEl { + return this.nextEl + } + this.hasEl = true + this.nextEl = this.iter.next() + return this.nextEl +} diff --git a/leetcode/0284.Peeking-Iterator/284. Peeking Iterator_test.go b/leetcode/0284.Peeking-Iterator/284. Peeking Iterator_test.go new file mode 100644 index 00000000..5d0d958f --- /dev/null +++ b/leetcode/0284.Peeking-Iterator/284. Peeking Iterator_test.go @@ -0,0 +1,9 @@ +package leetcode + +import ( + "testing" +) + +func Test_Problem284(t *testing.T) { + +} diff --git a/leetcode/0284.Peeking-Iterator/README.md b/leetcode/0284.Peeking-Iterator/README.md new file mode 100644 index 00000000..f2562d3f --- /dev/null +++ b/leetcode/0284.Peeking-Iterator/README.md @@ -0,0 +1,87 @@ +# [284. Peeking Iterator](https://leetcode.com/problems/peeking-iterator/) + +## 题目 + +Given an Iterator class interface with methods: `next()` and `hasNext()`, design and implement a PeekingIterator that support the `peek()` operation -- it essentially peek() at the element that will be returned by the next call to next(). + +**Example:** + +``` +Assume that the iterator is initialized to the beginning of the list: [1,2,3]. + +Call next() gets you 1, the first element in the list. +Now you call peek() and it returns 2, the next element. Calling next() after that still return 2. +You call next() the final time and it returns 3, the last element. +Calling hasNext() after that should return false. +``` + +**Follow up**: How would you extend your design to be generic and work with all types, not just integer? + +## 题目大意 + +给定一个迭代器类的接口,接口包含两个方法: next() 和 hasNext()。设计并实现一个支持 peek() 操作的顶端迭代器 -- 其本质就是把原本应由 next() 方法返回的元素 peek() 出来。 + +> peek() 是偷看的意思。偷偷看一看下一个元素是什么,但是并不是 next() 访问。 + +## 解题思路 + +- 简单题。在 PeekingIterator 内部保存 2 个变量,一个是下一个元素值,另一个是是否有下一个元素。在 next() 操作和 hasNext() 操作时,访问保存的这 2 个变量。peek() 操作也比较简单,判断是否有下一个元素,如果有,即返回该元素值。这里实现了迭代指针不移动的功能。如果没有保存下一个元素值,即没有 peek() 偷看,next() 操作继续往后移动指针,读取后一位元素。 +- 这里复用了是否有下一个元素值,来判断 hasNext() 和 peek() 操作中不移动指针的逻辑。 + +## 代码 + +```go +package leetcode + +//Below is the interface for Iterator, which is already defined for you. + +type Iterator struct { +} + +func (this *Iterator) hasNext() bool { + // Returns true if the iteration has more elements. + return true +} + +func (this *Iterator) next() int { + // Returns the next element in the iteration. + return 0 +} + +type PeekingIterator struct { + nextEl int + hasEl bool + iter *Iterator +} + +func Constructor(iter *Iterator) *PeekingIterator { + return &PeekingIterator{ + iter: iter, + } +} + +func (this *PeekingIterator) hasNext() bool { + if this.hasEl { + return true + } + return this.iter.hasNext() +} + +func (this *PeekingIterator) next() int { + if this.hasEl { + this.hasEl = false + return this.nextEl + } else { + return this.iter.next() + } +} + +func (this *PeekingIterator) peek() int { + if this.hasEl { + return this.nextEl + } + this.hasEl = true + this.nextEl = this.iter.next() + return this.nextEl +} +``` \ No newline at end of file diff --git a/leetcode/0703.Kth-Largest-Element-in-a-Stream/703. Kth Largest Element in a Stream.go b/leetcode/0703.Kth-Largest-Element-in-a-Stream/703. Kth Largest Element in a Stream.go new file mode 100644 index 00000000..c83b54ec --- /dev/null +++ b/leetcode/0703.Kth-Largest-Element-in-a-Stream/703. Kth Largest Element in a Stream.go @@ -0,0 +1,38 @@ +package leetcode + +import ( + "container/heap" + "sort" +) + +type KthLargest struct { + sort.IntSlice + k int +} + +func Constructor(k int, nums []int) KthLargest { + kl := KthLargest{k: k} + for _, val := range nums { + kl.Add(val) + } + return kl +} + +func (kl *KthLargest) Push(v interface{}) { + kl.IntSlice = append(kl.IntSlice, v.(int)) +} + +func (kl *KthLargest) Pop() interface{} { + a := kl.IntSlice + v := a[len(a)-1] + kl.IntSlice = a[:len(a)-1] + return v +} + +func (kl *KthLargest) Add(val int) int { + heap.Push(kl, val) + if kl.Len() > kl.k { + heap.Pop(kl) + } + return kl.IntSlice[0] +} diff --git a/leetcode/0703.Kth-Largest-Element-in-a-Stream/703. Kth Largest Element in a Stream_test.go b/leetcode/0703.Kth-Largest-Element-in-a-Stream/703. Kth Largest Element in a Stream_test.go new file mode 100644 index 00000000..448a2b47 --- /dev/null +++ b/leetcode/0703.Kth-Largest-Element-in-a-Stream/703. Kth Largest Element in a Stream_test.go @@ -0,0 +1,15 @@ +package leetcode + +import ( + "fmt" + "testing" +) + +func Test_Problem703(t *testing.T) { + obj := Constructor(3, []int{4, 5, 8, 2}) + fmt.Printf("Add 7 = %v\n", obj.Add(3)) + fmt.Printf("Add 7 = %v\n", obj.Add(5)) + fmt.Printf("Add 7 = %v\n", obj.Add(10)) + fmt.Printf("Add 7 = %v\n", obj.Add(9)) + fmt.Printf("Add 7 = %v\n", obj.Add(4)) +} diff --git a/leetcode/0703.Kth-Largest-Element-in-a-Stream/README.md b/leetcode/0703.Kth-Largest-Element-in-a-Stream/README.md new file mode 100644 index 00000000..4a41c9f5 --- /dev/null +++ b/leetcode/0703.Kth-Largest-Element-in-a-Stream/README.md @@ -0,0 +1,93 @@ +# [703. Kth Largest Element in a Stream](https://leetcode.com/problems/kth-largest-element-in-a-stream/) + +## 题目 + +Design a class to find the `kth` largest element in a stream. Note that it is the `kth` largest element in the sorted order, not the `kth` distinct element. + +Implement `KthLargest` class: + +- `KthLargest(int k, int[] nums)` Initializes the object with the integer `k` and the stream of integers `nums`. +- `int add(int val)` Returns the element representing the `kth` largest element in the stream. + +**Example 1:** + +``` +Input +["KthLargest", "add", "add", "add", "add", "add"] +[[3, [4, 5, 8, 2]], [3], [5], [10], [9], [4]] +Output +[null, 4, 5, 5, 8, 8] + +Explanation +KthLargest kthLargest = new KthLargest(3, [4, 5, 8, 2]); +kthLargest.add(3); // return 4 +kthLargest.add(5); // return 5 +kthLargest.add(10); // return 5 +kthLargest.add(9); // return 8 +kthLargest.add(4); // return 8 + +``` + +**Constraints:** + +- `1 <= k <= 104` +- `0 <= nums.length <= 104` +- `104 <= nums[i] <= 104` +- `104 <= val <= 104` +- At most `104` calls will be made to `add`. +- It is guaranteed that there will be at least `k` elements in the array when you search for the `kth` element. + +## 题目大意 + +设计一个找到数据流中第 k 大元素的类(class)。注意是排序后的第 k 大元素,不是第 k 个不同的元素。请实现 KthLargest 类: + +- KthLargest(int k, int[] nums) 使用整数 k 和整数流 nums 初始化对象。 +- int add(int val) 将 val 插入数据流 nums 后,返回当前数据流中第 k 大的元素。 + +## 解题思路 + +- 读完题就能明白这一题考察的是最小堆。构建一个长度为 K 的最小堆,每次 pop 堆首(堆中最小的元素),维护堆首即为第 K 大元素。 +- 这里有一个简洁的写法,常规的构建一个 pq 优先队列需要自己新建一个类型,然后实现 Len()、Less()、Swap()、Push()、Pop() 这 5 个方法。在 sort 包里有一个现成的最小堆,sort.IntSlice。可以借用它,再自己实现 Push()、Pop()就可以使用最小堆了,节约一部分代码。 + +## 代码 + +```go +package leetcode + +import ( + "container/heap" + "sort" +) + +type KthLargest struct { + sort.IntSlice + k int +} + +func Constructor(k int, nums []int) KthLargest { + kl := KthLargest{k: k} + for _, val := range nums { + kl.Add(val) + } + return kl +} + +func (kl *KthLargest) Push(v interface{}) { + kl.IntSlice = append(kl.IntSlice, v.(int)) +} + +func (kl *KthLargest) Pop() interface{} { + a := kl.IntSlice + v := a[len(a)-1] + kl.IntSlice = a[:len(a)-1] + return v +} + +func (kl *KthLargest) Add(val int) int { + heap.Push(kl, val) + if kl.Len() > kl.k { + heap.Pop(kl) + } + return kl.IntSlice[0] +} +``` \ No newline at end of file diff --git a/website/content/ChapterFour/0200~0299/0283.Move-Zeroes.md b/website/content/ChapterFour/0200~0299/0283.Move-Zeroes.md index 092cf3c6..7548b275 100644 --- a/website/content/ChapterFour/0200~0299/0283.Move-Zeroes.md +++ b/website/content/ChapterFour/0200~0299/0283.Move-Zeroes.md @@ -58,5 +58,5 @@ func moveZeroes(nums []int) { ----------------------------------------------

⬅️上一页

-

下一页➡️

+

下一页➡️

diff --git a/website/content/ChapterFour/0200~0299/0284.Peeking-Iterator.md b/website/content/ChapterFour/0200~0299/0284.Peeking-Iterator.md new file mode 100644 index 00000000..9693b934 --- /dev/null +++ b/website/content/ChapterFour/0200~0299/0284.Peeking-Iterator.md @@ -0,0 +1,94 @@ +# [284. Peeking Iterator](https://leetcode.com/problems/peeking-iterator/) + +## 题目 + +Given an Iterator class interface with methods: `next()` and `hasNext()`, design and implement a PeekingIterator that support the `peek()` operation -- it essentially peek() at the element that will be returned by the next call to next(). + +**Example:** + +``` +Assume that the iterator is initialized to the beginning of the list: [1,2,3]. + +Call next() gets you 1, the first element in the list. +Now you call peek() and it returns 2, the next element. Calling next() after that still return 2. +You call next() the final time and it returns 3, the last element. +Calling hasNext() after that should return false. +``` + +**Follow up**: How would you extend your design to be generic and work with all types, not just integer? + +## 题目大意 + +给定一个迭代器类的接口,接口包含两个方法: next() 和 hasNext()。设计并实现一个支持 peek() 操作的顶端迭代器 -- 其本质就是把原本应由 next() 方法返回的元素 peek() 出来。 + +> peek() 是偷看的意思。偷偷看一看下一个元素是什么,但是并不是 next() 访问。 + +## 解题思路 + +- 简单题。在 PeekingIterator 内部保存 2 个变量,一个是下一个元素值,另一个是是否有下一个元素。在 next() 操作和 hasNext() 操作时,访问保存的这 2 个变量。peek() 操作也比较简单,判断是否有下一个元素,如果有,即返回该元素值。这里实现了迭代指针不移动的功能。如果没有保存下一个元素值,即没有 peek() 偷看,next() 操作继续往后移动指针,读取后一位元素。 +- 这里复用了是否有下一个元素值,来判断 hasNext() 和 peek() 操作中不移动指针的逻辑。 + +## 代码 + +```go +package leetcode + +//Below is the interface for Iterator, which is already defined for you. + +type Iterator struct { +} + +func (this *Iterator) hasNext() bool { + // Returns true if the iteration has more elements. + return true +} + +func (this *Iterator) next() int { + // Returns the next element in the iteration. + return 0 +} + +type PeekingIterator struct { + nextEl int + hasEl bool + iter *Iterator +} + +func Constructor(iter *Iterator) *PeekingIterator { + return &PeekingIterator{ + iter: iter, + } +} + +func (this *PeekingIterator) hasNext() bool { + if this.hasEl { + return true + } + return this.iter.hasNext() +} + +func (this *PeekingIterator) next() int { + if this.hasEl { + this.hasEl = false + return this.nextEl + } else { + return this.iter.next() + } +} + +func (this *PeekingIterator) peek() int { + if this.hasEl { + return this.nextEl + } + this.hasEl = true + this.nextEl = this.iter.next() + return this.nextEl +} +``` + + +---------------------------------------------- +
+

⬅️上一页

+

下一页➡️

+
diff --git a/website/content/ChapterFour/0200~0299/0287.Find-the-Duplicate-Number.md b/website/content/ChapterFour/0200~0299/0287.Find-the-Duplicate-Number.md index a79bae5b..d3f95b60 100644 --- a/website/content/ChapterFour/0200~0299/0287.Find-the-Duplicate-Number.md +++ b/website/content/ChapterFour/0200~0299/0287.Find-the-Duplicate-Number.md @@ -109,6 +109,6 @@ func findDuplicate2(nums []int) int { ----------------------------------------------
-

⬅️上一页

+

⬅️上一页

下一页➡️

diff --git a/website/content/ChapterFour/0600~0699/0699.Falling-Squares.md b/website/content/ChapterFour/0600~0699/0699.Falling-Squares.md index 6e2b84a4..6ea24b3e 100755 --- a/website/content/ChapterFour/0600~0699/0699.Falling-Squares.md +++ b/website/content/ChapterFour/0600~0699/0699.Falling-Squares.md @@ -148,5 +148,5 @@ func discretization(positions [][]int) map[int]int { ----------------------------------------------

⬅️上一页

-

下一页➡️

+

下一页➡️

diff --git a/website/content/ChapterFour/0700~0799/0703.Kth-Largest-Element-in-a-Stream.md b/website/content/ChapterFour/0700~0799/0703.Kth-Largest-Element-in-a-Stream.md new file mode 100644 index 00000000..c55105bf --- /dev/null +++ b/website/content/ChapterFour/0700~0799/0703.Kth-Largest-Element-in-a-Stream.md @@ -0,0 +1,100 @@ +# [703. Kth Largest Element in a Stream](https://leetcode.com/problems/kth-largest-element-in-a-stream/) + +## 题目 + +Design a class to find the `kth` largest element in a stream. Note that it is the `kth` largest element in the sorted order, not the `kth` distinct element. + +Implement `KthLargest` class: + +- `KthLargest(int k, int[] nums)` Initializes the object with the integer `k` and the stream of integers `nums`. +- `int add(int val)` Returns the element representing the `kth` largest element in the stream. + +**Example 1:** + +``` +Input +["KthLargest", "add", "add", "add", "add", "add"] +[[3, [4, 5, 8, 2]], [3], [5], [10], [9], [4]] +Output +[null, 4, 5, 5, 8, 8] + +Explanation +KthLargest kthLargest = new KthLargest(3, [4, 5, 8, 2]); +kthLargest.add(3); // return 4 +kthLargest.add(5); // return 5 +kthLargest.add(10); // return 5 +kthLargest.add(9); // return 8 +kthLargest.add(4); // return 8 + +``` + +**Constraints:** + +- `1 <= k <= 104` +- `0 <= nums.length <= 104` +- `104 <= nums[i] <= 104` +- `104 <= val <= 104` +- At most `104` calls will be made to `add`. +- It is guaranteed that there will be at least `k` elements in the array when you search for the `kth` element. + +## 题目大意 + +设计一个找到数据流中第 k 大元素的类(class)。注意是排序后的第 k 大元素,不是第 k 个不同的元素。请实现 KthLargest 类: + +- KthLargest(int k, int[] nums) 使用整数 k 和整数流 nums 初始化对象。 +- int add(int val) 将 val 插入数据流 nums 后,返回当前数据流中第 k 大的元素。 + +## 解题思路 + +- 读完题就能明白这一题考察的是最小堆。构建一个长度为 K 的最小堆,每次 pop 堆首(堆中最小的元素),维护堆首即为第 K 大元素。 +- 这里有一个简洁的写法,常规的构建一个 pq 优先队列需要自己新建一个类型,然后实现 Len()、Less()、Swap()、Push()、Pop() 这 5 个方法。在 sort 包里有一个现成的最小堆,sort.IntSlice。可以借用它,再自己实现 Push()、Pop()就可以使用最小堆了,节约一部分代码。 + +## 代码 + +```go +package leetcode + +import ( + "container/heap" + "sort" +) + +type KthLargest struct { + sort.IntSlice + k int +} + +func Constructor(k int, nums []int) KthLargest { + kl := KthLargest{k: k} + for _, val := range nums { + kl.Add(val) + } + return kl +} + +func (kl *KthLargest) Push(v interface{}) { + kl.IntSlice = append(kl.IntSlice, v.(int)) +} + +func (kl *KthLargest) Pop() interface{} { + a := kl.IntSlice + v := a[len(a)-1] + kl.IntSlice = a[:len(a)-1] + return v +} + +func (kl *KthLargest) Add(val int) int { + heap.Push(kl, val) + if kl.Len() > kl.k { + heap.Pop(kl) + } + return kl.IntSlice[0] +} +``` + + +---------------------------------------------- +
+

⬅️上一页

+

下一页➡️

+
diff --git a/website/content/ChapterFour/0700~0799/0704.Binary-Search.md b/website/content/ChapterFour/0700~0799/0704.Binary-Search.md index 64fc5a4c..383ad604 100755 --- a/website/content/ChapterFour/0700~0799/0704.Binary-Search.md +++ b/website/content/ChapterFour/0700~0799/0704.Binary-Search.md @@ -69,6 +69,6 @@ func search704(nums []int, target int) int { ----------------------------------------------
-

⬅️上一页

+

⬅️上一页

下一页➡️

diff --git a/website/content/ChapterTwo/Array.md b/website/content/ChapterTwo/Array.md index 038add40..c9e0f0e1 100644 --- a/website/content/ChapterTwo/Array.md +++ b/website/content/ChapterTwo/Array.md @@ -52,13 +52,13 @@ weight: 1 |0126|Word Ladder II|[Go]({{< relref "/ChapterFour/0100~0199/0126.Word-Ladder-II.md" >}})|Hard| O(n)| O(n^2)|❤️|23.6%| |0128|Longest Consecutive Sequence|[Go]({{< relref "/ChapterFour/0100~0199/0128.Longest-Consecutive-Sequence.md" >}})|Hard||||46.2%| |0152|Maximum Product Subarray|[Go]({{< relref "/ChapterFour/0100~0199/0152.Maximum-Product-Subarray.md" >}})|Medium| O(n)| O(1)||32.7%| -|0153|Find Minimum in Rotated Sorted Array|[Go]({{< relref "/ChapterFour/0100~0199/0153.Find-Minimum-in-Rotated-Sorted-Array.md" >}})|Medium||||46.0%| +|0153|Find Minimum in Rotated Sorted Array|[Go]({{< relref "/ChapterFour/0100~0199/0153.Find-Minimum-in-Rotated-Sorted-Array.md" >}})|Medium||||46.1%| |0154|Find Minimum in Rotated Sorted Array II|[Go]({{< relref "/ChapterFour/0100~0199/0154.Find-Minimum-in-Rotated-Sorted-Array-II.md" >}})|Hard||||42.0%| |0162|Find Peak Element|[Go]({{< relref "/ChapterFour/0100~0199/0162.Find-Peak-Element.md" >}})|Medium||||43.9%| |0167|Two Sum II - Input array is sorted|[Go]({{< relref "/ChapterFour/0100~0199/0167.Two-Sum-II---Input-array-is-sorted.md" >}})|Easy| O(n)| O(1)||55.6%| |0169|Majority Element|[Go]({{< relref "/ChapterFour/0100~0199/0169.Majority-Element.md" >}})|Easy||||60.0%| |0189|Rotate Array|[Go]({{< relref "/ChapterFour/0100~0199/0189.Rotate-Array.md" >}})|Medium||||36.5%| -|0209|Minimum Size Subarray Sum|[Go]({{< relref "/ChapterFour/0200~0299/0209.Minimum-Size-Subarray-Sum.md" >}})|Medium| O(n)| O(1)||39.3%| +|0209|Minimum Size Subarray Sum|[Go]({{< relref "/ChapterFour/0200~0299/0209.Minimum-Size-Subarray-Sum.md" >}})|Medium| O(n)| O(1)||39.4%| |0216|Combination Sum III|[Go]({{< relref "/ChapterFour/0200~0299/0216.Combination-Sum-III.md" >}})|Medium| O(n)| O(1)|❤️|60.2%| |0217|Contains Duplicate|[Go]({{< relref "/ChapterFour/0200~0299/0217.Contains-Duplicate.md" >}})|Easy| O(n)| O(n)||56.6%| |0219|Contains Duplicate II|[Go]({{< relref "/ChapterFour/0200~0299/0219.Contains-Duplicate-II.md" >}})|Easy| O(n)| O(n)||38.6%| @@ -84,7 +84,7 @@ weight: 1 |0697|Degree of an Array|[Go]({{< relref "/ChapterFour/0600~0699/0697.Degree-of-an-Array.md" >}})|Easy||||54.4%| |0713|Subarray Product Less Than K|[Go]({{< relref "/ChapterFour/0700~0799/0713.Subarray-Product-Less-Than-K.md" >}})|Medium| O(n)| O(1)||40.5%| |0714|Best Time to Buy and Sell Stock with Transaction Fee|[Go]({{< relref "/ChapterFour/0700~0799/0714.Best-Time-to-Buy-and-Sell-Stock-with-Transaction-Fee.md" >}})|Medium| O(n)| O(1)||56.0%| -|0717|1-bit and 2-bit Characters|[Go]({{< relref "/ChapterFour/0700~0799/0717.1-bit-and-2-bit-Characters.md" >}})|Easy||||47.4%| +|0717|1-bit and 2-bit Characters|[Go]({{< relref "/ChapterFour/0700~0799/0717.1-bit-and-2-bit-Characters.md" >}})|Easy||||47.3%| |0718|Maximum Length of Repeated Subarray|[Go]({{< relref "/ChapterFour/0700~0799/0718.Maximum-Length-of-Repeated-Subarray.md" >}})|Medium||||50.3%| |0719|Find K-th Smallest Pair Distance|[Go]({{< relref "/ChapterFour/0700~0799/0719.Find-K-th-Smallest-Pair-Distance.md" >}})|Hard||||32.5%| |0724|Find Pivot Index|[Go]({{< relref "/ChapterFour/0700~0799/0724.Find-Pivot-Index.md" >}})|Easy||||45.3%| @@ -97,17 +97,17 @@ weight: 1 |0888|Fair Candy Swap|[Go]({{< relref "/ChapterFour/0800~0899/0888.Fair-Candy-Swap.md" >}})|Easy||||58.9%| |0891|Sum of Subsequence Widths|[Go]({{< relref "/ChapterFour/0800~0899/0891.Sum-of-Subsequence-Widths.md" >}})|Hard| O(n log n)| O(1)||32.9%| |0896|Monotonic Array|[Go]({{< relref "/ChapterFour/0800~0899/0896.Monotonic-Array.md" >}})|Easy||||58.0%| -|0907|Sum of Subarray Minimums|[Go]({{< relref "/ChapterFour/0900~0999/0907.Sum-of-Subarray-Minimums.md" >}})|Medium| O(n)| O(n)|❤️|33.2%| +|0907|Sum of Subarray Minimums|[Go]({{< relref "/ChapterFour/0900~0999/0907.Sum-of-Subarray-Minimums.md" >}})|Medium| O(n)| O(n)|❤️|33.1%| |0914|X of a Kind in a Deck of Cards|[Go]({{< relref "/ChapterFour/0900~0999/0914.X-of-a-Kind-in-a-Deck-of-Cards.md" >}})|Easy||||34.3%| |0918|Maximum Sum Circular Subarray|[Go]({{< relref "/ChapterFour/0900~0999/0918.Maximum-Sum-Circular-Subarray.md" >}})|Medium||||34.2%| |0922|Sort Array By Parity II|[Go]({{< relref "/ChapterFour/0900~0999/0922.Sort-Array-By-Parity-II.md" >}})|Easy| O(n)| O(1)||70.5%| |0969|Pancake Sorting|[Go]({{< relref "/ChapterFour/0900~0999/0969.Pancake-Sorting.md" >}})|Medium| O(n)| O(1)|❤️|68.6%| -|0977|Squares of a Sorted Array|[Go]({{< relref "/ChapterFour/0900~0999/0977.Squares-of-a-Sorted-Array.md" >}})|Easy| O(n)| O(1)||72.2%| +|0977|Squares of a Sorted Array|[Go]({{< relref "/ChapterFour/0900~0999/0977.Squares-of-a-Sorted-Array.md" >}})|Easy| O(n)| O(1)||72.1%| |0978|Longest Turbulent Subarray|[Go]({{< relref "/ChapterFour/0900~0999/0978.Longest-Turbulent-Subarray.md" >}})|Medium||||46.7%| |0985|Sum of Even Numbers After Queries|[Go]({{< relref "/ChapterFour/0900~0999/0985.Sum-of-Even-Numbers-After-Queries.md" >}})|Easy||||60.7%| |0989|Add to Array-Form of Integer|[Go]({{< relref "/ChapterFour/0900~0999/0989.Add-to-Array-Form-of-Integer.md" >}})|Easy||||44.8%| |0999|Available Captures for Rook|[Go]({{< relref "/ChapterFour/0900~0999/0999.Available-Captures-for-Rook.md" >}})|Easy||||67.7%| -|1002|Find Common Characters|[Go]({{< relref "/ChapterFour/1000~1099/1002.Find-Common-Characters.md" >}})|Easy||||68.6%| +|1002|Find Common Characters|[Go]({{< relref "/ChapterFour/1000~1099/1002.Find-Common-Characters.md" >}})|Easy||||68.5%| |1011|Capacity To Ship Packages Within D Days|[Go]({{< relref "/ChapterFour/1000~1099/1011.Capacity-To-Ship-Packages-Within-D-Days.md" >}})|Medium||||59.7%| |1018|Binary Prefix Divisible By 5|[Go]({{< relref "/ChapterFour/1000~1099/1018.Binary-Prefix-Divisible-By-5.md" >}})|Easy||||47.8%| |1040|Moving Stones Until Consecutive II|[Go]({{< relref "/ChapterFour/1000~1099/1040.Moving-Stones-Until-Consecutive-II.md" >}})|Medium||||54.1%| @@ -145,11 +145,11 @@ weight: 1 |1464|Maximum Product of Two Elements in an Array|[Go]({{< relref "/ChapterFour/1400~1499/1464.Maximum-Product-of-Two-Elements-in-an-Array.md" >}})|Easy||||77.2%| |1470|Shuffle the Array|[Go]({{< relref "/ChapterFour/1400~1499/1470.Shuffle-the-Array.md" >}})|Easy||||88.4%| |1480|Running Sum of 1d Array|[Go]({{< relref "/ChapterFour/1400~1499/1480.Running-Sum-of-1d-Array.md" >}})|Easy||||89.2%| -|1512|Number of Good Pairs|[Go]({{< relref "/ChapterFour/1500~1599/1512.Number-of-Good-Pairs.md" >}})|Easy||||87.8%| +|1512|Number of Good Pairs|[Go]({{< relref "/ChapterFour/1500~1599/1512.Number-of-Good-Pairs.md" >}})|Easy||||87.7%| |1539|Kth Missing Positive Number|[Go]({{< relref "/ChapterFour/1500~1599/1539.Kth-Missing-Positive-Number.md" >}})|Easy||||55.1%| |1640|Check Array Formation Through Concatenation|[Go]({{< relref "/ChapterFour/1600~1699/1640.Check-Array-Formation-Through-Concatenation.md" >}})|Easy||||60.2%| |1646|Get Maximum in Generated Array|[Go]({{< relref "/ChapterFour/1600~1699/1646.Get-Maximum-in-Generated-Array.md" >}})|Easy||||53.5%| -|1652|Defuse the Bomb|[Go]({{< relref "/ChapterFour/1600~1699/1652.Defuse-the-Bomb.md" >}})|Easy||||63.1%| +|1652|Defuse the Bomb|[Go]({{< relref "/ChapterFour/1600~1699/1652.Defuse-the-Bomb.md" >}})|Easy||||63.0%| |1656|Design an Ordered Stream|[Go]({{< relref "/ChapterFour/1600~1699/1656.Design-an-Ordered-Stream.md" >}})|Easy||||82.2%| |1672|Richest Customer Wealth|[Go]({{< relref "/ChapterFour/1600~1699/1672.Richest-Customer-Wealth.md" >}})|Easy||||88.4%| |------------|-------------------------------------------------------|-------| ----------------| ---------------|-------------|-------------|-------------| diff --git a/website/content/ChapterTwo/Backtracking.md b/website/content/ChapterTwo/Backtracking.md index e50a16e6..20c6d1eb 100644 --- a/website/content/ChapterTwo/Backtracking.md +++ b/website/content/ChapterTwo/Backtracking.md @@ -125,14 +125,14 @@ func updateMatrix_BFS(matrix [][]int) [][]int { |0357|Count Numbers with Unique Digits|[Go]({{< relref "/ChapterFour/0300~0399/0357.Count-Numbers-with-Unique-Digits.md" >}})|Medium| O(1)| O(1)||48.8%| |0401|Binary Watch|[Go]({{< relref "/ChapterFour/0400~0499/0401.Binary-Watch.md" >}})|Easy| O(1)| O(1)||48.4%| |0526|Beautiful Arrangement|[Go]({{< relref "/ChapterFour/0500~0599/0526.Beautiful-Arrangement.md" >}})|Medium| O(n^2)| O(1)|❤️|61.8%| -|0784|Letter Case Permutation|[Go]({{< relref "/ChapterFour/0700~0799/0784.Letter-Case-Permutation.md" >}})|Medium| O(n)| O(n)||66.4%| +|0784|Letter Case Permutation|[Go]({{< relref "/ChapterFour/0700~0799/0784.Letter-Case-Permutation.md" >}})|Medium| O(n)| O(n)||66.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.8%| |0980|Unique Paths III|[Go]({{< relref "/ChapterFour/0900~0999/0980.Unique-Paths-III.md" >}})|Hard| O(n log n)| O(n)||77.2%| |0996|Number of Squareful Arrays|[Go]({{< relref "/ChapterFour/0900~0999/0996.Number-of-Squareful-Arrays.md" >}})|Hard| O(n log n)| O(n) ||48.3%| |1079|Letter Tile Possibilities|[Go]({{< relref "/ChapterFour/1000~1099/1079.Letter-Tile-Possibilities.md" >}})|Medium| O(n^2)| O(1)|❤️|75.9%| |1641|Count Sorted Vowel Strings|[Go]({{< relref "/ChapterFour/1600~1699/1641.Count-Sorted-Vowel-Strings.md" >}})|Medium||||77.0%| |1655|Distribute Repeating Integers|[Go]({{< relref "/ChapterFour/1600~1699/1655.Distribute-Repeating-Integers.md" >}})|Hard||||40.4%| -|1659|Maximize Grid Happiness|[Go]({{< relref "/ChapterFour/1600~1699/1659.Maximize-Grid-Happiness.md" >}})|Hard||||35.5%| +|1659|Maximize Grid Happiness|[Go]({{< relref "/ChapterFour/1600~1699/1659.Maximize-Grid-Happiness.md" >}})|Hard||||35.4%| |1681|Minimum Incompatibility|[Go]({{< relref "/ChapterFour/1600~1699/1681.Minimum-Incompatibility.md" >}})|Hard||||35.4%| |1688|Count of Matches in Tournament|[Go]({{< relref "/ChapterFour/1600~1699/1688.Count-of-Matches-in-Tournament.md" >}})|Easy||||82.6%| |------------|-------------------------------------------------------|-------| ----------------| ---------------|-------------|-------------|-------------| diff --git a/website/content/ChapterTwo/Binary_Indexed_Tree.md b/website/content/ChapterTwo/Binary_Indexed_Tree.md index 9014bd1f..d9a9eb5b 100644 --- a/website/content/ChapterTwo/Binary_Indexed_Tree.md +++ b/website/content/ChapterTwo/Binary_Indexed_Tree.md @@ -11,8 +11,8 @@ weight: 19 | No. | Title | Solution | Difficulty | TimeComplexity | SpaceComplexity |Favorite| Acceptance | |:--------:|:------- | :--------: | :----------: | :----: | :-----: | :-----: |:-----: | |0218|The Skyline Problem|[Go]({{< relref "/ChapterFour/0200~0299/0218.The-Skyline-Problem.md" >}})|Hard||||36.2%| -|0307|Range Sum Query - Mutable|[Go]({{< relref "/ChapterFour/0300~0399/0307.Range-Sum-Query---Mutable.md" >}})|Medium||||36.6%| -|0315|Count of Smaller Numbers After Self|[Go]({{< relref "/ChapterFour/0300~0399/0315.Count-of-Smaller-Numbers-After-Self.md" >}})|Hard||||42.6%| +|0307|Range Sum Query - Mutable|[Go]({{< relref "/ChapterFour/0300~0399/0307.Range-Sum-Query---Mutable.md" >}})|Medium||||36.7%| +|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%| |0493|Reverse Pairs|[Go]({{< relref "/ChapterFour/0400~0499/0493.Reverse-Pairs.md" >}})|Hard||||26.8%| |1649|Create Sorted Array through Instructions|[Go]({{< relref "/ChapterFour/1600~1699/1649.Create-Sorted-Array-through-Instructions.md" >}})|Hard||||36.3%| diff --git a/website/content/ChapterTwo/Binary_Search.md b/website/content/ChapterTwo/Binary_Search.md index ec1ca779..a7a2f24f 100644 --- a/website/content/ChapterTwo/Binary_Search.md +++ b/website/content/ChapterTwo/Binary_Search.md @@ -140,21 +140,21 @@ func peakIndexInMountainArray(A []int) int { |0069|Sqrt(x)|[Go]({{< relref "/ChapterFour/0001~0099/0069.Sqrtx.md" >}})|Easy| O(log n)| O(1)||35.0%| |0074|Search a 2D Matrix|[Go]({{< relref "/ChapterFour/0001~0099/0074.Search-a-2D-Matrix.md" >}})|Medium||||37.6%| |0081|Search in Rotated Sorted Array II|[Go]({{< relref "/ChapterFour/0001~0099/0081.Search-in-Rotated-Sorted-Array-II.md" >}})|Medium||||33.5%| -|0153|Find Minimum in Rotated Sorted Array|[Go]({{< relref "/ChapterFour/0100~0199/0153.Find-Minimum-in-Rotated-Sorted-Array.md" >}})|Medium||||46.0%| +|0153|Find Minimum in Rotated Sorted Array|[Go]({{< relref "/ChapterFour/0100~0199/0153.Find-Minimum-in-Rotated-Sorted-Array.md" >}})|Medium||||46.1%| |0154|Find Minimum in Rotated Sorted Array II|[Go]({{< relref "/ChapterFour/0100~0199/0154.Find-Minimum-in-Rotated-Sorted-Array-II.md" >}})|Hard||||42.0%| |0162|Find Peak Element|[Go]({{< relref "/ChapterFour/0100~0199/0162.Find-Peak-Element.md" >}})|Medium||||43.9%| |0167|Two Sum II - Input array is sorted|[Go]({{< relref "/ChapterFour/0100~0199/0167.Two-Sum-II---Input-array-is-sorted.md" >}})|Easy| O(n)| O(1)||55.6%| |0174|Dungeon Game|[Go]({{< relref "/ChapterFour/0100~0199/0174.Dungeon-Game.md" >}})|Hard||||33.2%| -|0209|Minimum Size Subarray Sum|[Go]({{< relref "/ChapterFour/0200~0299/0209.Minimum-Size-Subarray-Sum.md" >}})|Medium| O(n)| O(1)||39.3%| +|0209|Minimum Size Subarray Sum|[Go]({{< relref "/ChapterFour/0200~0299/0209.Minimum-Size-Subarray-Sum.md" >}})|Medium| O(n)| O(1)||39.4%| |0222|Count Complete Tree Nodes|[Go]({{< relref "/ChapterFour/0200~0299/0222.Count-Complete-Tree-Nodes.md" >}})|Medium| O(n)| O(1)||49.1%| |0230|Kth Smallest Element in a BST|[Go]({{< relref "/ChapterFour/0200~0299/0230.Kth-Smallest-Element-in-a-BST.md" >}})|Medium| O(n)| O(1)||62.4%| |0240|Search a 2D Matrix II|[Go]({{< relref "/ChapterFour/0200~0299/0240.Search-a-2D-Matrix-II.md" >}})|Medium||||44.4%| |0275|H-Index II|[Go]({{< relref "/ChapterFour/0200~0299/0275.H-Index-II.md" >}})|Medium||||36.3%| |0287|Find the Duplicate Number|[Go]({{< relref "/ChapterFour/0200~0299/0287.Find-the-Duplicate-Number.md" >}})|Medium| O(n)| O(1)|❤️|57.4%| |0300|Longest Increasing Subsequence|[Go]({{< relref "/ChapterFour/0300~0399/0300.Longest-Increasing-Subsequence.md" >}})|Medium| O(n log n)| O(n)||43.9%| -|0315|Count of Smaller Numbers After Self|[Go]({{< relref "/ChapterFour/0300~0399/0315.Count-of-Smaller-Numbers-After-Self.md" >}})|Hard||||42.6%| +|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%| -|0349|Intersection of Two Arrays|[Go]({{< relref "/ChapterFour/0300~0399/0349.Intersection-of-Two-Arrays.md" >}})|Easy| O(n)| O(n) ||64.6%| +|0349|Intersection of Two Arrays|[Go]({{< relref "/ChapterFour/0300~0399/0349.Intersection-of-Two-Arrays.md" >}})|Easy| O(n)| O(n) ||64.7%| |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.2%| |0367|Valid Perfect Square|[Go]({{< relref "/ChapterFour/0300~0399/0367.Valid-Perfect-Square.md" >}})|Easy||||42.0%| diff --git a/website/content/ChapterTwo/Bit_Manipulation.md b/website/content/ChapterTwo/Bit_Manipulation.md index b3d9fa82..8845aecb 100644 --- a/website/content/ChapterTwo/Bit_Manipulation.md +++ b/website/content/ChapterTwo/Bit_Manipulation.md @@ -71,7 +71,7 @@ X & ~X = 0 |0693|Binary Number with Alternating Bits|[Go]({{< relref "/ChapterFour/0600~0699/0693.Binary-Number-with-Alternating-Bits.md" >}})|Easy| O(n)| O(1)|❤️|59.8%| |0756|Pyramid Transition Matrix|[Go]({{< relref "/ChapterFour/0700~0799/0756.Pyramid-Transition-Matrix.md" >}})|Medium| O(n log n)| O(n)||55.5%| |0762|Prime Number of Set Bits in Binary Representation|[Go]({{< relref "/ChapterFour/0700~0799/0762.Prime-Number-of-Set-Bits-in-Binary-Representation.md" >}})|Easy| O(n)| O(1)||64.3%| -|0784|Letter Case Permutation|[Go]({{< relref "/ChapterFour/0700~0799/0784.Letter-Case-Permutation.md" >}})|Medium| O(n)| O(1)||66.4%| +|0784|Letter Case Permutation|[Go]({{< relref "/ChapterFour/0700~0799/0784.Letter-Case-Permutation.md" >}})|Medium| O(n)| O(1)||66.5%| |0898|Bitwise ORs of Subarrays|[Go]({{< relref "/ChapterFour/0800~0899/0898.Bitwise-ORs-of-Subarrays.md" >}})|Medium| O(n)| O(1)||34.1%| |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%| |------------|-------------------------------------------------------|-------| ----------------| ---------------|-------------|-------------|-------------| diff --git a/website/content/ChapterTwo/Depth_First_Search.md b/website/content/ChapterTwo/Depth_First_Search.md index 3309fb16..fd2101af 100644 --- a/website/content/ChapterTwo/Depth_First_Search.md +++ b/website/content/ChapterTwo/Depth_First_Search.md @@ -11,7 +11,7 @@ weight: 9 |:--------:|:------- | :--------: | :----------: | :----: | :-----: | :-----: |:-----: | |0017|Letter Combinations of a Phone Number|[Go]({{< relref "/ChapterFour/0001~0099/0017.Letter-Combinations-of-a-Phone-Number.md" >}})|Medium||||49.0%| |0098|Validate Binary Search Tree|[Go]({{< relref "/ChapterFour/0001~0099/0098.Validate-Binary-Search-Tree.md" >}})|Medium| O(n)| O(1)||28.7%| -|0099|Recover Binary Search Tree|[Go]({{< relref "/ChapterFour/0001~0099/0099.Recover-Binary-Search-Tree.md" >}})|Hard| O(n)| O(1)||42.3%| +|0099|Recover Binary Search Tree|[Go]({{< relref "/ChapterFour/0001~0099/0099.Recover-Binary-Search-Tree.md" >}})|Hard| O(n)| O(1)||42.4%| |0100|Same Tree|[Go]({{< relref "/ChapterFour/0100~0199/0100.Same-Tree.md" >}})|Easy| O(n)| O(1)||54.1%| |0101|Symmetric Tree|[Go]({{< relref "/ChapterFour/0100~0199/0101.Symmetric-Tree.md" >}})|Easy| O(n)| O(1)||48.0%| |0104|Maximum Depth of Binary Tree|[Go]({{< relref "/ChapterFour/0100~0199/0104.Maximum-Depth-of-Binary-Tree.md" >}})|Easy| O(n)| O(1)||67.9%| @@ -48,7 +48,7 @@ weight: 9 |0547|Number of Provinces|[Go]({{< relref "/ChapterFour/0500~0599/0547.Number-of-Provinces.md" >}})|Medium||||60.3%| |0563|Binary Tree Tilt|[Go]({{< relref "/ChapterFour/0500~0599/0563.Binary-Tree-Tilt.md" >}})|Easy||||52.9%| |0638|Shopping Offers|[Go]({{< relref "/ChapterFour/0600~0699/0638.Shopping-Offers.md" >}})|Medium||||52.8%| -|0685|Redundant Connection II|[Go]({{< relref "/ChapterFour/0600~0699/0685.Redundant-Connection-II.md" >}})|Hard||||33.0%| +|0685|Redundant Connection II|[Go]({{< relref "/ChapterFour/0600~0699/0685.Redundant-Connection-II.md" >}})|Hard||||32.9%| |0695|Max Area of Island|[Go]({{< relref "/ChapterFour/0600~0699/0695.Max-Area-of-Island.md" >}})|Medium||||64.6%| |0721|Accounts Merge|[Go]({{< relref "/ChapterFour/0700~0799/0721.Accounts-Merge.md" >}})|Medium||||51.6%| |0733|Flood Fill|[Go]({{< relref "/ChapterFour/0700~0799/0733.Flood-Fill.md" >}})|Easy||||55.9%| diff --git a/website/content/ChapterTwo/Dynamic_Programming.md b/website/content/ChapterTwo/Dynamic_Programming.md index 20b7d9f6..a9aab35b 100644 --- a/website/content/ChapterTwo/Dynamic_Programming.md +++ b/website/content/ChapterTwo/Dynamic_Programming.md @@ -57,7 +57,7 @@ weight: 7 |1641|Count Sorted Vowel Strings|[Go]({{< relref "/ChapterFour/1600~1699/1641.Count-Sorted-Vowel-Strings.md" >}})|Medium||||77.0%| |1654|Minimum Jumps to Reach Home|[Go]({{< relref "/ChapterFour/1600~1699/1654.Minimum-Jumps-to-Reach-Home.md" >}})|Medium||||26.2%| |1655|Distribute Repeating Integers|[Go]({{< relref "/ChapterFour/1600~1699/1655.Distribute-Repeating-Integers.md" >}})|Hard||||40.4%| -|1659|Maximize Grid Happiness|[Go]({{< relref "/ChapterFour/1600~1699/1659.Maximize-Grid-Happiness.md" >}})|Hard||||35.5%| +|1659|Maximize Grid Happiness|[Go]({{< relref "/ChapterFour/1600~1699/1659.Maximize-Grid-Happiness.md" >}})|Hard||||35.4%| |1664|Ways to Make a Fair Array|[Go]({{< relref "/ChapterFour/1600~1699/1664.Ways-to-Make-a-Fair-Array.md" >}})|Medium||||60.6%| |1690|Stone Game VII|[Go]({{< relref "/ChapterFour/1600~1699/1690.Stone-Game-VII.md" >}})|Medium||||47.5%| |------------|-------------------------------------------------------|-------| ----------------| ---------------|-------------|-------------|-------------| diff --git a/website/content/ChapterTwo/Hash_Table.md b/website/content/ChapterTwo/Hash_Table.md index b5571a7c..0be10c36 100644 --- a/website/content/ChapterTwo/Hash_Table.md +++ b/website/content/ChapterTwo/Hash_Table.md @@ -19,7 +19,7 @@ weight: 13 |0076|Minimum Window Substring|[Go]({{< relref "/ChapterFour/0001~0099/0076.Minimum-Window-Substring.md" >}})|Hard| O(n)| O(n)|❤️|35.9%| |0094|Binary Tree Inorder Traversal|[Go]({{< relref "/ChapterFour/0001~0099/0094.Binary-Tree-Inorder-Traversal.md" >}})|Medium| O(n)| O(1)||65.7%| |0136|Single Number|[Go]({{< relref "/ChapterFour/0100~0199/0136.Single-Number.md" >}})|Easy||||66.5%| -|0138|Copy List with Random Pointer|[Go]({{< relref "/ChapterFour/0100~0199/0138.Copy-List-with-Random-Pointer.md" >}})|Medium| O(n)| O(1)||40.3%| +|0138|Copy List with Random Pointer|[Go]({{< relref "/ChapterFour/0100~0199/0138.Copy-List-with-Random-Pointer.md" >}})|Medium| O(n)| O(1)||40.5%| |0187|Repeated DNA Sequences|[Go]({{< relref "/ChapterFour/0100~0199/0187.Repeated-DNA-Sequences.md" >}})|Medium||||41.4%| |0202|Happy Number|[Go]({{< relref "/ChapterFour/0200~0299/0202.Happy-Number.md" >}})|Easy| O(log n)| O(1)||51.2%| |0204|Count Primes|[Go]({{< relref "/ChapterFour/0200~0299/0204.Count-Primes.md" >}})|Easy||||32.2%| @@ -30,7 +30,7 @@ weight: 13 |0274|H-Index|[Go]({{< relref "/ChapterFour/0200~0299/0274.H-Index.md" >}})|Medium| O(n)| O(n) ||36.3%| |0290|Word Pattern|[Go]({{< relref "/ChapterFour/0200~0299/0290.Word-Pattern.md" >}})|Easy| O(n)| O(n) ||38.3%| |0347|Top K Frequent Elements|[Go]({{< relref "/ChapterFour/0300~0399/0347.Top-K-Frequent-Elements.md" >}})|Medium| O(n)| O(n) ||62.3%| -|0349|Intersection of Two Arrays|[Go]({{< relref "/ChapterFour/0300~0399/0349.Intersection-of-Two-Arrays.md" >}})|Easy| O(n)| O(n) ||64.6%| +|0349|Intersection of Two Arrays|[Go]({{< relref "/ChapterFour/0300~0399/0349.Intersection-of-Two-Arrays.md" >}})|Easy| O(n)| O(n) ||64.7%| |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%| |0389|Find the Difference|[Go]({{< relref "/ChapterFour/0300~0399/0389.Find-the-Difference.md" >}})|Easy||||57.8%| @@ -68,12 +68,12 @@ weight: 13 |0970|Powerful Integers|[Go]({{< relref "/ChapterFour/0900~0999/0970.Powerful-Integers.md" >}})|Medium||||40.0%| |0981|Time Based Key-Value Store|[Go]({{< relref "/ChapterFour/0900~0999/0981.Time-Based-Key-Value-Store.md" >}})|Medium||||54.1%| |0992|Subarrays with K Different Integers|[Go]({{< relref "/ChapterFour/0900~0999/0992.Subarrays-with-K-Different-Integers.md" >}})|Hard| O(n)| O(n) |❤️|50.6%| -|1002|Find Common Characters|[Go]({{< relref "/ChapterFour/1000~1099/1002.Find-Common-Characters.md" >}})|Easy||||68.6%| +|1002|Find Common Characters|[Go]({{< relref "/ChapterFour/1000~1099/1002.Find-Common-Characters.md" >}})|Easy||||68.5%| |1078|Occurrences After Bigram|[Go]({{< relref "/ChapterFour/1000~1099/1078.Occurrences-After-Bigram.md" >}})|Easy||||64.9%| |1160|Find Words That Can Be Formed by Characters|[Go]({{< relref "/ChapterFour/1100~1199/1160.Find-Words-That-Can-Be-Formed-by-Characters.md" >}})|Easy||||67.9%| |1189|Maximum Number of Balloons|[Go]({{< relref "/ChapterFour/1100~1199/1189.Maximum-Number-of-Balloons.md" >}})|Easy||||61.7%| |1207|Unique Number of Occurrences|[Go]({{< relref "/ChapterFour/1200~1299/1207.Unique-Number-of-Occurrences.md" >}})|Easy||||71.7%| -|1512|Number of Good Pairs|[Go]({{< relref "/ChapterFour/1500~1599/1512.Number-of-Good-Pairs.md" >}})|Easy||||87.8%| +|1512|Number of Good Pairs|[Go]({{< relref "/ChapterFour/1500~1599/1512.Number-of-Good-Pairs.md" >}})|Easy||||87.7%| |1539|Kth Missing Positive Number|[Go]({{< relref "/ChapterFour/1500~1599/1539.Kth-Missing-Positive-Number.md" >}})|Easy||||55.1%| |1640|Check Array Formation Through Concatenation|[Go]({{< relref "/ChapterFour/1600~1699/1640.Check-Array-Formation-Through-Concatenation.md" >}})|Easy||||60.2%| |1679|Max Number of K-Sum Pairs|[Go]({{< relref "/ChapterFour/1600~1699/1679.Max-Number-of-K-Sum-Pairs.md" >}})|Medium||||54.2%| diff --git a/website/content/ChapterTwo/Linked_List.md b/website/content/ChapterTwo/Linked_List.md index d038aab1..72118a3a 100644 --- a/website/content/ChapterTwo/Linked_List.md +++ b/website/content/ChapterTwo/Linked_List.md @@ -23,19 +23,19 @@ weight: 4 | No. | Title | Solution | Difficulty | TimeComplexity | SpaceComplexity |Favorite| Acceptance | |:--------:|:------- | :--------: | :----------: | :----: | :-----: | :-----: |:-----: | -|0002|Add Two Numbers|[Go]({{< relref "/ChapterFour/0001~0099/0002.Add-Two-Numbers.md" >}})|Medium| O(n)| O(1)||35.3%| +|0002|Add Two Numbers|[Go]({{< relref "/ChapterFour/0001~0099/0002.Add-Two-Numbers.md" >}})|Medium| O(n)| O(1)||35.4%| |0019|Remove Nth Node From End of List|[Go]({{< relref "/ChapterFour/0001~0099/0019.Remove-Nth-Node-From-End-of-List.md" >}})|Medium| O(n)| O(1)||35.7%| |0021|Merge Two Sorted Lists|[Go]({{< relref "/ChapterFour/0001~0099/0021.Merge-Two-Sorted-Lists.md" >}})|Easy| O(log n)| O(1)||55.9%| |0023|Merge k Sorted Lists|[Go]({{< relref "/ChapterFour/0001~0099/0023.Merge-k-Sorted-Lists.md" >}})|Hard| O(log n)| O(1)|❤️|42.5%| |0024|Swap Nodes in Pairs|[Go]({{< relref "/ChapterFour/0001~0099/0024.Swap-Nodes-in-Pairs.md" >}})|Medium| O(n)| O(1)||52.9%| -|0025|Reverse Nodes in k-Group|[Go]({{< relref "/ChapterFour/0001~0099/0025.Reverse-Nodes-in-k-Group.md" >}})|Hard| O(log n)| O(1)|❤️|44.6%| +|0025|Reverse Nodes in k-Group|[Go]({{< relref "/ChapterFour/0001~0099/0025.Reverse-Nodes-in-k-Group.md" >}})|Hard| O(log n)| O(1)|❤️|44.7%| |0061|Rotate List|[Go]({{< relref "/ChapterFour/0001~0099/0061.Rotate-List.md" >}})|Medium| O(n)| O(1)||31.7%| |0082|Remove Duplicates from Sorted List II|[Go]({{< relref "/ChapterFour/0001~0099/0082.Remove-Duplicates-from-Sorted-List-II.md" >}})|Medium| O(n)| O(1)||39.2%| |0083|Remove Duplicates from Sorted List|[Go]({{< relref "/ChapterFour/0001~0099/0083.Remove-Duplicates-from-Sorted-List.md" >}})|Easy| O(n)| O(1)||46.4%| |0086|Partition List|[Go]({{< relref "/ChapterFour/0001~0099/0086.Partition-List.md" >}})|Medium| O(n)| O(1)|❤️|43.3%| -|0092|Reverse Linked List II|[Go]({{< relref "/ChapterFour/0001~0099/0092.Reverse-Linked-List-II.md" >}})|Medium| O(n)| O(1)|❤️|40.4%| +|0092|Reverse Linked List II|[Go]({{< relref "/ChapterFour/0001~0099/0092.Reverse-Linked-List-II.md" >}})|Medium| O(n)| O(1)|❤️|40.5%| |0109|Convert Sorted List to Binary Search Tree|[Go]({{< relref "/ChapterFour/0100~0199/0109.Convert-Sorted-List-to-Binary-Search-Tree.md" >}})|Medium| O(log n)| O(n)||50.1%| -|0138|Copy List with Random Pointer|[Go]({{< relref "/ChapterFour/0100~0199/0138.Copy-List-with-Random-Pointer.md" >}})|Medium||||40.3%| +|0138|Copy List with Random Pointer|[Go]({{< relref "/ChapterFour/0100~0199/0138.Copy-List-with-Random-Pointer.md" >}})|Medium||||40.5%| |0141|Linked List Cycle|[Go]({{< relref "/ChapterFour/0100~0199/0141.Linked-List-Cycle.md" >}})|Easy| O(n)| O(1)|❤️|42.8%| |0142|Linked List Cycle II|[Go]({{< relref "/ChapterFour/0100~0199/0142.Linked-List-Cycle-II.md" >}})|Medium| O(n)| O(1)|❤️|39.6%| |0143|Reorder List|[Go]({{< relref "/ChapterFour/0100~0199/0143.Reorder-List.md" >}})|Medium| O(n)| O(1)|❤️|40.5%| @@ -55,8 +55,8 @@ 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.2%| |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.4%| |1290|Convert Binary Number in a Linked List to Integer|[Go]({{< relref "/ChapterFour/1200~1299/1290.Convert-Binary-Number-in-a-Linked-List-to-Integer.md" >}})|Easy||||81.8%| -|1669|Merge In Between Linked Lists|[Go]({{< relref "/ChapterFour/1600~1699/1669.Merge-In-Between-Linked-Lists.md" >}})|Medium||||77.3%| -|1670|Design Front Middle Back Queue|[Go]({{< relref "/ChapterFour/1600~1699/1670.Design-Front-Middle-Back-Queue.md" >}})|Medium||||54.6%| +|1669|Merge In Between Linked Lists|[Go]({{< relref "/ChapterFour/1600~1699/1669.Merge-In-Between-Linked-Lists.md" >}})|Medium||||77.2%| +|1670|Design Front Middle Back Queue|[Go]({{< relref "/ChapterFour/1600~1699/1670.Design-Front-Middle-Back-Queue.md" >}})|Medium||||54.5%| |------------|-------------------------------------------------------|-------| ----------------| ---------------|-------------|-------------|-------------| diff --git a/website/content/ChapterTwo/Math.md b/website/content/ChapterTwo/Math.md index 0cdd99f7..44b4112a 100644 --- a/website/content/ChapterTwo/Math.md +++ b/website/content/ChapterTwo/Math.md @@ -9,7 +9,7 @@ weight: 12 | No. | Title | Solution | Difficulty | TimeComplexity | SpaceComplexity |Favorite| Acceptance | |:--------:|:------- | :--------: | :----------: | :----: | :-----: | :-----: |:-----: | -|0002|Add Two Numbers|[Go]({{< relref "/ChapterFour/0001~0099/0002.Add-Two-Numbers.md" >}})|Medium| O(n)| O(1)||35.3%| +|0002|Add Two Numbers|[Go]({{< relref "/ChapterFour/0001~0099/0002.Add-Two-Numbers.md" >}})|Medium| O(n)| O(1)||35.4%| |0007|Reverse Integer|[Go]({{< relref "/ChapterFour/0001~0099/0007.Reverse-Integer.md" >}})|Easy||||25.9%| |0009|Palindrome Number|[Go]({{< relref "/ChapterFour/0001~0099/0009.Palindrome-Number.md" >}})|Easy||||49.7%| |0013|Roman to Integer|[Go]({{< relref "/ChapterFour/0001~0099/0013.Roman-to-Integer.md" >}})|Easy||||56.5%| @@ -48,7 +48,7 @@ weight: 12 |0753|Cracking the Safe|[Go]({{< relref "/ChapterFour/0700~0799/0753.Cracking-the-Safe.md" >}})|Hard||||52.3%| |0781|Rabbits in Forest|[Go]({{< relref "/ChapterFour/0700~0799/0781.Rabbits-in-Forest.md" >}})|Medium||||55.4%| |0812|Largest Triangle Area|[Go]({{< relref "/ChapterFour/0800~0899/0812.Largest-Triangle-Area.md" >}})|Easy||||58.9%| -|0836|Rectangle Overlap|[Go]({{< relref "/ChapterFour/0800~0899/0836.Rectangle-Overlap.md" >}})|Easy||||44.8%| +|0836|Rectangle Overlap|[Go]({{< relref "/ChapterFour/0800~0899/0836.Rectangle-Overlap.md" >}})|Easy||||44.7%| |0878|Nth Magical Number|[Go]({{< relref "/ChapterFour/0800~0899/0878.Nth-Magical-Number.md" >}})|Hard||||28.8%| |0885|Spiral Matrix III|[Go]({{< relref "/ChapterFour/0800~0899/0885.Spiral-Matrix-III.md" >}})|Medium| O(n^2)| O(1)||70.7%| |0887|Super Egg Drop|[Go]({{< relref "/ChapterFour/0800~0899/0887.Super-Egg-Drop.md" >}})|Hard||||27.1%| @@ -75,7 +75,7 @@ weight: 12 |1232|Check If It Is a Straight Line|[Go]({{< relref "/ChapterFour/1200~1299/1232.Check-If-It-Is-a-Straight-Line.md" >}})|Easy||||43.7%| |1281|Subtract the Product and Sum of Digits of an Integer|[Go]({{< relref "/ChapterFour/1200~1299/1281.Subtract-the-Product-and-Sum-of-Digits-of-an-Integer.md" >}})|Easy||||85.6%| |1317|Convert Integer to the Sum of Two No-Zero Integers|[Go]({{< relref "/ChapterFour/1300~1399/1317.Convert-Integer-to-the-Sum-of-Two-No-Zero-Integers.md" >}})|Easy||||56.8%| -|1512|Number of Good Pairs|[Go]({{< relref "/ChapterFour/1500~1599/1512.Number-of-Good-Pairs.md" >}})|Easy||||87.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||||77.0%| |1648|Sell Diminishing-Valued Colored Balls|[Go]({{< relref "/ChapterFour/1600~1699/1648.Sell-Diminishing-Valued-Colored-Balls.md" >}})|Medium||||30.8%| |1680|Concatenation of Consecutive Binary Numbers|[Go]({{< relref "/ChapterFour/1600~1699/1680.Concatenation-of-Consecutive-Binary-Numbers.md" >}})|Medium||||52.4%| diff --git a/website/content/ChapterTwo/Segment_Tree.md b/website/content/ChapterTwo/Segment_Tree.md index b03fea8c..6004ee22 100644 --- a/website/content/ChapterTwo/Segment_Tree.md +++ b/website/content/ChapterTwo/Segment_Tree.md @@ -38,8 +38,8 @@ weight: 18 | No. | Title | Solution | Difficulty | TimeComplexity | SpaceComplexity |Favorite| Acceptance | |:--------:|:------- | :--------: | :----------: | :----: | :-----: | :-----: |:-----: | |0218|The Skyline Problem|[Go]({{< relref "/ChapterFour/0200~0299/0218.The-Skyline-Problem.md" >}})|Hard| O(n log n)| O(n)|❤️|36.2%| -|0307|Range Sum Query - Mutable|[Go]({{< relref "/ChapterFour/0300~0399/0307.Range-Sum-Query---Mutable.md" >}})|Medium| O(1)| O(n)||36.6%| -|0315|Count of Smaller Numbers After Self|[Go]({{< relref "/ChapterFour/0300~0399/0315.Count-of-Smaller-Numbers-After-Self.md" >}})|Hard| O(n log n)| O(n)||42.6%| +|0307|Range Sum Query - Mutable|[Go]({{< relref "/ChapterFour/0300~0399/0307.Range-Sum-Query---Mutable.md" >}})|Medium| O(1)| O(n)||36.7%| +|0315|Count of Smaller Numbers After Self|[Go]({{< relref "/ChapterFour/0300~0399/0315.Count-of-Smaller-Numbers-After-Self.md" >}})|Hard| O(n log n)| O(n)||42.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%| |0493|Reverse Pairs|[Go]({{< relref "/ChapterFour/0400~0499/0493.Reverse-Pairs.md" >}})|Hard| O(n log n)| O(n)||26.8%| |0699|Falling Squares|[Go]({{< relref "/ChapterFour/0600~0699/0699.Falling-Squares.md" >}})|Hard| O(n log n)| O(n)|❤️|42.5%| diff --git a/website/content/ChapterTwo/Sort.md b/website/content/ChapterTwo/Sort.md index fb74bf1e..8ba4c4fe 100644 --- a/website/content/ChapterTwo/Sort.md +++ b/website/content/ChapterTwo/Sort.md @@ -28,16 +28,16 @@ weight: 14 |0220|Contains Duplicate III|[Go]({{< relref "/ChapterFour/0200~0299/0220.Contains-Duplicate-III.md" >}})|Medium| O(n log n)| O(1) |❤️|21.3%| |0242|Valid Anagram|[Go]({{< relref "/ChapterFour/0200~0299/0242.Valid-Anagram.md" >}})|Easy| O(n)| O(n) ||58.1%| |0274|H-Index|[Go]({{< relref "/ChapterFour/0200~0299/0274.H-Index.md" >}})|Medium| O(n)| O(n) ||36.3%| -|0315|Count of Smaller Numbers After Self|[Go]({{< relref "/ChapterFour/0300~0399/0315.Count-of-Smaller-Numbers-After-Self.md" >}})|Hard||||42.6%| +|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.6%| |0327|Count of Range Sum|[Go]({{< relref "/ChapterFour/0300~0399/0327.Count-of-Range-Sum.md" >}})|Hard||||36.0%| -|0349|Intersection of Two Arrays|[Go]({{< relref "/ChapterFour/0300~0399/0349.Intersection-of-Two-Arrays.md" >}})|Easy| O(n)| O(n) ||64.6%| +|0349|Intersection of Two Arrays|[Go]({{< relref "/ChapterFour/0300~0399/0349.Intersection-of-Two-Arrays.md" >}})|Easy| O(n)| O(n) ||64.7%| |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.8%| |0524|Longest Word in Dictionary through Deleting|[Go]({{< relref "/ChapterFour/0500~0599/0524.Longest-Word-in-Dictionary-through-Deleting.md" >}})|Medium| O(n)| O(1) ||49.0%| |0710|Random Pick with Blacklist|[Go]({{< relref "/ChapterFour/0700~0799/0710.Random-Pick-with-Blacklist.md" >}})|Hard| O(n)| O(n) ||32.7%| |0767|Reorganize String|[Go]({{< relref "/ChapterFour/0700~0799/0767.Reorganize-String.md" >}})|Medium| O(n log n)| O(log n) |❤️|50.0%| -|0853|Car Fleet|[Go]({{< relref "/ChapterFour/0800~0899/0853.Car-Fleet.md" >}})|Medium| O(n log n)| O(log n) ||43.7%| +|0853|Car Fleet|[Go]({{< relref "/ChapterFour/0800~0899/0853.Car-Fleet.md" >}})|Medium| O(n log n)| O(log n) ||43.8%| |0922|Sort Array By Parity II|[Go]({{< relref "/ChapterFour/0900~0999/0922.Sort-Array-By-Parity-II.md" >}})|Easy| O(n)| O(1) ||70.5%| |0969|Pancake Sorting|[Go]({{< relref "/ChapterFour/0900~0999/0969.Pancake-Sorting.md" >}})|Medium| O(n log n)| O(log n) |❤️|68.6%| |0973|K Closest Points to Origin|[Go]({{< relref "/ChapterFour/0900~0999/0973.K-Closest-Points-to-Origin.md" >}})|Medium| O(n log n)| O(log n) ||64.6%| diff --git a/website/content/ChapterTwo/Stack.md b/website/content/ChapterTwo/Stack.md index 4cde9bb7..a34670e0 100644 --- a/website/content/ChapterTwo/Stack.md +++ b/website/content/ChapterTwo/Stack.md @@ -31,14 +31,14 @@ weight: 5 |0224|Basic Calculator|[Go]({{< relref "/ChapterFour/0200~0299/0224.Basic-Calculator.md" >}})|Hard| O(n)| O(n)||38.1%| |0225|Implement Stack using Queues|[Go]({{< relref "/ChapterFour/0200~0299/0225.Implement-Stack-using-Queues.md" >}})|Easy| O(n)| O(n)||47.2%| |0232|Implement Queue using Stacks|[Go]({{< relref "/ChapterFour/0200~0299/0232.Implement-Queue-using-Stacks.md" >}})|Easy| O(n)| O(n)||52.0%| -|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)||40.9%| +|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%| |0394|Decode String|[Go]({{< relref "/ChapterFour/0300~0399/0394.Decode-String.md" >}})|Medium| O(n)| O(n)||52.6%| |0402|Remove K Digits|[Go]({{< relref "/ChapterFour/0400~0499/0402.Remove-K-Digits.md" >}})|Medium| O(n)| O(1)||28.6%| |0456|132 Pattern|[Go]({{< relref "/ChapterFour/0400~0499/0456.132-Pattern.md" >}})|Medium| O(n)| O(n)||30.6%| |0496|Next Greater Element I|[Go]({{< relref "/ChapterFour/0400~0499/0496.Next-Greater-Element-I.md" >}})|Easy| O(n)| O(n)||65.4%| |0503|Next Greater Element II|[Go]({{< relref "/ChapterFour/0500~0599/0503.Next-Greater-Element-II.md" >}})|Medium| O(n)| O(n)||58.4%| -|0636|Exclusive Time of Functions|[Go]({{< relref "/ChapterFour/0600~0699/0636.Exclusive-Time-of-Functions.md" >}})|Medium| O(n)| O(n)||54.2%| +|0636|Exclusive Time of Functions|[Go]({{< relref "/ChapterFour/0600~0699/0636.Exclusive-Time-of-Functions.md" >}})|Medium| O(n)| O(n)||54.3%| |0682|Baseball Game|[Go]({{< relref "/ChapterFour/0600~0699/0682.Baseball-Game.md" >}})|Easy| O(n)| O(n)||66.7%| |0726|Number of Atoms|[Go]({{< relref "/ChapterFour/0700~0799/0726.Number-of-Atoms.md" >}})|Hard| O(n)| O(n) |❤️|51.1%| |0735|Asteroid Collision|[Go]({{< relref "/ChapterFour/0700~0799/0735.Asteroid-Collision.md" >}})|Medium| O(n)| O(n) ||43.3%| @@ -48,7 +48,7 @@ weight: 5 |0880|Decoded String at Index|[Go]({{< relref "/ChapterFour/0800~0899/0880.Decoded-String-at-Index.md" >}})|Medium| O(n)| O(n)||28.3%| |0895|Maximum Frequency Stack|[Go]({{< relref "/ChapterFour/0800~0899/0895.Maximum-Frequency-Stack.md" >}})|Hard| O(n)| O(n) ||62.3%| |0901|Online Stock Span|[Go]({{< relref "/ChapterFour/0900~0999/0901.Online-Stock-Span.md" >}})|Medium| O(n)| O(n) ||61.3%| -|0907|Sum of Subarray Minimums|[Go]({{< relref "/ChapterFour/0900~0999/0907.Sum-of-Subarray-Minimums.md" >}})|Medium| O(n)| O(n)|❤️|33.2%| +|0907|Sum of Subarray Minimums|[Go]({{< relref "/ChapterFour/0900~0999/0907.Sum-of-Subarray-Minimums.md" >}})|Medium| O(n)| O(n)|❤️|33.1%| |0921|Minimum Add to Make Parentheses Valid|[Go]({{< relref "/ChapterFour/0900~0999/0921.Minimum-Add-to-Make-Parentheses-Valid.md" >}})|Medium| O(n)| O(n)||74.7%| |0946|Validate Stack Sequences|[Go]({{< relref "/ChapterFour/0900~0999/0946.Validate-Stack-Sequences.md" >}})|Medium| O(n)| O(n)||63.6%| |1003|Check If Word Is Valid After Substitutions|[Go]({{< relref "/ChapterFour/1000~1099/1003.Check-If-Word-Is-Valid-After-Substitutions.md" >}})|Medium| O(n)| O(1)||56.3%| diff --git a/website/content/ChapterTwo/String.md b/website/content/ChapterTwo/String.md index a6e4b296..e665f646 100644 --- a/website/content/ChapterTwo/String.md +++ b/website/content/ChapterTwo/String.md @@ -49,9 +49,9 @@ weight: 2 |1653|Minimum Deletions to Make String Balanced|[Go]({{< relref "/ChapterFour/1600~1699/1653.Minimum-Deletions-to-Make-String-Balanced.md" >}})|Medium||||50.6%| |1662|Check If Two String Arrays are Equivalent|[Go]({{< relref "/ChapterFour/1600~1699/1662.Check-If-Two-String-Arrays-are-Equivalent.md" >}})|Easy||||83.3%| |1668|Maximum Repeating Substring|[Go]({{< relref "/ChapterFour/1600~1699/1668.Maximum-Repeating-Substring.md" >}})|Easy||||38.5%| -|1678|Goal Parser Interpretation|[Go]({{< relref "/ChapterFour/1600~1699/1678.Goal-Parser-Interpretation.md" >}})|Easy||||85.8%| +|1678|Goal Parser Interpretation|[Go]({{< relref "/ChapterFour/1600~1699/1678.Goal-Parser-Interpretation.md" >}})|Easy||||85.7%| |1684|Count the Number of Consistent Strings|[Go]({{< relref "/ChapterFour/1600~1699/1684.Count-the-Number-of-Consistent-Strings.md" >}})|Easy||||83.4%| -|1694|Reformat Phone Number|[Go]({{< relref "/ChapterFour/1600~1699/1694.Reformat-Phone-Number.md" >}})|Easy||||66.3%| +|1694|Reformat Phone Number|[Go]({{< relref "/ChapterFour/1600~1699/1694.Reformat-Phone-Number.md" >}})|Easy||||66.2%| |------------|-------------------------------------------------------|-------| ----------------| ---------------|-------------|-------------|-------------| diff --git a/website/content/ChapterTwo/Tree.md b/website/content/ChapterTwo/Tree.md index ebd9cd48..3b7b711a 100644 --- a/website/content/ChapterTwo/Tree.md +++ b/website/content/ChapterTwo/Tree.md @@ -13,7 +13,7 @@ weight: 6 |0095|Unique Binary Search Trees II|[Go]({{< relref "/ChapterFour/0001~0099/0095.Unique-Binary-Search-Trees-II.md" >}})|Medium||||42.4%| |0096|Unique Binary Search Trees|[Go]({{< relref "/ChapterFour/0001~0099/0096.Unique-Binary-Search-Trees.md" >}})|Medium| O(n^2)| O(n)||54.3%| |0098|Validate Binary Search Tree|[Go]({{< relref "/ChapterFour/0001~0099/0098.Validate-Binary-Search-Tree.md" >}})|Medium| O(n)| O(1)||28.7%| -|0099|Recover Binary Search Tree|[Go]({{< relref "/ChapterFour/0001~0099/0099.Recover-Binary-Search-Tree.md" >}})|Hard| O(n)| O(1)||42.3%| +|0099|Recover Binary Search Tree|[Go]({{< relref "/ChapterFour/0001~0099/0099.Recover-Binary-Search-Tree.md" >}})|Hard| O(n)| O(1)||42.4%| |0100|Same Tree|[Go]({{< relref "/ChapterFour/0100~0199/0100.Same-Tree.md" >}})|Easy| O(n)| O(1)||54.1%| |0101|Symmetric Tree|[Go]({{< relref "/ChapterFour/0100~0199/0101.Symmetric-Tree.md" >}})|Easy| O(n)| O(1)||48.0%| |0102|Binary Tree Level Order Traversal|[Go]({{< relref "/ChapterFour/0100~0199/0102.Binary-Tree-Level-Order-Traversal.md" >}})|Medium| O(n)| O(1)||56.5%| @@ -53,7 +53,7 @@ weight: 6 |0653|Two Sum IV - Input is a BST|[Go]({{< relref "/ChapterFour/0600~0699/0653.Two-Sum-IV---Input-is-a-BST.md" >}})|Easy||||56.2%| |0662|Maximum Width of Binary Tree|[Go]({{< relref "/ChapterFour/0600~0699/0662.Maximum-Width-of-Binary-Tree.md" >}})|Medium||||39.9%| |0684|Redundant Connection|[Go]({{< relref "/ChapterFour/0600~0699/0684.Redundant-Connection.md" >}})|Medium||||58.9%| -|0685|Redundant Connection II|[Go]({{< relref "/ChapterFour/0600~0699/0685.Redundant-Connection-II.md" >}})|Hard||||33.0%| +|0685|Redundant Connection II|[Go]({{< relref "/ChapterFour/0600~0699/0685.Redundant-Connection-II.md" >}})|Hard||||32.9%| |0834|Sum of Distances in Tree|[Go]({{< relref "/ChapterFour/0800~0899/0834.Sum-of-Distances-in-Tree.md" >}})|Hard||||45.8%| |0863|All Nodes Distance K in Binary Tree|[Go]({{< relref "/ChapterFour/0800~0899/0863.All-Nodes-Distance-K-in-Binary-Tree.md" >}})|Medium||||57.8%| |0872|Leaf-Similar Trees|[Go]({{< relref "/ChapterFour/0800~0899/0872.Leaf-Similar-Trees.md" >}})|Easy||||64.5%| diff --git a/website/content/ChapterTwo/Two_Pointers.md b/website/content/ChapterTwo/Two_Pointers.md index dc1e5ef6..7aef68ba 100644 --- a/website/content/ChapterTwo/Two_Pointers.md +++ b/website/content/ChapterTwo/Two_Pointers.md @@ -53,13 +53,13 @@ weight: 3 |0141|Linked List Cycle|[Go]({{< relref "/ChapterFour/0100~0199/0141.Linked-List-Cycle.md" >}})|Easy| O(n)| O(1)|❤️|42.8%| |0142|Linked List Cycle II|[Go]({{< relref "/ChapterFour/0100~0199/0142.Linked-List-Cycle-II.md" >}})|Medium| O(n)| O(1)|❤️|39.6%| |0167|Two Sum II - Input array is sorted|[Go]({{< relref "/ChapterFour/0100~0199/0167.Two-Sum-II---Input-array-is-sorted.md" >}})|Easy| O(n)| O(1)||55.6%| -|0209|Minimum Size Subarray Sum|[Go]({{< relref "/ChapterFour/0200~0299/0209.Minimum-Size-Subarray-Sum.md" >}})|Medium| O(n)| O(1)||39.3%| +|0209|Minimum Size Subarray Sum|[Go]({{< relref "/ChapterFour/0200~0299/0209.Minimum-Size-Subarray-Sum.md" >}})|Medium| O(n)| O(1)||39.4%| |0234|Palindrome Linked List|[Go]({{< relref "/ChapterFour/0200~0299/0234.Palindrome-Linked-List.md" >}})|Easy| O(n)| O(1)||40.4%| |0283|Move Zeroes|[Go]({{< relref "/ChapterFour/0200~0299/0283.Move-Zeroes.md" >}})|Easy| O(n)| O(1)||58.5%| |0287|Find the Duplicate Number|[Go]({{< relref "/ChapterFour/0200~0299/0287.Find-the-Duplicate-Number.md" >}})|Medium| O(n)| O(1)|❤️|57.4%| |0344|Reverse String|[Go]({{< relref "/ChapterFour/0300~0399/0344.Reverse-String.md" >}})|Easy| O(n)| O(1)||70.2%| |0345|Reverse Vowels of a String|[Go]({{< relref "/ChapterFour/0300~0399/0345.Reverse-Vowels-of-a-String.md" >}})|Easy| O(n)| O(1)||45.0%| -|0349|Intersection of Two Arrays|[Go]({{< relref "/ChapterFour/0300~0399/0349.Intersection-of-Two-Arrays.md" >}})|Easy| O(n)| O(n) ||64.6%| +|0349|Intersection of Two Arrays|[Go]({{< relref "/ChapterFour/0300~0399/0349.Intersection-of-Two-Arrays.md" >}})|Easy| O(n)| O(n) ||64.7%| |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%| |0424|Longest Repeating Character Replacement|[Go]({{< relref "/ChapterFour/0400~0499/0424.Longest-Repeating-Character-Replacement.md" >}})|Medium| O(n)| O(1) ||48.2%| |0457|Circular Array Loop|[Go]({{< relref "/ChapterFour/0400~0499/0457.Circular-Array-Loop.md" >}})|Medium||||30.0%| @@ -79,7 +79,7 @@ weight: 3 |0923|3Sum With Multiplicity|[Go]({{< relref "/ChapterFour/0900~0999/0923.3Sum-With-Multiplicity.md" >}})|Medium| O(n^2)| O(n) ||36.2%| |0925|Long Pressed Name|[Go]({{< relref "/ChapterFour/0900~0999/0925.Long-Pressed-Name.md" >}})|Easy| O(n)| O(1)||38.1%| |0930|Binary Subarrays With Sum|[Go]({{< relref "/ChapterFour/0900~0999/0930.Binary-Subarrays-With-Sum.md" >}})|Medium| O(n)| O(n) |❤️|44.5%| -|0977|Squares of a Sorted Array|[Go]({{< relref "/ChapterFour/0900~0999/0977.Squares-of-a-Sorted-Array.md" >}})|Easy| O(n)| O(1)||72.2%| +|0977|Squares of a Sorted Array|[Go]({{< relref "/ChapterFour/0900~0999/0977.Squares-of-a-Sorted-Array.md" >}})|Easy| O(n)| O(1)||72.1%| |0986|Interval List Intersections|[Go]({{< relref "/ChapterFour/0900~0999/0986.Interval-List-Intersections.md" >}})|Medium| O(n)| O(1)||68.3%| |0992|Subarrays with K Different Integers|[Go]({{< relref "/ChapterFour/0900~0999/0992.Subarrays-with-K-Different-Integers.md" >}})|Hard| O(n)| O(n)|❤️|50.6%| |1004|Max Consecutive Ones III|[Go]({{< relref "/ChapterFour/1000~1099/1004.Max-Consecutive-Ones-III.md" >}})|Medium| O(n)| O(1) ||60.7%| diff --git a/website/content/ChapterTwo/Union_Find.md b/website/content/ChapterTwo/Union_Find.md index 89214505..8aa85654 100644 --- a/website/content/ChapterTwo/Union_Find.md +++ b/website/content/ChapterTwo/Union_Find.md @@ -25,7 +25,7 @@ weight: 16 |0399|Evaluate Division|[Go]({{< relref "/ChapterFour/0300~0399/0399.Evaluate-Division.md" >}})|Medium| O(n)| O(n)||54.2%| |0547|Number of Provinces|[Go]({{< relref "/ChapterFour/0500~0599/0547.Number-of-Provinces.md" >}})|Medium| O(n^2)| O(n)||60.3%| |0684|Redundant Connection|[Go]({{< relref "/ChapterFour/0600~0699/0684.Redundant-Connection.md" >}})|Medium| O(n)| O(n)||58.9%| -|0685|Redundant Connection II|[Go]({{< relref "/ChapterFour/0600~0699/0685.Redundant-Connection-II.md" >}})|Hard| O(n)| O(n)||33.0%| +|0685|Redundant Connection II|[Go]({{< relref "/ChapterFour/0600~0699/0685.Redundant-Connection-II.md" >}})|Hard| O(n)| O(n)||32.9%| |0721|Accounts Merge|[Go]({{< relref "/ChapterFour/0700~0799/0721.Accounts-Merge.md" >}})|Medium| O(n)| O(n)|❤️|51.6%| |0765|Couples Holding Hands|[Go]({{< relref "/ChapterFour/0700~0799/0765.Couples-Holding-Hands.md" >}})|Hard| O(n)| O(n)|❤️|55.4%| |0778|Swim in Rising Water|[Go]({{< relref "/ChapterFour/0700~0799/0778.Swim-in-Rising-Water.md" >}})|Hard| O(n^2)| O(n)|❤️|54.8%|