mirror of
https://github.com/halfrost/LeetCode-Go.git
synced 2025-07-05 08:27:30 +08:00
Update solution 0066
This commit is contained in:
12
README.md
12
README.md
@ -497,7 +497,7 @@
|
||||
|0356|Line Reflection||33.1%|Medium||
|
||||
|0357|Count Numbers with Unique Digits|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0357.Count-Numbers-with-Unique-Digits)|49.0%|Medium||
|
||||
|0358|Rearrange String k Distance Apart||35.7%|Hard||
|
||||
|0359|Logger Rate Limiter||72.6%|Easy||
|
||||
|0359|Logger Rate Limiter||72.5%|Easy||
|
||||
|0360|Sort Transformed Array||49.9%|Medium||
|
||||
|0361|Bomb Enemy||46.9%|Medium||
|
||||
|0362|Design Hit Counter||65.5%|Medium||
|
||||
@ -1862,7 +1862,7 @@
|
||||
|1721|Swapping Nodes in a Linked List|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1721.Swapping-Nodes-in-a-Linked-List)|67.5%|Medium||
|
||||
|1722|Minimize Hamming Distance After Swap Operations||54.2%|Medium||
|
||||
|1723|Find Minimum Time to Finish All Jobs||43.7%|Hard||
|
||||
|1724|Checking Existence of Edge Length Limited Paths II||57.9%|Hard||
|
||||
|1724|Checking Existence of Edge Length Limited Paths II||58.0%|Hard||
|
||||
|1725|Number Of Rectangles That Can Form The Largest Square|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1725.Number-Of-Rectangles-That-Can-Form-The-Largest-Square)|78.0%|Easy||
|
||||
|1726|Tuple with Same Product||56.7%|Medium||
|
||||
|1727|Largest Submatrix With Rearrangements||58.8%|Medium||
|
||||
@ -1914,12 +1914,12 @@
|
||||
|1773|Count Items Matching a Rule||85.1%|Easy||
|
||||
|1774|Closest Dessert Cost||58.2%|Medium||
|
||||
|1775|Equal Sum Arrays With Minimum Number of Operations||50.6%|Medium||
|
||||
|1776|Car Fleet II||46.4%|Hard||
|
||||
|1776|Car Fleet II||46.5%|Hard||
|
||||
|1777|Product's Price for Each Store||87.3%|Easy||
|
||||
|1778|Shortest Path in a Hidden Grid||46.5%|Medium||
|
||||
|1779|Find Nearest Point That Has the Same X or Y Coordinate||67.4%|Easy||
|
||||
|1780|Check if Number is a Sum of Powers of Three||63.4%|Medium||
|
||||
|1781|Sum of Beauty of All Substrings||57.7%|Medium||
|
||||
|1781|Sum of Beauty of All Substrings||57.8%|Medium||
|
||||
|1782|Count Pairs Of Nodes||32.6%|Hard||
|
||||
|1783|Grand Slam Titles||91.4%|Medium||
|
||||
|1784|Check if Binary String Has at Most One Segment of Ones||41.6%|Easy||
|
||||
@ -1956,8 +1956,8 @@
|
||||
|1815|Maximum Number of Groups Getting Fresh Donuts||38.3%|Hard||
|
||||
|1816|Truncate Sentence||78.8%|Easy||
|
||||
|1817|Finding the Users Active Minutes||78.8%|Medium||
|
||||
|1818|Minimum Absolute Sum Difference||45.6%|Medium||
|
||||
|1819|Number of Different Subsequences GCDs||31.4%|Hard||
|
||||
|1818|Minimum Absolute Sum Difference||45.5%|Medium||
|
||||
|1819|Number of Different Subsequences GCDs||31.3%|Hard||
|
||||
|1820|Maximum Number of Accepted Invitations||52.7%|Medium||
|
||||
|------------|-------------------------------------------------------|-------| ----------------| ---------------|-------------|
|
||||
|
||||
|
@ -12,6 +12,7 @@ func plusOne(digits []int) []int {
|
||||
} else {
|
||||
digits[i] += carry
|
||||
carry = 0
|
||||
break
|
||||
}
|
||||
}
|
||||
if digits[0] == 0 && carry == 1 {
|
||||
|
@ -52,6 +52,7 @@ func plusOne(digits []int) []int {
|
||||
} else {
|
||||
digits[i] += carry
|
||||
carry = 0
|
||||
break
|
||||
}
|
||||
}
|
||||
if digits[0] == 0 && carry == 1 {
|
||||
@ -60,6 +61,7 @@ func plusOne(digits []int) []int {
|
||||
return digits
|
||||
}
|
||||
|
||||
|
||||
```
|
||||
|
||||
|
||||
|
@ -163,7 +163,7 @@ weight: 1
|
||||
|1629|Slowest Key|[Go]({{< relref "/ChapterFour/1600~1699/1629.Slowest-Key.md" >}})|Easy||||59.1%|
|
||||
|1636|Sort Array by Increasing Frequency|[Go]({{< relref "/ChapterFour/1600~1699/1636.Sort-Array-by-Increasing-Frequency.md" >}})|Easy||||66.8%|
|
||||
|1640|Check Array Formation Through Concatenation|[Go]({{< relref "/ChapterFour/1600~1699/1640.Check-Array-Formation-Through-Concatenation.md" >}})|Easy||||59.8%|
|
||||
|1646|Get Maximum in Generated Array|[Go]({{< relref "/ChapterFour/1600~1699/1646.Get-Maximum-in-Generated-Array.md" >}})|Easy||||53.2%|
|
||||
|1646|Get Maximum in Generated Array|[Go]({{< relref "/ChapterFour/1600~1699/1646.Get-Maximum-in-Generated-Array.md" >}})|Easy||||53.1%|
|
||||
|1652|Defuse the Bomb|[Go]({{< relref "/ChapterFour/1600~1699/1652.Defuse-the-Bomb.md" >}})|Easy||||61.6%|
|
||||
|1656|Design an Ordered Stream|[Go]({{< relref "/ChapterFour/1600~1699/1656.Design-an-Ordered-Stream.md" >}})|Easy||||82.1%|
|
||||
|1672|Richest Customer Wealth|[Go]({{< relref "/ChapterFour/1600~1699/1672.Richest-Customer-Wealth.md" >}})|Easy||||88.2%|
|
||||
|
@ -60,7 +60,7 @@ weight: 9
|
||||
|0802|Find Eventual Safe States|[Go]({{< relref "/ChapterFour/0800~0899/0802.Find-Eventual-Safe-States.md" >}})|Medium||||50.0%|
|
||||
|0834|Sum of Distances in Tree|[Go]({{< relref "/ChapterFour/0800~0899/0834.Sum-of-Distances-in-Tree.md" >}})|Hard||||46.6%|
|
||||
|0839|Similar String Groups|[Go]({{< relref "/ChapterFour/0800~0899/0839.Similar-String-Groups.md" >}})|Hard||||41.7%|
|
||||
|0841|Keys and Rooms|[Go]({{< relref "/ChapterFour/0800~0899/0841.Keys-and-Rooms.md" >}})|Medium||||66.5%|
|
||||
|0841|Keys and Rooms|[Go]({{< relref "/ChapterFour/0800~0899/0841.Keys-and-Rooms.md" >}})|Medium||||66.4%|
|
||||
|0851|Loud and Rich|[Go]({{< relref "/ChapterFour/0800~0899/0851.Loud-and-Rich.md" >}})|Medium||||52.9%|
|
||||
|0863|All Nodes Distance K in Binary Tree|[Go]({{< relref "/ChapterFour/0800~0899/0863.All-Nodes-Distance-K-in-Binary-Tree.md" >}})|Medium||||58.2%|
|
||||
|0872|Leaf-Similar Trees|[Go]({{< relref "/ChapterFour/0800~0899/0872.Leaf-Similar-Trees.md" >}})|Easy||||64.5%|
|
||||
|
@ -33,7 +33,7 @@ weight: 17
|
||||
|0076|Minimum Window Substring|[Go]({{< relref "/ChapterFour/0001~0099/0076.Minimum-Window-Substring.md" >}})|Hard| O(n)| O(n)|❤️|36.2%|
|
||||
|0239|Sliding Window Maximum|[Go]({{< relref "/ChapterFour/0200~0299/0239.Sliding-Window-Maximum.md" >}})|Hard| O(n * k)| O(n)|❤️|44.8%|
|
||||
|0395|Longest Substring with At Least K Repeating Characters|[Go]({{< relref "/ChapterFour/0300~0399/0395.Longest-Substring-with-At-Least-K-Repeating-Characters.md" >}})|Medium||||43.6%|
|
||||
|0424|Longest Repeating Character Replacement|[Go]({{< relref "/ChapterFour/0400~0499/0424.Longest-Repeating-Character-Replacement.md" >}})|Medium| O(n)| O(1) ||48.3%|
|
||||
|0424|Longest Repeating Character Replacement|[Go]({{< relref "/ChapterFour/0400~0499/0424.Longest-Repeating-Character-Replacement.md" >}})|Medium| O(n)| O(1) ||48.4%|
|
||||
|0480|Sliding Window Median|[Go]({{< relref "/ChapterFour/0400~0499/0480.Sliding-Window-Median.md" >}})|Hard| O(n * log k)| O(k)|❤️|38.9%|
|
||||
|0567|Permutation in String|[Go]({{< relref "/ChapterFour/0500~0599/0567.Permutation-in-String.md" >}})|Medium| O(n)| O(1)|❤️|44.6%|
|
||||
|0978|Longest Turbulent Subarray|[Go]({{< relref "/ChapterFour/0900~0999/0978.Longest-Turbulent-Subarray.md" >}})|Medium| O(n)| O(1)|❤️|46.7%|
|
||||
|
@ -61,7 +61,7 @@ weight: 3
|
||||
|0345|Reverse Vowels of a String|[Go]({{< relref "/ChapterFour/0300~0399/0345.Reverse-Vowels-of-a-String.md" >}})|Easy| O(n)| O(1)||45.2%|
|
||||
|0349|Intersection of Two Arrays|[Go]({{< relref "/ChapterFour/0300~0399/0349.Intersection-of-Two-Arrays.md" >}})|Easy| O(n)| O(n) ||65.3%|
|
||||
|0350|Intersection of Two Arrays II|[Go]({{< relref "/ChapterFour/0300~0399/0350.Intersection-of-Two-Arrays-II.md" >}})|Easy| O(n)| O(n) ||52.2%|
|
||||
|0424|Longest Repeating Character Replacement|[Go]({{< relref "/ChapterFour/0400~0499/0424.Longest-Repeating-Character-Replacement.md" >}})|Medium| O(n)| O(1) ||48.3%|
|
||||
|0424|Longest Repeating Character Replacement|[Go]({{< relref "/ChapterFour/0400~0499/0424.Longest-Repeating-Character-Replacement.md" >}})|Medium| O(n)| O(1) ||48.4%|
|
||||
|0457|Circular Array Loop|[Go]({{< relref "/ChapterFour/0400~0499/0457.Circular-Array-Loop.md" >}})|Medium||||30.3%|
|
||||
|0524|Longest Word in Dictionary through Deleting|[Go]({{< relref "/ChapterFour/0500~0599/0524.Longest-Word-in-Dictionary-through-Deleting.md" >}})|Medium| O(n)| O(1) ||50.1%|
|
||||
|0532|K-diff Pairs in an Array|[Go]({{< relref "/ChapterFour/0500~0599/0532.K-diff-Pairs-in-an-Array.md" >}})|Medium| O(n)| O(n)||35.5%|
|
||||
|
Reference in New Issue
Block a user