mirror of
https://github.com/halfrost/LeetCode-Go.git
synced 2025-07-07 01:44:56 +08:00
Update solution 0116
This commit is contained in:
44
README.md
44
README.md
@ -126,16 +126,16 @@
|
|||||||
|
|
||||||
| | Easy | Medium | Hard | Total |
|
| | Easy | Medium | Hard | Total |
|
||||||
|:--------:|:--------:|:--------:|:--------:|:--------:|
|
|:--------:|:--------:|:--------:|:--------:|:--------:|
|
||||||
|Optimizing|33|37|27|97|
|
|Optimizing|33|36|27|96|
|
||||||
|Accepted|**284**|**407**|**120**|**811**|
|
|Accepted|**284**|**407**|**120**|**811**|
|
||||||
|Total|506|1035|415|1956|
|
|Total|506|1035|415|1956|
|
||||||
|Perfection Rate|88.4%|90.9%|77.5%|88.0%|
|
|Perfection Rate|88.4%|91.2%|77.5%|88.2%|
|
||||||
|Completion Rate|56.1%|39.3%|28.9%|41.5%|
|
|Completion Rate|56.1%|39.3%|28.9%|41.5%|
|
||||||
|------------|----------------------------|----------------------------|----------------------------|----------------------------|
|
|------------|----------------------------|----------------------------|----------------------------|----------------------------|
|
||||||
|
|
||||||
## 二. 目录
|
## 二. 目录
|
||||||
|
|
||||||
以下已经收录了 714 道题的题解,还有 11 道题在尝试优化到 beats 100%
|
以下已经收录了 715 道题的题解,还有 11 道题在尝试优化到 beats 100%
|
||||||
|
|
||||||
| No. | Title | Solution | Acceptance | Difficulty | Frequency |
|
| No. | Title | Solution | Acceptance | Difficulty | Frequency |
|
||||||
|:--------:|:--------------------------------------------------------------|:--------:|:--------:|:--------:|:--------:|
|
|:--------:|:--------------------------------------------------------------|:--------:|:--------:|:--------:|:--------:|
|
||||||
@ -254,7 +254,7 @@
|
|||||||
|0113|Path Sum II|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0113.Path-Sum-II)|51.4%|Medium||
|
|0113|Path Sum II|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0113.Path-Sum-II)|51.4%|Medium||
|
||||||
|0114|Flatten Binary Tree to Linked List|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0114.Flatten-Binary-Tree-to-Linked-List)|54.5%|Medium||
|
|0114|Flatten Binary Tree to Linked List|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0114.Flatten-Binary-Tree-to-Linked-List)|54.5%|Medium||
|
||||||
|0115|Distinct Subsequences|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0115.Distinct-Subsequences)|40.6%|Hard||
|
|0115|Distinct Subsequences|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0115.Distinct-Subsequences)|40.6%|Hard||
|
||||||
|0116|Populating Next Right Pointers in Each Node||51.4%|Medium||
|
|0116|Populating Next Right Pointers in Each Node|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0116.Populating-Next-Right-Pointers-in-Each-Node)|51.4%|Medium||
|
||||||
|0117|Populating Next Right Pointers in Each Node II||43.5%|Medium||
|
|0117|Populating Next Right Pointers in Each Node II||43.5%|Medium||
|
||||||
|0118|Pascal's Triangle|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0118.Pascals-Triangle)|58.2%|Easy||
|
|0118|Pascal's Triangle|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0118.Pascals-Triangle)|58.2%|Easy||
|
||||||
|0119|Pascal's Triangle II|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0119.Pascals-Triangle-II)|53.8%|Easy||
|
|0119|Pascal's Triangle II|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0119.Pascals-Triangle-II)|53.8%|Easy||
|
||||||
@ -514,7 +514,7 @@
|
|||||||
|0373|Find K Pairs with Smallest Sums|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0373.Find-K-Pairs-with-Smallest-Sums)|39.0%|Medium||
|
|0373|Find K Pairs with Smallest Sums|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0373.Find-K-Pairs-with-Smallest-Sums)|39.0%|Medium||
|
||||||
|0374|Guess Number Higher or Lower|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0374.Guess-Number-Higher-or-Lower)|46.0%|Easy||
|
|0374|Guess Number Higher or Lower|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0374.Guess-Number-Higher-or-Lower)|46.0%|Easy||
|
||||||
|0375|Guess Number Higher or Lower II||43.5%|Medium||
|
|0375|Guess Number Higher or Lower II||43.5%|Medium||
|
||||||
|0376|Wiggle Subsequence|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0376.Wiggle-Subsequence)|42.8%|Medium||
|
|0376|Wiggle Subsequence|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0376.Wiggle-Subsequence)|42.9%|Medium||
|
||||||
|0377|Combination Sum IV|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0377.Combination-Sum-IV)|47.5%|Medium||
|
|0377|Combination Sum IV|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0377.Combination-Sum-IV)|47.5%|Medium||
|
||||||
|0378|Kth Smallest Element in a Sorted Matrix|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0378.Kth-Smallest-Element-in-a-Sorted-Matrix)|58.0%|Medium||
|
|0378|Kth Smallest Element in a Sorted Matrix|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0378.Kth-Smallest-Element-in-a-Sorted-Matrix)|58.0%|Medium||
|
||||||
|0379|Design Phone Directory||49.3%|Medium||
|
|0379|Design Phone Directory||49.3%|Medium||
|
||||||
@ -633,7 +633,7 @@
|
|||||||
|0492|Construct the Rectangle||51.3%|Easy||
|
|0492|Construct the Rectangle||51.3%|Easy||
|
||||||
|0493|Reverse Pairs|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0493.Reverse-Pairs)|28.2%|Hard||
|
|0493|Reverse Pairs|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0493.Reverse-Pairs)|28.2%|Hard||
|
||||||
|0494|Target Sum|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0494.Target-Sum)|45.4%|Medium||
|
|0494|Target Sum|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0494.Target-Sum)|45.4%|Medium||
|
||||||
|0495|Teemo Attacking||56.3%|Easy||
|
|0495|Teemo Attacking||56.2%|Easy||
|
||||||
|0496|Next Greater Element I|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0496.Next-Greater-Element-I)|66.9%|Easy||
|
|0496|Next Greater Element I|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0496.Next-Greater-Element-I)|66.9%|Easy||
|
||||||
|0497|Random Point in Non-overlapping Rectangles|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0497.Random-Point-in-Non-overlapping-Rectangles)|39.1%|Medium||
|
|0497|Random Point in Non-overlapping Rectangles|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0497.Random-Point-in-Non-overlapping-Rectangles)|39.1%|Medium||
|
||||||
|0498|Diagonal Traverse|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0498.Diagonal-Traverse)|52.0%|Medium||
|
|0498|Diagonal Traverse|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0498.Diagonal-Traverse)|52.0%|Medium||
|
||||||
@ -859,7 +859,7 @@
|
|||||||
|0718|Maximum Length of Repeated Subarray|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0718.Maximum-Length-of-Repeated-Subarray)|51.1%|Medium||
|
|0718|Maximum Length of Repeated Subarray|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0718.Maximum-Length-of-Repeated-Subarray)|51.1%|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)|33.2%|Hard||
|
|0719|Find K-th Smallest Pair Distance|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0719.Find-K-th-Smallest-Pair-Distance)|33.2%|Hard||
|
||||||
|0720|Longest Word in Dictionary|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0720.Longest-Word-in-Dictionary)|49.9%|Medium||
|
|0720|Longest Word in Dictionary|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0720.Longest-Word-in-Dictionary)|49.9%|Medium||
|
||||||
|0721|Accounts Merge|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0721.Accounts-Merge)|53.3%|Medium||
|
|0721|Accounts Merge|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0721.Accounts-Merge)|53.4%|Medium||
|
||||||
|0722|Remove Comments||36.9%|Medium||
|
|0722|Remove Comments||36.9%|Medium||
|
||||||
|0723|Candy Crush||73.5%|Medium||
|
|0723|Candy Crush||73.5%|Medium||
|
||||||
|0724|Find Pivot Index|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0724.Find-Pivot-Index)|48.0%|Easy||
|
|0724|Find Pivot Index|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0724.Find-Pivot-Index)|48.0%|Easy||
|
||||||
@ -982,7 +982,7 @@
|
|||||||
|0841|Keys and Rooms|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0841.Keys-and-Rooms)|67.2%|Medium||
|
|0841|Keys and Rooms|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0841.Keys-and-Rooms)|67.2%|Medium||
|
||||||
|0842|Split Array into Fibonacci Sequence|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0842.Split-Array-into-Fibonacci-Sequence)|37.2%|Medium||
|
|0842|Split Array into Fibonacci Sequence|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0842.Split-Array-into-Fibonacci-Sequence)|37.2%|Medium||
|
||||||
|0843|Guess the Word||45.2%|Hard||
|
|0843|Guess the Word||45.2%|Hard||
|
||||||
|0844|Backspace String Compare|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0844.Backspace-String-Compare)|47.2%|Easy||
|
|0844|Backspace String Compare|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0844.Backspace-String-Compare)|47.3%|Easy||
|
||||||
|0845|Longest Mountain in Array|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0845.Longest-Mountain-in-Array)|39.0%|Medium||
|
|0845|Longest Mountain in Array|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0845.Longest-Mountain-in-Array)|39.0%|Medium||
|
||||||
|0846|Hand of Straights||55.8%|Medium||
|
|0846|Hand of Straights||55.8%|Medium||
|
||||||
|0847|Shortest Path Visiting All Nodes||54.9%|Hard||
|
|0847|Shortest Path Visiting All Nodes||54.9%|Hard||
|
||||||
@ -1406,7 +1406,7 @@
|
|||||||
|1265|Print Immutable Linked List in Reverse||94.1%|Medium||
|
|1265|Print Immutable Linked List in Reverse||94.1%|Medium||
|
||||||
|1266|Minimum Time Visiting All Points|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1266.Minimum-Time-Visiting-All-Points)|79.2%|Easy||
|
|1266|Minimum Time Visiting All Points|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1266.Minimum-Time-Visiting-All-Points)|79.2%|Easy||
|
||||||
|1267|Count Servers that Communicate||57.9%|Medium||
|
|1267|Count Servers that Communicate||57.9%|Medium||
|
||||||
|1268|Search Suggestions System|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1268.Search-Suggestions-System)|65.5%|Medium||
|
|1268|Search Suggestions System|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1268.Search-Suggestions-System)|65.6%|Medium||
|
||||||
|1269|Number of Ways to Stay in the Same Place After Some Steps||43.3%|Hard||
|
|1269|Number of Ways to Stay in the Same Place After Some Steps||43.3%|Hard||
|
||||||
|1270|All People Report to the Given Manager||88.3%|Medium||
|
|1270|All People Report to the Given Manager||88.3%|Medium||
|
||||||
|1271|Hexspeak||56.0%|Easy||
|
|1271|Hexspeak||56.0%|Easy||
|
||||||
@ -1688,7 +1688,7 @@
|
|||||||
|1547|Minimum Cost to Cut a Stick||53.9%|Hard||
|
|1547|Minimum Cost to Cut a Stick||53.9%|Hard||
|
||||||
|1548|The Most Similar Path in a Graph||55.4%|Hard||
|
|1548|The Most Similar Path in a Graph||55.4%|Hard||
|
||||||
|1549|The Most Recent Orders for Each Product||67.5%|Medium||
|
|1549|The Most Recent Orders for Each Product||67.5%|Medium||
|
||||||
|1550|Three Consecutive Odds||64.0%|Easy||
|
|1550|Three Consecutive Odds||64.1%|Easy||
|
||||||
|1551|Minimum Operations to Make Array Equal|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1551.Minimum-Operations-to-Make-Array-Equal)|80.6%|Medium||
|
|1551|Minimum Operations to Make Array Equal|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1551.Minimum-Operations-to-Make-Array-Equal)|80.6%|Medium||
|
||||||
|1552|Magnetic Force Between Two Balls||51.2%|Medium||
|
|1552|Magnetic Force Between Two Balls||51.2%|Medium||
|
||||||
|1553|Minimum Number of Days to Eat N Oranges||31.3%|Hard||
|
|1553|Minimum Number of Days to Eat N Oranges||31.3%|Hard||
|
||||||
@ -1744,7 +1744,7 @@
|
|||||||
|1603|Design Parking System|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1603.Design-Parking-System)|86.6%|Easy||
|
|1603|Design Parking System|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1603.Design-Parking-System)|86.6%|Easy||
|
||||||
|1604|Alert Using Same Key-Card Three or More Times in a One Hour Period||44.0%|Medium||
|
|1604|Alert Using Same Key-Card Three or More Times in a One Hour Period||44.0%|Medium||
|
||||||
|1605|Find Valid Matrix Given Row and Column Sums||78.3%|Medium||
|
|1605|Find Valid Matrix Given Row and Column Sums||78.3%|Medium||
|
||||||
|1606|Find Servers That Handled Most Number of Requests||38.7%|Hard||
|
|1606|Find Servers That Handled Most Number of Requests||38.6%|Hard||
|
||||||
|1607|Sellers With No Sales||55.0%|Easy||
|
|1607|Sellers With No Sales||55.0%|Easy||
|
||||||
|1608|Special Array With X Elements Greater Than or Equal X|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1608.Special-Array-With-X-Elements-Greater-Than-or-Equal-X)|61.2%|Easy||
|
|1608|Special Array With X Elements Greater Than or Equal X|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1608.Special-Array-With-X-Elements-Greater-Than-or-Equal-X)|61.2%|Easy||
|
||||||
|1609|Even Odd Tree||52.2%|Medium||
|
|1609|Even Odd Tree||52.2%|Medium||
|
||||||
@ -1900,7 +1900,7 @@
|
|||||||
|1759|Count Number of Homogenous Substrings||44.0%|Medium||
|
|1759|Count Number of Homogenous Substrings||44.0%|Medium||
|
||||||
|1760|Minimum Limit of Balls in a Bag||54.5%|Medium||
|
|1760|Minimum Limit of Balls in a Bag||54.5%|Medium||
|
||||||
|1761|Minimum Degree of a Connected Trio in a Graph||39.5%|Hard||
|
|1761|Minimum Degree of a Connected Trio in a Graph||39.5%|Hard||
|
||||||
|1762|Buildings With an Ocean View||81.3%|Medium||
|
|1762|Buildings With an Ocean View||81.4%|Medium||
|
||||||
|1763|Longest Nice Substring||61.5%|Easy||
|
|1763|Longest Nice Substring||61.5%|Easy||
|
||||||
|1764|Form Array by Concatenating Subarrays of Another Array||53.1%|Medium||
|
|1764|Form Array by Concatenating Subarrays of Another Array||53.1%|Medium||
|
||||||
|1765|Map of Highest Peak||57.6%|Medium||
|
|1765|Map of Highest Peak||57.6%|Medium||
|
||||||
@ -1925,7 +1925,7 @@
|
|||||||
|1784|Check if Binary String Has at Most One Segment of Ones||41.2%|Easy||
|
|1784|Check if Binary String Has at Most One Segment of Ones||41.2%|Easy||
|
||||||
|1785|Minimum Elements to Add to Form a Given Sum||40.2%|Medium||
|
|1785|Minimum Elements to Add to Form a Given Sum||40.2%|Medium||
|
||||||
|1786|Number of Restricted Paths From First to Last Node||36.7%|Medium||
|
|1786|Number of Restricted Paths From First to Last Node||36.7%|Medium||
|
||||||
|1787|Make the XOR of All Segments Equal to Zero||37.7%|Hard||
|
|1787|Make the XOR of All Segments Equal to Zero||37.6%|Hard||
|
||||||
|1788|Maximize the Beauty of the Garden||67.0%|Hard||
|
|1788|Maximize the Beauty of the Garden||67.0%|Hard||
|
||||||
|1789|Primary Department for Each Employee||79.8%|Easy||
|
|1789|Primary Department for Each Employee||79.8%|Easy||
|
||||||
|1790|Check if One String Swap Can Make Strings Equal||44.6%|Easy||
|
|1790|Check if One String Swap Can Make Strings Equal||44.6%|Easy||
|
||||||
@ -1942,14 +1942,14 @@
|
|||||||
|1801|Number of Orders in the Backlog||44.6%|Medium||
|
|1801|Number of Orders in the Backlog||44.6%|Medium||
|
||||||
|1802|Maximum Value at a Given Index in a Bounded Array||28.6%|Medium||
|
|1802|Maximum Value at a Given Index in a Bounded Array||28.6%|Medium||
|
||||||
|1803|Count Pairs With XOR in a Range||45.4%|Hard||
|
|1803|Count Pairs With XOR in a Range||45.4%|Hard||
|
||||||
|1804|Implement Trie II (Prefix Tree)||58.4%|Medium||
|
|1804|Implement Trie II (Prefix Tree)||58.3%|Medium||
|
||||||
|1805|Number of Different Integers in a String||34.9%|Easy||
|
|1805|Number of Different Integers in a String||34.9%|Easy||
|
||||||
|1806|Minimum Number of Operations to Reinitialize a Permutation||70.3%|Medium||
|
|1806|Minimum Number of Operations to Reinitialize a Permutation||70.3%|Medium||
|
||||||
|1807|Evaluate the Bracket Pairs of a String||66.5%|Medium||
|
|1807|Evaluate the Bracket Pairs of a String||66.5%|Medium||
|
||||||
|1808|Maximize Number of Nice Divisors||28.5%|Hard||
|
|1808|Maximize Number of Nice Divisors||28.5%|Hard||
|
||||||
|1809|Ad-Free Sessions||62.1%|Easy||
|
|1809|Ad-Free Sessions||62.1%|Easy||
|
||||||
|1810|Minimum Path Cost in a Hidden Grid||54.1%|Medium||
|
|1810|Minimum Path Cost in a Hidden Grid||54.1%|Medium||
|
||||||
|1811|Find Interview Candidates||66.5%|Medium||
|
|1811|Find Interview Candidates||66.4%|Medium||
|
||||||
|1812|Determine Color of a Chessboard Square||77.0%|Easy||
|
|1812|Determine Color of a Chessboard Square||77.0%|Easy||
|
||||||
|1813|Sentence Similarity III||31.6%|Medium||
|
|1813|Sentence Similarity III||31.6%|Medium||
|
||||||
|1814|Count Nice Pairs in an Array||39.3%|Medium||
|
|1814|Count Nice Pairs in an Array||39.3%|Medium||
|
||||||
@ -1981,7 +1981,7 @@
|
|||||||
|1840|Maximum Building Height||34.5%|Hard||
|
|1840|Maximum Building Height||34.5%|Hard||
|
||||||
|1841|League Statistics||61.8%|Medium||
|
|1841|League Statistics||61.8%|Medium||
|
||||||
|1842|Next Palindrome Using Same Digits||62.8%|Hard||
|
|1842|Next Palindrome Using Same Digits||62.8%|Hard||
|
||||||
|1843|Suspicious Bank Accounts||51.5%|Medium||
|
|1843|Suspicious Bank Accounts||51.4%|Medium||
|
||||||
|1844|Replace All Digits with Characters||80.1%|Easy||
|
|1844|Replace All Digits with Characters||80.1%|Easy||
|
||||||
|1845|Seat Reservation Manager||56.4%|Medium||
|
|1845|Seat Reservation Manager||56.4%|Medium||
|
||||||
|1846|Maximum Element After Decreasing and Rearranging|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1846.Maximum-Element-After-Decreasing-and-Rearranging)|55.4%|Medium||
|
|1846|Maximum Element After Decreasing and Rearranging|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1846.Maximum-Element-After-Decreasing-and-Rearranging)|55.4%|Medium||
|
||||||
@ -2009,7 +2009,7 @@
|
|||||||
|1868|Product of Two Run-Length Encoded Arrays||59.7%|Medium||
|
|1868|Product of Two Run-Length Encoded Arrays||59.7%|Medium||
|
||||||
|1869|Longer Contiguous Segments of Ones than Zeros||59.5%|Easy||
|
|1869|Longer Contiguous Segments of Ones than Zeros||59.5%|Easy||
|
||||||
|1870|Minimum Speed to Arrive on Time||32.9%|Medium||
|
|1870|Minimum Speed to Arrive on Time||32.9%|Medium||
|
||||||
|1871|Jump Game VII||24.3%|Medium||
|
|1871|Jump Game VII||24.2%|Medium||
|
||||||
|1872|Stone Game VIII||51.3%|Hard||
|
|1872|Stone Game VIII||51.3%|Hard||
|
||||||
|1873|Calculate Special Bonus||90.9%|Easy||
|
|1873|Calculate Special Bonus||90.9%|Easy||
|
||||||
|1874|Minimize Product Sum of Two Arrays||90.6%|Medium||
|
|1874|Minimize Product Sum of Two Arrays||90.6%|Medium||
|
||||||
@ -2026,7 +2026,7 @@
|
|||||||
|1885|Count Pairs in Two Arrays||55.5%|Medium||
|
|1885|Count Pairs in Two Arrays||55.5%|Medium||
|
||||||
|1886|Determine Whether Matrix Can Be Obtained By Rotation||54.1%|Easy||
|
|1886|Determine Whether Matrix Can Be Obtained By Rotation||54.1%|Easy||
|
||||||
|1887|Reduction Operations to Make the Array Elements Equal||60.0%|Medium||
|
|1887|Reduction Operations to Make the Array Elements Equal||60.0%|Medium||
|
||||||
|1888|Minimum Number of Flips to Make the Binary String Alternating||34.4%|Medium||
|
|1888|Minimum Number of Flips to Make the Binary String Alternating||34.5%|Medium||
|
||||||
|1889|Minimum Space Wasted From Packaging||29.1%|Hard||
|
|1889|Minimum Space Wasted From Packaging||29.1%|Hard||
|
||||||
|1890|The Latest Login in 2020||85.9%|Easy||
|
|1890|The Latest Login in 2020||85.9%|Easy||
|
||||||
|1891|Cutting Ribbons||51.3%|Medium||
|
|1891|Cutting Ribbons||51.3%|Medium||
|
||||||
@ -2056,8 +2056,8 @@
|
|||||||
|1915|Number of Wonderful Substrings||38.5%|Medium||
|
|1915|Number of Wonderful Substrings||38.5%|Medium||
|
||||||
|1916|Count Ways to Build Rooms in an Ant Colony||50.1%|Hard||
|
|1916|Count Ways to Build Rooms in an Ant Colony||50.1%|Hard||
|
||||||
|1917|Leetcodify Friends Recommendations||32.2%|Hard||
|
|1917|Leetcodify Friends Recommendations||32.2%|Hard||
|
||||||
|1918|Kth Smallest Subarray Sum||56.0%|Medium||
|
|1918|Kth Smallest Subarray Sum||56.1%|Medium||
|
||||||
|1919|Leetcodify Similar Friends||44.2%|Hard||
|
|1919|Leetcodify Similar Friends||44.1%|Hard||
|
||||||
|1920|Build Array from Permutation||93.8%|Easy||
|
|1920|Build Array from Permutation||93.8%|Easy||
|
||||||
|1921|Eliminate Maximum Number of Monsters||37.4%|Medium||
|
|1921|Eliminate Maximum Number of Monsters||37.4%|Medium||
|
||||||
|1922|Count Good Numbers||38.9%|Medium||
|
|1922|Count Good Numbers||38.9%|Medium||
|
||||||
@ -2087,9 +2087,9 @@
|
|||||||
|1946|Largest Number After Mutating Substring||32.6%|Medium||
|
|1946|Largest Number After Mutating Substring||32.6%|Medium||
|
||||||
|1947|Maximum Compatibility Score Sum||56.9%|Medium||
|
|1947|Maximum Compatibility Score Sum||56.9%|Medium||
|
||||||
|1948|Delete Duplicate Folders in System||61.9%|Hard||
|
|1948|Delete Duplicate Folders in System||61.9%|Hard||
|
||||||
|1949|Strong Friendship||62.7%|Medium||
|
|1949|Strong Friendship||62.6%|Medium||
|
||||||
|1950|Maximum of Minimum Values in All Subarrays||52.8%|Medium||
|
|1950|Maximum of Minimum Values in All Subarrays||52.8%|Medium||
|
||||||
|1951|All the Pairs With the Maximum Number of Common Followers||78.8%|Medium||
|
|1951|All the Pairs With the Maximum Number of Common Followers||78.9%|Medium||
|
||||||
|1952|Three Divisors||55.8%|Easy||
|
|1952|Three Divisors||55.8%|Easy||
|
||||||
|1953|Maximum Number of Weeks for Which You Can Work||33.5%|Medium||
|
|1953|Maximum Number of Weeks for Which You Can Work||33.5%|Medium||
|
||||||
|1954|Minimum Garden Perimeter to Collect Enough Apples||52.0%|Medium||
|
|1954|Minimum Garden Perimeter to Collect Enough Apples||52.0%|Medium||
|
||||||
|
@ -12,12 +12,9 @@ func connect(root *Node) *Node {
|
|||||||
if root == nil {
|
if root == nil {
|
||||||
return root
|
return root
|
||||||
}
|
}
|
||||||
|
|
||||||
q := []*Node{root}
|
q := []*Node{root}
|
||||||
|
|
||||||
for len(q) > 0 {
|
for len(q) > 0 {
|
||||||
var p []*Node
|
var p []*Node
|
||||||
|
|
||||||
// 遍历这一层的所有节点
|
// 遍历这一层的所有节点
|
||||||
for i, node := range q {
|
for i, node := range q {
|
||||||
if i+1 < len(q) {
|
if i+1 < len(q) {
|
||||||
@ -32,7 +29,6 @@ func connect(root *Node) *Node {
|
|||||||
}
|
}
|
||||||
q = p
|
q = p
|
||||||
}
|
}
|
||||||
|
|
||||||
return root
|
return root
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -42,7 +38,6 @@ func connect2(root *Node) *Node {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
connectTwoNode(root.Left, root.Right)
|
connectTwoNode(root.Left, root.Right)
|
||||||
|
|
||||||
return root
|
return root
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -51,7 +46,6 @@ func connectTwoNode(node1, node2 *Node) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
node1.Next = node2
|
node1.Next = node2
|
||||||
|
|
||||||
connectTwoNode(node1.Left, node1.Right)
|
connectTwoNode(node1.Left, node1.Right)
|
||||||
connectTwoNode(node2.Left, node2.Right)
|
connectTwoNode(node2.Left, node2.Right)
|
||||||
connectTwoNode(node1.Right, node2.Left)
|
connectTwoNode(node1.Right, node2.Left)
|
||||||
|
@ -1,64 +1,86 @@
|
|||||||
# [116. Distinct Subsequences](https://leetcode.com/problems/populating-next-right-pointers-in-each-node/)
|
# [116. Populating Next Right Pointers in Each Node](https://leetcode.com/problems/populating-next-right-pointers-in-each-node/)
|
||||||
|
|
||||||
|
|
||||||
## 题目
|
## 题目
|
||||||
|
|
||||||
You are given a perfect binary tree where all leaves are on the same level, and every parent has two children. The binary tree has the following definition:
|
You are given a **perfect binary tree** where all leaves are on the same level, and every parent has two children. The binary tree has the following definition:
|
||||||
```go
|
|
||||||
|
```
|
||||||
struct Node {
|
struct Node {
|
||||||
int val;
|
int val;
|
||||||
Node *left;
|
Node *left;
|
||||||
Node *right;
|
Node *right;
|
||||||
Node *next;
|
Node *next;
|
||||||
}
|
}
|
||||||
```
|
|
||||||
Populate each next pointer to point to its next right node. If there is no next right node, the next pointer should be set to NULL.
|
|
||||||
|
|
||||||
Initially, all next pointers are set to NULL.
|
```
|
||||||
|
|
||||||
|
Populate each next pointer to point to its next right node. If there is no next right node, the next pointer should be set to `NULL`.
|
||||||
|
|
||||||
|
Initially, all next pointers are set to `NULL`.
|
||||||
|
|
||||||
**Follow up:**
|
**Follow up:**
|
||||||
|
|
||||||
- You may only use constant extra space.
|
- You may only use constant extra space.
|
||||||
- Recursive approach is fine, you may assume implicit stack space does not count as extra space for this problem.
|
- Recursive approach is fine, you may assume implicit stack space does not count as extra space for this problem.
|
||||||
|
|
||||||
|
|
||||||
**Example 1:**
|
**Example 1:**
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
```
|
```
|
||||||
Input: root = [1,2,3,4,5,6,7]
|
Input: root = [1,2,3,4,5,6,7]
|
||||||
Output: [1,#,2,3,#,4,5,6,7,#]
|
Output: [1,#,2,3,#,4,5,6,7,#]
|
||||||
Explanation: Given the above perfect binary tree (Figure A), your function should populate each next pointer to point to its next right node, just like in Figure B. The serialized output is in level order as connected by the next pointers, with '#' signifying the end of each level.
|
Explanation:Given the above perfect binary tree (Figure A), your function should populate each next pointer to point to its next right node, just like in Figure B. The serialized output is in level order as connected by the next pointers, with '#' signifying the end of each level.
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
**Constraints:**
|
**Constraints:**
|
||||||
- The number of nodes in the given tree is less than 4096.
|
|
||||||
- -1000 <= node.val <= 1000
|
- The number of nodes in the given tree is less than `4096`.
|
||||||
|
- `1000 <= node.val <= 1000`
|
||||||
|
|
||||||
## 题目大意
|
## 题目大意
|
||||||
|
|
||||||
将二叉树的每一层节点都连接起来形成一个链表,每层的最后一个节点指向NULL.
|
给定一个 完美二叉树 ,其所有叶子节点都在同一层,每个父节点都有两个子节点。二叉树定义如下:
|
||||||
|
|
||||||
|
```jsx
|
||||||
|
struct Node {
|
||||||
|
int val;
|
||||||
|
Node *left;
|
||||||
|
Node *right;
|
||||||
|
Node *next;
|
||||||
|
}
|
||||||
|
|
||||||
|
```
|
||||||
|
|
||||||
|
填充它的每个 next 指针,让这个指针指向其下一个右侧节点。如果找不到下一个右侧节点,则将 next 指针设置为 NULL。初始状态下,所有 next 指针都被设置为 NULL。
|
||||||
|
|
||||||
## 解题思路
|
## 解题思路
|
||||||
|
|
||||||
本质上是二叉树的层序遍历,基于广度优先搜索,将每层的节点放入队列,并遍历队列进行连接。
|
- 本质上是二叉树的层序遍历,基于广度优先搜索,将每层的节点放入队列,并遍历队列进行连接。
|
||||||
|
|
||||||
|
|
||||||
## 代码
|
## 代码
|
||||||
|
|
||||||
```go
|
```go
|
||||||
package leetcode
|
package leetcode
|
||||||
|
|
||||||
// 解法一:迭代
|
type Node struct {
|
||||||
|
Val int
|
||||||
|
Left *Node
|
||||||
|
Right *Node
|
||||||
|
Next *Node
|
||||||
|
}
|
||||||
|
|
||||||
|
//解法一:迭代
|
||||||
func connect(root *Node) *Node {
|
func connect(root *Node) *Node {
|
||||||
if root == nil {
|
if root == nil {
|
||||||
return root
|
return root
|
||||||
}
|
}
|
||||||
|
|
||||||
q := []*Node{root}
|
q := []*Node{root}
|
||||||
|
|
||||||
for len(q) > 0 {
|
for len(q) > 0 {
|
||||||
var p []*Node
|
var p []*Node
|
||||||
|
// 遍历这一层的所有节点
|
||||||
for i, node := range q {
|
for i, node := range q {
|
||||||
if i+1 < len(q) {
|
if i+1 < len(q) {
|
||||||
node.Next = q[i+1]
|
node.Next = q[i+1]
|
||||||
@ -72,18 +94,15 @@ func connect(root *Node) *Node {
|
|||||||
}
|
}
|
||||||
q = p
|
q = p
|
||||||
}
|
}
|
||||||
|
|
||||||
return root
|
return root
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// 解法二 递归
|
// 解法二 递归
|
||||||
func connect2(root *Node) *Node {
|
func connect2(root *Node) *Node {
|
||||||
if root == nil {
|
if root == nil {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
connectTwoNode(root.Left, root.Right)
|
connectTwoNode(root.Left, root.Right)
|
||||||
|
|
||||||
return root
|
return root
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -92,7 +111,6 @@ func connectTwoNode(node1, node2 *Node) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
node1.Next = node2
|
node1.Next = node2
|
||||||
|
|
||||||
connectTwoNode(node1.Left, node1.Right)
|
connectTwoNode(node1.Left, node1.Right)
|
||||||
connectTwoNode(node2.Left, node2.Right)
|
connectTwoNode(node2.Left, node2.Right)
|
||||||
connectTwoNode(node1.Right, node2.Left)
|
connectTwoNode(node1.Right, node2.Left)
|
||||||
|
@ -104,5 +104,5 @@ func numDistinct1(s, t string) int {
|
|||||||
----------------------------------------------
|
----------------------------------------------
|
||||||
<div style="display: flex;justify-content: space-between;align-items: center;">
|
<div style="display: flex;justify-content: space-between;align-items: center;">
|
||||||
<p><a href="https://books.halfrost.com/leetcode/ChapterFour/0100~0199/0114.Flatten-Binary-Tree-to-Linked-List/">⬅️上一页</a></p>
|
<p><a href="https://books.halfrost.com/leetcode/ChapterFour/0100~0199/0114.Flatten-Binary-Tree-to-Linked-List/">⬅️上一页</a></p>
|
||||||
<p><a href="https://books.halfrost.com/leetcode/ChapterFour/0100~0199/0118.Pascals-Triangle/">下一页➡️</a></p>
|
<p><a href="https://books.halfrost.com/leetcode/ChapterFour/0100~0199/0116.Populating-Next-Right-Pointers-in-Each-Node/">下一页➡️</a></p>
|
||||||
</div>
|
</div>
|
||||||
|
@ -0,0 +1,125 @@
|
|||||||
|
# [116. Populating Next Right Pointers in Each Node](https://leetcode.com/problems/populating-next-right-pointers-in-each-node/)
|
||||||
|
|
||||||
|
|
||||||
|
## 题目
|
||||||
|
|
||||||
|
You are given a **perfect binary tree** where all leaves are on the same level, and every parent has two children. The binary tree has the following definition:
|
||||||
|
|
||||||
|
```
|
||||||
|
struct Node {
|
||||||
|
int val;
|
||||||
|
Node *left;
|
||||||
|
Node *right;
|
||||||
|
Node *next;
|
||||||
|
}
|
||||||
|
|
||||||
|
```
|
||||||
|
|
||||||
|
Populate each next pointer to point to its next right node. If there is no next right node, the next pointer should be set to `NULL`.
|
||||||
|
|
||||||
|
Initially, all next pointers are set to `NULL`.
|
||||||
|
|
||||||
|
**Follow up:**
|
||||||
|
|
||||||
|
- You may only use constant extra space.
|
||||||
|
- Recursive approach is fine, you may assume implicit stack space does not count as extra space for this problem.
|
||||||
|
|
||||||
|
**Example 1:**
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
```
|
||||||
|
Input: root = [1,2,3,4,5,6,7]
|
||||||
|
Output: [1,#,2,3,#,4,5,6,7,#]
|
||||||
|
Explanation:Given the above perfect binary tree (Figure A), your function should populate each next pointer to point to its next right node, just like in Figure B. The serialized output is in level order as connected by the next pointers, with '#' signifying the end of each level.
|
||||||
|
|
||||||
|
```
|
||||||
|
|
||||||
|
**Constraints:**
|
||||||
|
|
||||||
|
- The number of nodes in the given tree is less than `4096`.
|
||||||
|
- `1000 <= node.val <= 1000`
|
||||||
|
|
||||||
|
## 题目大意
|
||||||
|
|
||||||
|
给定一个 完美二叉树 ,其所有叶子节点都在同一层,每个父节点都有两个子节点。二叉树定义如下:
|
||||||
|
|
||||||
|
```jsx
|
||||||
|
struct Node {
|
||||||
|
int val;
|
||||||
|
Node *left;
|
||||||
|
Node *right;
|
||||||
|
Node *next;
|
||||||
|
}
|
||||||
|
|
||||||
|
```
|
||||||
|
|
||||||
|
填充它的每个 next 指针,让这个指针指向其下一个右侧节点。如果找不到下一个右侧节点,则将 next 指针设置为 NULL。初始状态下,所有 next 指针都被设置为 NULL。
|
||||||
|
|
||||||
|
## 解题思路
|
||||||
|
|
||||||
|
- 本质上是二叉树的层序遍历,基于广度优先搜索,将每层的节点放入队列,并遍历队列进行连接。
|
||||||
|
|
||||||
|
## 代码
|
||||||
|
|
||||||
|
```go
|
||||||
|
package leetcode
|
||||||
|
|
||||||
|
type Node struct {
|
||||||
|
Val int
|
||||||
|
Left *Node
|
||||||
|
Right *Node
|
||||||
|
Next *Node
|
||||||
|
}
|
||||||
|
|
||||||
|
//解法一:迭代
|
||||||
|
func connect(root *Node) *Node {
|
||||||
|
if root == nil {
|
||||||
|
return root
|
||||||
|
}
|
||||||
|
q := []*Node{root}
|
||||||
|
for len(q) > 0 {
|
||||||
|
var p []*Node
|
||||||
|
// 遍历这一层的所有节点
|
||||||
|
for i, node := range q {
|
||||||
|
if i+1 < len(q) {
|
||||||
|
node.Next = q[i+1]
|
||||||
|
}
|
||||||
|
if node.Left != nil {
|
||||||
|
p = append(p, node.Left)
|
||||||
|
}
|
||||||
|
if node.Right != nil {
|
||||||
|
p = append(p, node.Right)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
q = p
|
||||||
|
}
|
||||||
|
return root
|
||||||
|
}
|
||||||
|
|
||||||
|
// 解法二 递归
|
||||||
|
func connect2(root *Node) *Node {
|
||||||
|
if root == nil {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
connectTwoNode(root.Left, root.Right)
|
||||||
|
return root
|
||||||
|
}
|
||||||
|
|
||||||
|
func connectTwoNode(node1, node2 *Node) {
|
||||||
|
if node1 == nil || node2 == nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
node1.Next = node2
|
||||||
|
connectTwoNode(node1.Left, node1.Right)
|
||||||
|
connectTwoNode(node2.Left, node2.Right)
|
||||||
|
connectTwoNode(node1.Right, node2.Left)
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
----------------------------------------------
|
||||||
|
<div style="display: flex;justify-content: space-between;align-items: center;">
|
||||||
|
<p><a href="https://books.halfrost.com/leetcode/ChapterFour/0100~0199/0115.Distinct-Subsequences/">⬅️上一页</a></p>
|
||||||
|
<p><a href="https://books.halfrost.com/leetcode/ChapterFour/0100~0199/0118.Pascals-Triangle/">下一页➡️</a></p>
|
||||||
|
</div>
|
@ -62,6 +62,6 @@ func generate(numRows int) [][]int {
|
|||||||
|
|
||||||
----------------------------------------------
|
----------------------------------------------
|
||||||
<div style="display: flex;justify-content: space-between;align-items: center;">
|
<div style="display: flex;justify-content: space-between;align-items: center;">
|
||||||
<p><a href="https://books.halfrost.com/leetcode/ChapterFour/0100~0199/0115.Distinct-Subsequences/">⬅️上一页</a></p>
|
<p><a href="https://books.halfrost.com/leetcode/ChapterFour/0100~0199/0116.Populating-Next-Right-Pointers-in-Each-Node/">⬅️上一页</a></p>
|
||||||
<p><a href="https://books.halfrost.com/leetcode/ChapterFour/0100~0199/0119.Pascals-Triangle-II/">下一页➡️</a></p>
|
<p><a href="https://books.halfrost.com/leetcode/ChapterFour/0100~0199/0119.Pascals-Triangle-II/">下一页➡️</a></p>
|
||||||
</div>
|
</div>
|
||||||
|
@ -113,7 +113,7 @@ weight: 1
|
|||||||
|0354|Russian Doll Envelopes|[Go]({{< relref "/ChapterFour/0300~0399/0354.Russian-Doll-Envelopes.md" >}})|Hard||||38.7%|
|
|0354|Russian Doll Envelopes|[Go]({{< relref "/ChapterFour/0300~0399/0354.Russian-Doll-Envelopes.md" >}})|Hard||||38.7%|
|
||||||
|0368|Largest Divisible Subset|[Go]({{< relref "/ChapterFour/0300~0399/0368.Largest-Divisible-Subset.md" >}})|Medium||||38.8%|
|
|0368|Largest Divisible Subset|[Go]({{< relref "/ChapterFour/0300~0399/0368.Largest-Divisible-Subset.md" >}})|Medium||||38.8%|
|
||||||
|0373|Find K Pairs with Smallest Sums|[Go]({{< relref "/ChapterFour/0300~0399/0373.Find-K-Pairs-with-Smallest-Sums.md" >}})|Medium||||39.0%|
|
|0373|Find K Pairs with Smallest Sums|[Go]({{< relref "/ChapterFour/0300~0399/0373.Find-K-Pairs-with-Smallest-Sums.md" >}})|Medium||||39.0%|
|
||||||
|0376|Wiggle Subsequence|[Go]({{< relref "/ChapterFour/0300~0399/0376.Wiggle-Subsequence.md" >}})|Medium||||42.8%|
|
|0376|Wiggle Subsequence|[Go]({{< relref "/ChapterFour/0300~0399/0376.Wiggle-Subsequence.md" >}})|Medium||||42.9%|
|
||||||
|0377|Combination Sum IV|[Go]({{< relref "/ChapterFour/0300~0399/0377.Combination-Sum-IV.md" >}})|Medium||||47.5%|
|
|0377|Combination Sum IV|[Go]({{< relref "/ChapterFour/0300~0399/0377.Combination-Sum-IV.md" >}})|Medium||||47.5%|
|
||||||
|0378|Kth Smallest Element in a Sorted Matrix|[Go]({{< relref "/ChapterFour/0300~0399/0378.Kth-Smallest-Element-in-a-Sorted-Matrix.md" >}})|Medium||||58.0%|
|
|0378|Kth Smallest Element in a Sorted Matrix|[Go]({{< relref "/ChapterFour/0300~0399/0378.Kth-Smallest-Element-in-a-Sorted-Matrix.md" >}})|Medium||||58.0%|
|
||||||
|0393|UTF-8 Validation|[Go]({{< relref "/ChapterFour/0300~0399/0393.UTF-8-Validation.md" >}})|Medium||||38.6%|
|
|0393|UTF-8 Validation|[Go]({{< relref "/ChapterFour/0300~0399/0393.UTF-8-Validation.md" >}})|Medium||||38.6%|
|
||||||
@ -194,7 +194,7 @@ weight: 1
|
|||||||
|0718|Maximum Length of Repeated Subarray|[Go]({{< relref "/ChapterFour/0700~0799/0718.Maximum-Length-of-Repeated-Subarray.md" >}})|Medium||||51.1%|
|
|0718|Maximum Length of Repeated Subarray|[Go]({{< relref "/ChapterFour/0700~0799/0718.Maximum-Length-of-Repeated-Subarray.md" >}})|Medium||||51.1%|
|
||||||
|0719|Find K-th Smallest Pair Distance|[Go]({{< relref "/ChapterFour/0700~0799/0719.Find-K-th-Smallest-Pair-Distance.md" >}})|Hard||||33.2%|
|
|0719|Find K-th Smallest Pair Distance|[Go]({{< relref "/ChapterFour/0700~0799/0719.Find-K-th-Smallest-Pair-Distance.md" >}})|Hard||||33.2%|
|
||||||
|0720|Longest Word in Dictionary|[Go]({{< relref "/ChapterFour/0700~0799/0720.Longest-Word-in-Dictionary.md" >}})|Medium||||49.9%|
|
|0720|Longest Word in Dictionary|[Go]({{< relref "/ChapterFour/0700~0799/0720.Longest-Word-in-Dictionary.md" >}})|Medium||||49.9%|
|
||||||
|0721|Accounts Merge|[Go]({{< relref "/ChapterFour/0700~0799/0721.Accounts-Merge.md" >}})|Medium||||53.3%|
|
|0721|Accounts Merge|[Go]({{< relref "/ChapterFour/0700~0799/0721.Accounts-Merge.md" >}})|Medium||||53.4%|
|
||||||
|0724|Find Pivot Index|[Go]({{< relref "/ChapterFour/0700~0799/0724.Find-Pivot-Index.md" >}})|Easy||||48.0%|
|
|0724|Find Pivot Index|[Go]({{< relref "/ChapterFour/0700~0799/0724.Find-Pivot-Index.md" >}})|Easy||||48.0%|
|
||||||
|0733|Flood Fill|[Go]({{< relref "/ChapterFour/0700~0799/0733.Flood-Fill.md" >}})|Easy||||56.3%|
|
|0733|Flood Fill|[Go]({{< relref "/ChapterFour/0700~0799/0733.Flood-Fill.md" >}})|Easy||||56.3%|
|
||||||
|0735|Asteroid Collision|[Go]({{< relref "/ChapterFour/0700~0799/0735.Asteroid-Collision.md" >}})|Medium||||43.7%|
|
|0735|Asteroid Collision|[Go]({{< relref "/ChapterFour/0700~0799/0735.Asteroid-Collision.md" >}})|Medium||||43.7%|
|
||||||
|
@ -16,6 +16,7 @@ weight: 10
|
|||||||
|0104|Maximum Depth of Binary Tree|[Go]({{< relref "/ChapterFour/0100~0199/0104.Maximum-Depth-of-Binary-Tree.md" >}})|Easy||||69.4%|
|
|0104|Maximum Depth of Binary Tree|[Go]({{< relref "/ChapterFour/0100~0199/0104.Maximum-Depth-of-Binary-Tree.md" >}})|Easy||||69.4%|
|
||||||
|0107|Binary Tree Level Order Traversal II|[Go]({{< relref "/ChapterFour/0100~0199/0107.Binary-Tree-Level-Order-Traversal-II.md" >}})|Medium| O(n)| O(1)||56.5%|
|
|0107|Binary Tree Level Order Traversal II|[Go]({{< relref "/ChapterFour/0100~0199/0107.Binary-Tree-Level-Order-Traversal-II.md" >}})|Medium| O(n)| O(1)||56.5%|
|
||||||
|0111|Minimum Depth of Binary Tree|[Go]({{< relref "/ChapterFour/0100~0199/0111.Minimum-Depth-of-Binary-Tree.md" >}})|Easy| O(n)| O(1)||40.8%|
|
|0111|Minimum Depth of Binary Tree|[Go]({{< relref "/ChapterFour/0100~0199/0111.Minimum-Depth-of-Binary-Tree.md" >}})|Easy| O(n)| O(1)||40.8%|
|
||||||
|
|0116|Populating Next Right Pointers in Each Node|[Go]({{< relref "/ChapterFour/0100~0199/0116.Populating-Next-Right-Pointers-in-Each-Node.md" >}})|Medium||||51.4%|
|
||||||
|0126|Word Ladder II|[Go]({{< relref "/ChapterFour/0100~0199/0126.Word-Ladder-II.md" >}})|Hard| O(n)| O(n^2)|❤️|25.2%|
|
|0126|Word Ladder II|[Go]({{< relref "/ChapterFour/0100~0199/0126.Word-Ladder-II.md" >}})|Hard| O(n)| O(n^2)|❤️|25.2%|
|
||||||
|0127|Word Ladder|[Go]({{< relref "/ChapterFour/0100~0199/0127.Word-Ladder.md" >}})|Hard| O(n)| O(n)||33.1%|
|
|0127|Word Ladder|[Go]({{< relref "/ChapterFour/0100~0199/0127.Word-Ladder.md" >}})|Hard| O(n)| O(n)||33.1%|
|
||||||
|0130|Surrounded Regions|[Go]({{< relref "/ChapterFour/0100~0199/0130.Surrounded-Regions.md" >}})|Medium||||30.9%|
|
|0130|Surrounded Regions|[Go]({{< relref "/ChapterFour/0100~0199/0130.Surrounded-Regions.md" >}})|Medium||||30.9%|
|
||||||
@ -48,7 +49,7 @@ weight: 10
|
|||||||
|0685|Redundant Connection II|[Go]({{< relref "/ChapterFour/0600~0699/0685.Redundant-Connection-II.md" >}})|Hard||||33.3%|
|
|0685|Redundant Connection II|[Go]({{< relref "/ChapterFour/0600~0699/0685.Redundant-Connection-II.md" >}})|Hard||||33.3%|
|
||||||
|0690|Employee Importance|[Go]({{< relref "/ChapterFour/0600~0699/0690.Employee-Importance.md" >}})|Easy||||60.6%|
|
|0690|Employee Importance|[Go]({{< relref "/ChapterFour/0600~0699/0690.Employee-Importance.md" >}})|Easy||||60.6%|
|
||||||
|0695|Max Area of Island|[Go]({{< relref "/ChapterFour/0600~0699/0695.Max-Area-of-Island.md" >}})|Medium||||67.0%|
|
|0695|Max Area of Island|[Go]({{< relref "/ChapterFour/0600~0699/0695.Max-Area-of-Island.md" >}})|Medium||||67.0%|
|
||||||
|0721|Accounts Merge|[Go]({{< relref "/ChapterFour/0700~0799/0721.Accounts-Merge.md" >}})|Medium||||53.3%|
|
|0721|Accounts Merge|[Go]({{< relref "/ChapterFour/0700~0799/0721.Accounts-Merge.md" >}})|Medium||||53.4%|
|
||||||
|0733|Flood Fill|[Go]({{< relref "/ChapterFour/0700~0799/0733.Flood-Fill.md" >}})|Easy||||56.3%|
|
|0733|Flood Fill|[Go]({{< relref "/ChapterFour/0700~0799/0733.Flood-Fill.md" >}})|Easy||||56.3%|
|
||||||
|0752|Open the Lock|[Go]({{< relref "/ChapterFour/0700~0799/0752.Open-the-Lock.md" >}})|Medium||||54.8%|
|
|0752|Open the Lock|[Go]({{< relref "/ChapterFour/0700~0799/0752.Open-the-Lock.md" >}})|Medium||||54.8%|
|
||||||
|0756|Pyramid Transition Matrix|[Go]({{< relref "/ChapterFour/0700~0799/0756.Pyramid-Transition-Matrix.md" >}})|Medium||||56.0%|
|
|0756|Pyramid Transition Matrix|[Go]({{< relref "/ChapterFour/0700~0799/0756.Pyramid-Transition-Matrix.md" >}})|Medium||||56.0%|
|
||||||
|
@ -20,6 +20,7 @@ weight: 9
|
|||||||
|0112|Path Sum|[Go]({{< relref "/ChapterFour/0100~0199/0112.Path-Sum.md" >}})|Easy| O(n)| O(1)||43.5%|
|
|0112|Path Sum|[Go]({{< relref "/ChapterFour/0100~0199/0112.Path-Sum.md" >}})|Easy| O(n)| O(1)||43.5%|
|
||||||
|0113|Path Sum II|[Go]({{< relref "/ChapterFour/0100~0199/0113.Path-Sum-II.md" >}})|Medium| O(n)| O(1)||51.4%|
|
|0113|Path Sum II|[Go]({{< relref "/ChapterFour/0100~0199/0113.Path-Sum-II.md" >}})|Medium| O(n)| O(1)||51.4%|
|
||||||
|0114|Flatten Binary Tree to Linked List|[Go]({{< relref "/ChapterFour/0100~0199/0114.Flatten-Binary-Tree-to-Linked-List.md" >}})|Medium| O(n)| O(1)||54.5%|
|
|0114|Flatten Binary Tree to Linked List|[Go]({{< relref "/ChapterFour/0100~0199/0114.Flatten-Binary-Tree-to-Linked-List.md" >}})|Medium| O(n)| O(1)||54.5%|
|
||||||
|
|0116|Populating Next Right Pointers in Each Node|[Go]({{< relref "/ChapterFour/0100~0199/0116.Populating-Next-Right-Pointers-in-Each-Node.md" >}})|Medium||||51.4%|
|
||||||
|0124|Binary Tree Maximum Path Sum|[Go]({{< relref "/ChapterFour/0100~0199/0124.Binary-Tree-Maximum-Path-Sum.md" >}})|Hard| O(n)| O(1)||36.3%|
|
|0124|Binary Tree Maximum Path Sum|[Go]({{< relref "/ChapterFour/0100~0199/0124.Binary-Tree-Maximum-Path-Sum.md" >}})|Hard| O(n)| O(1)||36.3%|
|
||||||
|0129|Sum Root to Leaf Numbers|[Go]({{< relref "/ChapterFour/0100~0199/0129.Sum-Root-to-Leaf-Numbers.md" >}})|Medium| O(n)| O(1)||52.7%|
|
|0129|Sum Root to Leaf Numbers|[Go]({{< relref "/ChapterFour/0100~0199/0129.Sum-Root-to-Leaf-Numbers.md" >}})|Medium| O(n)| O(1)||52.7%|
|
||||||
|0130|Surrounded Regions|[Go]({{< relref "/ChapterFour/0100~0199/0130.Surrounded-Regions.md" >}})|Medium||||30.9%|
|
|0130|Surrounded Regions|[Go]({{< relref "/ChapterFour/0100~0199/0130.Surrounded-Regions.md" >}})|Medium||||30.9%|
|
||||||
@ -68,7 +69,7 @@ weight: 9
|
|||||||
|0685|Redundant Connection II|[Go]({{< relref "/ChapterFour/0600~0699/0685.Redundant-Connection-II.md" >}})|Hard||||33.3%|
|
|0685|Redundant Connection II|[Go]({{< relref "/ChapterFour/0600~0699/0685.Redundant-Connection-II.md" >}})|Hard||||33.3%|
|
||||||
|0690|Employee Importance|[Go]({{< relref "/ChapterFour/0600~0699/0690.Employee-Importance.md" >}})|Easy||||60.6%|
|
|0690|Employee Importance|[Go]({{< relref "/ChapterFour/0600~0699/0690.Employee-Importance.md" >}})|Easy||||60.6%|
|
||||||
|0695|Max Area of Island|[Go]({{< relref "/ChapterFour/0600~0699/0695.Max-Area-of-Island.md" >}})|Medium||||67.0%|
|
|0695|Max Area of Island|[Go]({{< relref "/ChapterFour/0600~0699/0695.Max-Area-of-Island.md" >}})|Medium||||67.0%|
|
||||||
|0721|Accounts Merge|[Go]({{< relref "/ChapterFour/0700~0799/0721.Accounts-Merge.md" >}})|Medium||||53.3%|
|
|0721|Accounts Merge|[Go]({{< relref "/ChapterFour/0700~0799/0721.Accounts-Merge.md" >}})|Medium||||53.4%|
|
||||||
|0733|Flood Fill|[Go]({{< relref "/ChapterFour/0700~0799/0733.Flood-Fill.md" >}})|Easy||||56.3%|
|
|0733|Flood Fill|[Go]({{< relref "/ChapterFour/0700~0799/0733.Flood-Fill.md" >}})|Easy||||56.3%|
|
||||||
|0753|Cracking the Safe|[Go]({{< relref "/ChapterFour/0700~0799/0753.Cracking-the-Safe.md" >}})|Hard||||53.1%|
|
|0753|Cracking the Safe|[Go]({{< relref "/ChapterFour/0700~0799/0753.Cracking-the-Safe.md" >}})|Hard||||53.1%|
|
||||||
|0756|Pyramid Transition Matrix|[Go]({{< relref "/ChapterFour/0700~0799/0756.Pyramid-Transition-Matrix.md" >}})|Medium||||56.0%|
|
|0756|Pyramid Transition Matrix|[Go]({{< relref "/ChapterFour/0700~0799/0756.Pyramid-Transition-Matrix.md" >}})|Medium||||56.0%|
|
||||||
|
@ -48,7 +48,7 @@ weight: 7
|
|||||||
|0354|Russian Doll Envelopes|[Go]({{< relref "/ChapterFour/0300~0399/0354.Russian-Doll-Envelopes.md" >}})|Hard||||38.7%|
|
|0354|Russian Doll Envelopes|[Go]({{< relref "/ChapterFour/0300~0399/0354.Russian-Doll-Envelopes.md" >}})|Hard||||38.7%|
|
||||||
|0357|Count Numbers with Unique Digits|[Go]({{< relref "/ChapterFour/0300~0399/0357.Count-Numbers-with-Unique-Digits.md" >}})|Medium| O(1)| O(1)||49.5%|
|
|0357|Count Numbers with Unique Digits|[Go]({{< relref "/ChapterFour/0300~0399/0357.Count-Numbers-with-Unique-Digits.md" >}})|Medium| O(1)| O(1)||49.5%|
|
||||||
|0368|Largest Divisible Subset|[Go]({{< relref "/ChapterFour/0300~0399/0368.Largest-Divisible-Subset.md" >}})|Medium||||38.8%|
|
|0368|Largest Divisible Subset|[Go]({{< relref "/ChapterFour/0300~0399/0368.Largest-Divisible-Subset.md" >}})|Medium||||38.8%|
|
||||||
|0376|Wiggle Subsequence|[Go]({{< relref "/ChapterFour/0300~0399/0376.Wiggle-Subsequence.md" >}})|Medium||||42.8%|
|
|0376|Wiggle Subsequence|[Go]({{< relref "/ChapterFour/0300~0399/0376.Wiggle-Subsequence.md" >}})|Medium||||42.9%|
|
||||||
|0377|Combination Sum IV|[Go]({{< relref "/ChapterFour/0300~0399/0377.Combination-Sum-IV.md" >}})|Medium||||47.5%|
|
|0377|Combination Sum IV|[Go]({{< relref "/ChapterFour/0300~0399/0377.Combination-Sum-IV.md" >}})|Medium||||47.5%|
|
||||||
|0392|Is Subsequence|[Go]({{< relref "/ChapterFour/0300~0399/0392.Is-Subsequence.md" >}})|Easy| O(n)| O(1)||49.8%|
|
|0392|Is Subsequence|[Go]({{< relref "/ChapterFour/0300~0399/0392.Is-Subsequence.md" >}})|Easy| O(n)| O(1)||49.8%|
|
||||||
|0397|Integer Replacement|[Go]({{< relref "/ChapterFour/0300~0399/0397.Integer-Replacement.md" >}})|Medium||||33.8%|
|
|0397|Integer Replacement|[Go]({{< relref "/ChapterFour/0300~0399/0397.Integer-Replacement.md" >}})|Medium||||33.8%|
|
||||||
|
@ -51,7 +51,7 @@ weight: 5
|
|||||||
|0726|Number of Atoms|[Go]({{< relref "/ChapterFour/0700~0799/0726.Number-of-Atoms.md" >}})|Hard| O(n)| O(n) |❤️|51.2%|
|
|0726|Number of Atoms|[Go]({{< relref "/ChapterFour/0700~0799/0726.Number-of-Atoms.md" >}})|Hard| O(n)| O(n) |❤️|51.2%|
|
||||||
|0735|Asteroid Collision|[Go]({{< relref "/ChapterFour/0700~0799/0735.Asteroid-Collision.md" >}})|Medium| O(n)| O(n) ||43.7%|
|
|0735|Asteroid Collision|[Go]({{< relref "/ChapterFour/0700~0799/0735.Asteroid-Collision.md" >}})|Medium| O(n)| O(n) ||43.7%|
|
||||||
|0739|Daily Temperatures|[Go]({{< relref "/ChapterFour/0700~0799/0739.Daily-Temperatures.md" >}})|Medium| O(n)| O(n) ||65.6%|
|
|0739|Daily Temperatures|[Go]({{< relref "/ChapterFour/0700~0799/0739.Daily-Temperatures.md" >}})|Medium| O(n)| O(n) ||65.6%|
|
||||||
|0844|Backspace String Compare|[Go]({{< relref "/ChapterFour/0800~0899/0844.Backspace-String-Compare.md" >}})|Easy| O(n)| O(n) ||47.2%|
|
|0844|Backspace String Compare|[Go]({{< relref "/ChapterFour/0800~0899/0844.Backspace-String-Compare.md" >}})|Easy| O(n)| O(n) ||47.3%|
|
||||||
|0856|Score of Parentheses|[Go]({{< relref "/ChapterFour/0800~0899/0856.Score-of-Parentheses.md" >}})|Medium| O(n)| O(n)||65.2%|
|
|0856|Score of Parentheses|[Go]({{< relref "/ChapterFour/0800~0899/0856.Score-of-Parentheses.md" >}})|Medium| O(n)| O(n)||65.2%|
|
||||||
|0880|Decoded String at Index|[Go]({{< relref "/ChapterFour/0800~0899/0880.Decoded-String-at-Index.md" >}})|Medium| O(n)| O(n)||28.2%|
|
|0880|Decoded String at Index|[Go]({{< relref "/ChapterFour/0800~0899/0880.Decoded-String-at-Index.md" >}})|Medium| O(n)| O(n)||28.2%|
|
||||||
|0895|Maximum Frequency Stack|[Go]({{< relref "/ChapterFour/0800~0899/0895.Maximum-Frequency-Stack.md" >}})|Hard| O(n)| O(n) ||63.8%|
|
|0895|Maximum Frequency Stack|[Go]({{< relref "/ChapterFour/0800~0899/0895.Maximum-Frequency-Stack.md" >}})|Hard| O(n)| O(n) ||63.8%|
|
||||||
|
@ -87,7 +87,7 @@ weight: 2
|
|||||||
|0696|Count Binary Substrings|[Go]({{< relref "/ChapterFour/0600~0699/0696.Count-Binary-Substrings.md" >}})|Easy||||61.8%|
|
|0696|Count Binary Substrings|[Go]({{< relref "/ChapterFour/0600~0699/0696.Count-Binary-Substrings.md" >}})|Easy||||61.8%|
|
||||||
|0709|To Lower Case|[Go]({{< relref "/ChapterFour/0700~0799/0709.To-Lower-Case.md" >}})|Easy||||80.7%|
|
|0709|To Lower Case|[Go]({{< relref "/ChapterFour/0700~0799/0709.To-Lower-Case.md" >}})|Easy||||80.7%|
|
||||||
|0720|Longest Word in Dictionary|[Go]({{< relref "/ChapterFour/0700~0799/0720.Longest-Word-in-Dictionary.md" >}})|Medium||||49.9%|
|
|0720|Longest Word in Dictionary|[Go]({{< relref "/ChapterFour/0700~0799/0720.Longest-Word-in-Dictionary.md" >}})|Medium||||49.9%|
|
||||||
|0721|Accounts Merge|[Go]({{< relref "/ChapterFour/0700~0799/0721.Accounts-Merge.md" >}})|Medium||||53.3%|
|
|0721|Accounts Merge|[Go]({{< relref "/ChapterFour/0700~0799/0721.Accounts-Merge.md" >}})|Medium||||53.4%|
|
||||||
|0726|Number of Atoms|[Go]({{< relref "/ChapterFour/0700~0799/0726.Number-of-Atoms.md" >}})|Hard||||51.2%|
|
|0726|Number of Atoms|[Go]({{< relref "/ChapterFour/0700~0799/0726.Number-of-Atoms.md" >}})|Hard||||51.2%|
|
||||||
|0745|Prefix and Suffix Search|[Go]({{< relref "/ChapterFour/0700~0799/0745.Prefix-and-Suffix-Search.md" >}})|Hard||||35.3%|
|
|0745|Prefix and Suffix Search|[Go]({{< relref "/ChapterFour/0700~0799/0745.Prefix-and-Suffix-Search.md" >}})|Hard||||35.3%|
|
||||||
|0748|Shortest Completing Word|[Go]({{< relref "/ChapterFour/0700~0799/0748.Shortest-Completing-Word.md" >}})|Easy||||58.1%|
|
|0748|Shortest Completing Word|[Go]({{< relref "/ChapterFour/0700~0799/0748.Shortest-Completing-Word.md" >}})|Easy||||58.1%|
|
||||||
@ -108,7 +108,7 @@ weight: 2
|
|||||||
|0838|Push Dominoes|[Go]({{< relref "/ChapterFour/0800~0899/0838.Push-Dominoes.md" >}})|Medium||||51.8%|
|
|0838|Push Dominoes|[Go]({{< relref "/ChapterFour/0800~0899/0838.Push-Dominoes.md" >}})|Medium||||51.8%|
|
||||||
|0839|Similar String Groups|[Go]({{< relref "/ChapterFour/0800~0899/0839.Similar-String-Groups.md" >}})|Hard||||43.1%|
|
|0839|Similar String Groups|[Go]({{< relref "/ChapterFour/0800~0899/0839.Similar-String-Groups.md" >}})|Hard||||43.1%|
|
||||||
|0842|Split Array into Fibonacci Sequence|[Go]({{< relref "/ChapterFour/0800~0899/0842.Split-Array-into-Fibonacci-Sequence.md" >}})|Medium| O(n^2)| O(1)|❤️|37.2%|
|
|0842|Split Array into Fibonacci Sequence|[Go]({{< relref "/ChapterFour/0800~0899/0842.Split-Array-into-Fibonacci-Sequence.md" >}})|Medium| O(n^2)| O(1)|❤️|37.2%|
|
||||||
|0844|Backspace String Compare|[Go]({{< relref "/ChapterFour/0800~0899/0844.Backspace-String-Compare.md" >}})|Easy||||47.2%|
|
|0844|Backspace String Compare|[Go]({{< relref "/ChapterFour/0800~0899/0844.Backspace-String-Compare.md" >}})|Easy||||47.3%|
|
||||||
|0856|Score of Parentheses|[Go]({{< relref "/ChapterFour/0800~0899/0856.Score-of-Parentheses.md" >}})|Medium| O(n)| O(n)||65.2%|
|
|0856|Score of Parentheses|[Go]({{< relref "/ChapterFour/0800~0899/0856.Score-of-Parentheses.md" >}})|Medium| O(n)| O(n)||65.2%|
|
||||||
|0880|Decoded String at Index|[Go]({{< relref "/ChapterFour/0800~0899/0880.Decoded-String-at-Index.md" >}})|Medium||||28.2%|
|
|0880|Decoded String at Index|[Go]({{< relref "/ChapterFour/0800~0899/0880.Decoded-String-at-Index.md" >}})|Medium||||28.2%|
|
||||||
|0884|Uncommon Words from Two Sentences|[Go]({{< relref "/ChapterFour/0800~0899/0884.Uncommon-Words-from-Two-Sentences.md" >}})|Easy||||64.7%|
|
|0884|Uncommon Words from Two Sentences|[Go]({{< relref "/ChapterFour/0800~0899/0884.Uncommon-Words-from-Two-Sentences.md" >}})|Easy||||64.7%|
|
||||||
|
@ -29,6 +29,7 @@ weight: 6
|
|||||||
|0112|Path Sum|[Go]({{< relref "/ChapterFour/0100~0199/0112.Path-Sum.md" >}})|Easy| O(n)| O(1)||43.5%|
|
|0112|Path Sum|[Go]({{< relref "/ChapterFour/0100~0199/0112.Path-Sum.md" >}})|Easy| O(n)| O(1)||43.5%|
|
||||||
|0113|Path Sum II|[Go]({{< relref "/ChapterFour/0100~0199/0113.Path-Sum-II.md" >}})|Medium| O(n)| O(1)||51.4%|
|
|0113|Path Sum II|[Go]({{< relref "/ChapterFour/0100~0199/0113.Path-Sum-II.md" >}})|Medium| O(n)| O(1)||51.4%|
|
||||||
|0114|Flatten Binary Tree to Linked List|[Go]({{< relref "/ChapterFour/0100~0199/0114.Flatten-Binary-Tree-to-Linked-List.md" >}})|Medium| O(n)| O(1)||54.5%|
|
|0114|Flatten Binary Tree to Linked List|[Go]({{< relref "/ChapterFour/0100~0199/0114.Flatten-Binary-Tree-to-Linked-List.md" >}})|Medium| O(n)| O(1)||54.5%|
|
||||||
|
|0116|Populating Next Right Pointers in Each Node|[Go]({{< relref "/ChapterFour/0100~0199/0116.Populating-Next-Right-Pointers-in-Each-Node.md" >}})|Medium||||51.4%|
|
||||||
|0124|Binary Tree Maximum Path Sum|[Go]({{< relref "/ChapterFour/0100~0199/0124.Binary-Tree-Maximum-Path-Sum.md" >}})|Hard| O(n)| O(1)||36.3%|
|
|0124|Binary Tree Maximum Path Sum|[Go]({{< relref "/ChapterFour/0100~0199/0124.Binary-Tree-Maximum-Path-Sum.md" >}})|Hard| O(n)| O(1)||36.3%|
|
||||||
|0129|Sum Root to Leaf Numbers|[Go]({{< relref "/ChapterFour/0100~0199/0129.Sum-Root-to-Leaf-Numbers.md" >}})|Medium| O(n)| O(1)||52.7%|
|
|0129|Sum Root to Leaf Numbers|[Go]({{< relref "/ChapterFour/0100~0199/0129.Sum-Root-to-Leaf-Numbers.md" >}})|Medium| O(n)| O(1)||52.7%|
|
||||||
|0144|Binary Tree Preorder Traversal|[Go]({{< relref "/ChapterFour/0100~0199/0144.Binary-Tree-Preorder-Traversal.md" >}})|Easy| O(n)| O(1)||59.2%|
|
|0144|Binary Tree Preorder Traversal|[Go]({{< relref "/ChapterFour/0100~0199/0144.Binary-Tree-Preorder-Traversal.md" >}})|Easy| O(n)| O(1)||59.2%|
|
||||||
|
@ -85,7 +85,7 @@ weight: 3
|
|||||||
|0826|Most Profit Assigning Work|[Go]({{< relref "/ChapterFour/0800~0899/0826.Most-Profit-Assigning-Work.md" >}})|Medium| O(n log n)| O(n)||39.7%|
|
|0826|Most Profit Assigning Work|[Go]({{< relref "/ChapterFour/0800~0899/0826.Most-Profit-Assigning-Work.md" >}})|Medium| O(n log n)| O(n)||39.7%|
|
||||||
|0832|Flipping an Image|[Go]({{< relref "/ChapterFour/0800~0899/0832.Flipping-an-Image.md" >}})|Easy||||78.8%|
|
|0832|Flipping an Image|[Go]({{< relref "/ChapterFour/0800~0899/0832.Flipping-an-Image.md" >}})|Easy||||78.8%|
|
||||||
|0838|Push Dominoes|[Go]({{< relref "/ChapterFour/0800~0899/0838.Push-Dominoes.md" >}})|Medium| O(n)| O(n)||51.8%|
|
|0838|Push Dominoes|[Go]({{< relref "/ChapterFour/0800~0899/0838.Push-Dominoes.md" >}})|Medium| O(n)| O(n)||51.8%|
|
||||||
|0844|Backspace String Compare|[Go]({{< relref "/ChapterFour/0800~0899/0844.Backspace-String-Compare.md" >}})|Easy| O(n)| O(n) ||47.2%|
|
|0844|Backspace String Compare|[Go]({{< relref "/ChapterFour/0800~0899/0844.Backspace-String-Compare.md" >}})|Easy| O(n)| O(n) ||47.3%|
|
||||||
|0845|Longest Mountain in Array|[Go]({{< relref "/ChapterFour/0800~0899/0845.Longest-Mountain-in-Array.md" >}})|Medium| O(n)| O(1) ||39.0%|
|
|0845|Longest Mountain in Array|[Go]({{< relref "/ChapterFour/0800~0899/0845.Longest-Mountain-in-Array.md" >}})|Medium| O(n)| O(1) ||39.0%|
|
||||||
|0876|Middle of the Linked List|[Go]({{< relref "/ChapterFour/0800~0899/0876.Middle-of-the-Linked-List.md" >}})|Easy||||69.7%|
|
|0876|Middle of the Linked List|[Go]({{< relref "/ChapterFour/0800~0899/0876.Middle-of-the-Linked-List.md" >}})|Easy||||69.7%|
|
||||||
|0881|Boats to Save People|[Go]({{< relref "/ChapterFour/0800~0899/0881.Boats-to-Save-People.md" >}})|Medium| O(n log n)| O(1) ||49.3%|
|
|0881|Boats to Save People|[Go]({{< relref "/ChapterFour/0800~0899/0881.Boats-to-Save-People.md" >}})|Medium| O(n log n)| O(1) ||49.3%|
|
||||||
|
@ -27,7 +27,7 @@ weight: 16
|
|||||||
|0684|Redundant Connection|[Go]({{< relref "/ChapterFour/0600~0699/0684.Redundant-Connection.md" >}})|Medium| O(n)| O(n)||60.0%|
|
|0684|Redundant Connection|[Go]({{< relref "/ChapterFour/0600~0699/0684.Redundant-Connection.md" >}})|Medium| O(n)| O(n)||60.0%|
|
||||||
|0685|Redundant Connection II|[Go]({{< relref "/ChapterFour/0600~0699/0685.Redundant-Connection-II.md" >}})|Hard| O(n)| O(n)||33.3%|
|
|0685|Redundant Connection II|[Go]({{< relref "/ChapterFour/0600~0699/0685.Redundant-Connection-II.md" >}})|Hard| O(n)| O(n)||33.3%|
|
||||||
|0695|Max Area of Island|[Go]({{< relref "/ChapterFour/0600~0699/0695.Max-Area-of-Island.md" >}})|Medium||||67.0%|
|
|0695|Max Area of Island|[Go]({{< relref "/ChapterFour/0600~0699/0695.Max-Area-of-Island.md" >}})|Medium||||67.0%|
|
||||||
|0721|Accounts Merge|[Go]({{< relref "/ChapterFour/0700~0799/0721.Accounts-Merge.md" >}})|Medium| O(n)| O(n)|❤️|53.3%|
|
|0721|Accounts Merge|[Go]({{< relref "/ChapterFour/0700~0799/0721.Accounts-Merge.md" >}})|Medium| O(n)| O(n)|❤️|53.4%|
|
||||||
|0765|Couples Holding Hands|[Go]({{< relref "/ChapterFour/0700~0799/0765.Couples-Holding-Hands.md" >}})|Hard| O(n)| O(n)|❤️|56.0%|
|
|0765|Couples Holding Hands|[Go]({{< relref "/ChapterFour/0700~0799/0765.Couples-Holding-Hands.md" >}})|Hard| O(n)| O(n)|❤️|56.0%|
|
||||||
|0778|Swim in Rising Water|[Go]({{< relref "/ChapterFour/0700~0799/0778.Swim-in-Rising-Water.md" >}})|Hard| O(n^2)| O(n)|❤️|57.7%|
|
|0778|Swim in Rising Water|[Go]({{< relref "/ChapterFour/0700~0799/0778.Swim-in-Rising-Water.md" >}})|Hard| O(n^2)| O(n)|❤️|57.7%|
|
||||||
|0785|Is Graph Bipartite?|[Go]({{< relref "/ChapterFour/0700~0799/0785.Is-Graph-Bipartite.md" >}})|Medium||||49.2%|
|
|0785|Is Graph Bipartite?|[Go]({{< relref "/ChapterFour/0700~0799/0785.Is-Graph-Bipartite.md" >}})|Medium||||49.2%|
|
||||||
|
Reference in New Issue
Block a user