Skip to content

Commit 76753e8

Browse files
committed
Update solution 0874
1 parent a10cebc commit 76753e8

File tree

11 files changed

+248
-95
lines changed

11 files changed

+248
-95
lines changed

README.md

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -126,16 +126,16 @@
126126

127127
| | Easy | Medium | Hard | Total |
128128
|:--------:|:--------:|:--------:|:--------:|:--------:|
129-
|Optimizing|36|37|18|91|
129+
|Optimizing|35|37|18|90|
130130
|Accepted|**279**|**370**|**108**|**757**|
131131
|Total|484|978|391|1853|
132-
|Perfection Rate|87.1%|90.0%|83.3%|88.0%|
132+
|Perfection Rate|87.5%|90.0%|83.3%|88.1%|
133133
|Completion Rate|57.6%|37.8%|27.6%|40.9%|
134134
|------------|----------------------------|----------------------------|----------------------------|----------------------------|
135135

136136
## 二. 目录
137137

138-
以下已经收录了 666 道题的题解,还有 11 道题在尝试优化到 beats 100%
138+
以下已经收录了 667 道题的题解,还有 11 道题在尝试优化到 beats 100%
139139

140140
| No. | Title | Solution | Acceptance | Difficulty | Frequency |
141141
|:--------:|:--------------------------------------------------------------|:--------:|:--------:|:--------:|:--------:|
@@ -210,7 +210,7 @@
210210
|0069|Sqrt(x)|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0069.Sqrt(x))|35.6%|Easy||
211211
|0070|Climbing Stairs|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0070.Climbing-Stairs)|48.9%|Easy||
212212
|0071|Simplify Path|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0071.Simplify-Path)|35.1%|Medium||
213-
|0072|Edit Distance||47.3%|Hard||
213+
|0072|Edit Distance||47.4%|Hard||
214214
|0073|Set Matrix Zeroes|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0073.Set-Matrix-Zeroes)|44.8%|Medium||
215215
|0074|Search a 2D Matrix|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0074.Search-a-2D-Matrix)|38.3%|Medium||
216216
|0075|Sort Colors|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0075.Sort-Colors)|50.1%|Medium||
@@ -319,7 +319,7 @@
319319
|0178|Rank Scores||51.5%|Medium||
320320
|0179|Largest Number|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0179.Largest-Number)|31.0%|Medium||
321321
|0180|Consecutive Numbers||42.9%|Medium||
322-
|0181|Employees Earning More Than Their Managers||61.4%|Easy||
322+
|0181|Employees Earning More Than Their Managers||61.5%|Easy||
323323
|0182|Duplicate Emails||65.3%|Easy||
324324
|0183|Customers Who Never Order||57.9%|Easy||
325325
|0184|Department Highest Salary||41.3%|Medium||
@@ -376,7 +376,7 @@
376376
|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)|52.4%|Easy||
377377
|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)|49.7%|Medium||
378378
|0237|Delete Node in a Linked List|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0237.Delete-Node-in-a-Linked-List)|67.8%|Easy||
379-
|0238|Product of Array Except Self||61.4%|Medium||
379+
|0238|Product of Array Except Self||61.3%|Medium||
380380
|0239|Sliding Window Maximum|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0239.Sliding-Window-Maximum)|44.9%|Hard||
381381
|0240|Search a 2D Matrix II|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0240.Search-a-2D-Matrix-II)|45.5%|Medium||
382382
|0241|Different Ways to Add Parentheses||57.8%|Medium||
@@ -980,7 +980,7 @@
980980
|0839|Similar String Groups|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0839.Similar-String-Groups)|41.9%|Hard||
981981
|0840|Magic Squares In Grid||37.9%|Medium||
982982
|0841|Keys and Rooms|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0841.Keys-and-Rooms)|66.6%|Medium||
983-
|0842|Split Array into Fibonacci Sequence|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0842.Split-Array-into-Fibonacci-Sequence)|37.1%|Medium||
983+
|0842|Split Array into Fibonacci Sequence|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0842.Split-Array-into-Fibonacci-Sequence)|37.0%|Medium||
984984
|0843|Guess the Word||46.3%|Hard||
985985
|0844|Backspace String Compare|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0844.Backspace-String-Compare)|47.2%|Easy||
986986
|0845|Longest Mountain in Array|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0845.Longest-Mountain-in-Array)|38.8%|Medium||
@@ -1012,7 +1012,7 @@
10121012
|0871|Minimum Number of Refueling Stops||32.6%|Hard||
10131013
|0872|Leaf-Similar Trees|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0872.Leaf-Similar-Trees)|64.5%|Easy||
10141014
|0873|Length of Longest Fibonacci Subsequence||48.2%|Medium||
1015-
|0874|Walking Robot Simulation||36.8%|Easy||
1015+
|0874|Walking Robot Simulation|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0874.Walking-Robot-Simulation)|36.8%|Easy||
10161016
|0875|Koko Eating Bananas|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0875.Koko-Eating-Bananas)|53.5%|Medium||
10171017
|0876|Middle of the Linked List|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0876.Middle-of-the-Linked-List)|69.3%|Easy||
10181018
|0877|Stone Game||67.2%|Medium||
@@ -1044,7 +1044,7 @@
10441044
|0903|Valid Permutations for DI Sequence||54.4%|Hard||
10451045
|0904|Fruit Into Baskets|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0904.Fruit-Into-Baskets)|43.0%|Medium||
10461046
|0905|Sort Array By Parity||75.0%|Easy||
1047-
|0906|Super Palindromes||32.7%|Hard||
1047+
|0906|Super Palindromes||33.2%|Hard||
10481048
|0907|Sum of Subarray Minimums|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0907.Sum-of-Subarray-Minimums)|33.1%|Medium||
10491049
|0908|Smallest Range I||66.4%|Easy||
10501050
|0909|Snakes and Ladders||39.3%|Medium||
@@ -1183,7 +1183,7 @@
11831183
|1042|Flower Planting With No Adjacent||48.8%|Medium||
11841184
|1043|Partition Array for Maximum Sum||67.7%|Medium||
11851185
|1044|Longest Duplicate Substring||31.3%|Hard||
1186-
|1045|Customers Who Bought All Products||68.3%|Medium||
1186+
|1045|Customers Who Bought All Products||68.2%|Medium||
11871187
|1046|Last Stone Weight||62.4%|Easy||
11881188
|1047|Remove All Adjacent Duplicates In String|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1047.Remove-All-Adjacent-Duplicates-In-String)|71.5%|Easy||
11891189
|1048|Longest String Chain||55.7%|Medium||
@@ -1346,7 +1346,7 @@
13461346
|1205|Monthly Transactions II||45.7%|Medium||
13471347
|1206|Design Skiplist||59.0%|Hard||
13481348
|1207|Unique Number of Occurrences|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1207.Unique-Number-of-Occurrences)|72.0%|Easy||
1349-
|1208|Get Equal Substrings Within Budget|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1208.Get-Equal-Substrings-Within-Budget)|44.3%|Medium||
1349+
|1208|Get Equal Substrings Within Budget|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1208.Get-Equal-Substrings-Within-Budget)|44.4%|Medium||
13501350
|1209|Remove All Adjacent Duplicates in String II|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1209.Remove-All-Adjacent-Duplicates-in-String-II)|57.6%|Medium||
13511351
|1210|Minimum Moves to Reach Target with Rotations||46.7%|Hard||
13521352
|1211|Queries Quality and Percentage||70.2%|Easy||
@@ -1589,7 +1589,7 @@
15891589
|1448|Count Good Nodes in Binary Tree||71.7%|Medium||
15901590
|1449|Form Largest Integer With Digits That Add up to Target||44.6%|Hard||
15911591
|1450|Number of Students Doing Homework at a Given Time||77.0%|Easy||
1592-
|1451|Rearrange Words in a Sentence||60.1%|Medium||
1592+
|1451|Rearrange Words in a Sentence||60.0%|Medium||
15931593
|1452|People Whose List of Favorite Companies Is Not a Subset of Another List||55.4%|Medium||
15941594
|1453|Maximum Number of Darts Inside of a Circular Dartboard||35.8%|Hard||
15951595
|1454|Active Users||38.8%|Medium||
@@ -1635,7 +1635,7 @@
16351635
|1494|Parallel Courses II||30.9%|Hard||
16361636
|1495|Friendly Movies Streamed Last Month||51.1%|Easy||
16371637
|1496|Path Crossing||55.2%|Easy||
1638-
|1497|Check If Array Pairs Are Divisible by k||40.3%|Medium||
1638+
|1497|Check If Array Pairs Are Divisible by k||40.2%|Medium||
16391639
|1498|Number of Subsequences That Satisfy the Given Sum Condition||39.1%|Medium||
16401640
|1499|Max Value of Equation||45.4%|Hard||
16411641
|1500|Design a File Sharing System||46.7%|Medium||
@@ -1690,19 +1690,19 @@
16901690
|1549|The Most Recent Orders for Each Product||67.4%|Medium||
16911691
|1550|Three Consecutive Odds||64.5%|Easy||
16921692
|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.7%|Medium||
1693-
|1552|Magnetic Force Between Two Balls||49.5%|Medium||
1693+
|1552|Magnetic Force Between Two Balls||49.6%|Medium||
16941694
|1553|Minimum Number of Days to Eat N Oranges||30.1%|Hard||
16951695
|1554|Strings Differ by One Character||64.3%|Medium||
16961696
|1555|Bank Account Summary||52.8%|Medium||
16971697
|1556|Thousand Separator||57.0%|Easy||
16981698
|1557|Minimum Number of Vertices to Reach All Nodes||75.9%|Medium||
16991699
|1558|Minimum Numbers of Function Calls to Make Target Array||63.3%|Medium||
1700-
|1559|Detect Cycles in 2D Grid||44.6%|Hard||
1700+
|1559|Detect Cycles in 2D Grid||44.7%|Hard||
17011701
|1560|Most Visited Sector in a Circular Track||56.9%|Easy||
17021702
|1561|Maximum Number of Coins You Can Get||77.2%|Medium||
17031703
|1562|Find Latest Group of Size M||39.8%|Medium||
17041704
|1563|Stone Game V||39.9%|Hard||
1705-
|1564|Put Boxes Into the Warehouse I||65.6%|Medium||
1705+
|1564|Put Boxes Into the Warehouse I||65.9%|Medium||
17061706
|1565|Unique Orders and Customers Per Month||82.9%|Easy||
17071707
|1566|Detect Pattern of Length M Repeated K or More Times||42.7%|Easy||
17081708
|1567|Maximum Length of Subarray With Positive Product||37.2%|Medium||
@@ -1726,7 +1726,7 @@
17261726
|1585|Check If String Is Transformable With Substring Sort Operations||48.6%|Hard||
17271727
|1586|Binary Search Tree Iterator II||66.7%|Medium||
17281728
|1587|Bank Account Summary II||90.0%|Easy||
1729-
|1588|Sum of All Odd Length Subarrays||81.7%|Easy||
1729+
|1588|Sum of All Odd Length Subarrays||81.8%|Easy||
17301730
|1589|Maximum Sum Obtained of Any Permutation||35.1%|Medium||
17311731
|1590|Make Sum Divisible by P||26.9%|Medium||
17321732
|1591|Strange Printer II||55.7%|Hard||
@@ -1738,7 +1738,7 @@
17381738
|1597|Build Binary Expression Tree From Infix Expression||59.2%|Hard||
17391739
|1598|Crawler Log Folder||63.8%|Easy||
17401740
|1599|Maximum Profit of Operating a Centennial Wheel||43.7%|Medium||
1741-
|1600|Throne Inheritance||60.8%|Medium||
1741+
|1600|Throne Inheritance||60.9%|Medium||
17421742
|1601|Maximum Number of Achievable Transfer Requests||48.0%|Hard||
17431743
|1602|Find Nearest Right Node in Binary Tree||73.4%|Medium||
17441744
|1603|Design Parking System|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1603.Design-Parking-System)|86.4%|Easy||
@@ -1747,7 +1747,7 @@
17471747
|1606|Find Servers That Handled Most Number of Requests||37.6%|Hard||
17481748
|1607|Sellers With No Sales||55.2%|Easy||
17491749
|1608|Special Array With X Elements Greater Than or Equal X|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1608.Special-Array-With-X-Elements-Greater-Than-or-Equal-X)|61.3%|Easy||
1750-
|1609|Even Odd Tree||52.1%|Medium||
1750+
|1609|Even Odd Tree||52.2%|Medium||
17511751
|1610|Maximum Number of Visible Points||31.5%|Hard||
17521752
|1611|Minimum One Bit Operations to Make Integers Zero||58.0%|Hard||
17531753
|1612|Check If Two Expression Trees are Equivalent||69.9%|Medium||
@@ -1863,7 +1863,7 @@
18631863
|1722|Minimize Hamming Distance After Swap Operations||54.2%|Medium||
18641864
|1723|Find Minimum Time to Finish All Jobs||43.8%|Hard||
18651865
|1724|Checking Existence of Edge Length Limited Paths II||57.8%|Hard||
1866-
|1725|Number Of Rectangles That Can Form The Largest Square|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1725.Number-Of-Rectangles-That-Can-Form-The-Largest-Square)|78.1%|Easy||
1866+
|1725|Number Of Rectangles That Can Form The Largest Square|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1725.Number-Of-Rectangles-That-Can-Form-The-Largest-Square)|78.2%|Easy||
18671867
|1726|Tuple with Same Product||57.4%|Medium||
18681868
|1727|Largest Submatrix With Rearrangements||59.0%|Medium||
18691869
|1728|Cat and Mouse II||41.1%|Hard||
@@ -1883,7 +1883,7 @@
18831883
|1742|Maximum Number of Balls in a Box|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1742.Maximum-Number-of-Balls-in-a-Box)|73.4%|Easy||
18841884
|1743|Restore the Array From Adjacent Pairs||63.8%|Medium||
18851885
|1744|Can You Eat Your Favorite Candy on Your Favorite Day?||30.8%|Medium||
1886-
|1745|Palindrome Partitioning IV||49.4%|Hard||
1886+
|1745|Palindrome Partitioning IV||49.5%|Hard||
18871887
|1746|Maximum Subarray Sum After One Operation||61.9%|Medium||
18881888
|1747|Leetflex Banned Accounts||68.9%|Medium||
18891889
|1748|Sum of Unique Elements|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1748.Sum-of-Unique-Elements)|74.5%|Easy||
@@ -1914,7 +1914,7 @@
19141914
|1773|Count Items Matching a Rule||84.6%|Easy||
19151915
|1774|Closest Dessert Cost||57.3%|Medium||
19161916
|1775|Equal Sum Arrays With Minimum Number of Operations||50.7%|Medium||
1917-
|1776|Car Fleet II||47.8%|Hard||
1917+
|1776|Car Fleet II||47.9%|Hard||
19181918
|1777|Product's Price for Each Store||86.4%|Easy||
19191919
|1778|Shortest Path in a Hidden Grid||45.3%|Medium||
19201920
|1779|Find Nearest Point That Has the Same X or Y Coordinate||66.8%|Easy||
@@ -1952,7 +1952,7 @@
19521952
|1811|Find Interview Candidates||68.2%|Medium||
19531953
|1812|Determine Color of a Chessboard Square||78.1%|Easy||
19541954
|1813|Sentence Similarity III||43.0%|Medium||
1955-
|1814|Count Nice Pairs in an Array||38.9%|Medium||
1955+
|1814|Count Nice Pairs in an Array||39.0%|Medium||
19561956
|1815|Maximum Number of Groups Getting Fresh Donuts||38.9%|Hard||
19571957
|1816|Truncate Sentence||79.3%|Easy||
19581958
|1817|Finding the Users Active Minutes||78.4%|Medium||
@@ -1961,7 +1961,7 @@
19611961
|1820|Maximum Number of Accepted Invitations||49.2%|Medium||
19621962
|1821|Find Customers With Positive Revenue this Year||89.5%|Easy||
19631963
|1822|Sign of the Product of an Array||78.5%|Easy||
1964-
|1823|Find the Winner of the Circular Game||72.2%|Medium||
1964+
|1823|Find the Winner of the Circular Game||72.1%|Medium||
19651965
|1824|Minimum Sideway Jumps||58.3%|Medium||
19661966
|1825|Finding MK Average||31.2%|Hard||
19671967
|1826|Faulty Sensor||58.9%|Easy||
@@ -1988,9 +1988,9 @@
19881988
|1847|Closest Room||35.2%|Hard||
19891989
|1848|Minimum Distance to the Target Element||62.2%|Easy||
19901990
|1849|Splitting a String Into Descending Consecutive Values||34.7%|Medium||
1991-
|1850|Minimum Adjacent Swaps to Reach the Kth Smallest Number||61.9%|Medium||
1991+
|1850|Minimum Adjacent Swaps to Reach the Kth Smallest Number||62.0%|Medium||
19921992
|1851|Minimum Interval to Include Each Query||40.2%|Hard||
1993-
|1852|Distinct Numbers in Each Subarray||79.5%|Medium||
1993+
|1852|Distinct Numbers in Each Subarray||79.6%|Medium||
19941994
|1853|Convert Date Format||91.1%|Easy||
19951995
|------------|-------------------------------------------------------|-------| ----------------| ---------------|-------------|
19961996

0 commit comments

Comments
 (0)