Skip to content

Commit cf841b8

Browse files
committed
Add solution 0991
1 parent fd62b9f commit cf841b8

21 files changed

+413
-163
lines changed

README.md

Lines changed: 125 additions & 121 deletions
Large diffs are not rendered by default.
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
package leetcode
2+
3+
func brokenCalc(X int, Y int) int {
4+
res := 0
5+
for Y > X {
6+
res++
7+
if Y&1 == 1 {
8+
Y++
9+
} else {
10+
Y /= 2
11+
}
12+
}
13+
return res + X - Y
14+
}
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
package leetcode
2+
3+
import (
4+
"fmt"
5+
"testing"
6+
)
7+
8+
type question991 struct {
9+
para991
10+
ans991
11+
}
12+
13+
// para 是参数
14+
// one 代表第一个参数
15+
type para991 struct {
16+
X int
17+
Y int
18+
}
19+
20+
// ans 是答案
21+
// one 代表第一个答案
22+
type ans991 struct {
23+
one int
24+
}
25+
26+
func Test_Problem991(t *testing.T) {
27+
28+
qs := []question991{
29+
30+
{
31+
para991{2, 3},
32+
ans991{2},
33+
},
34+
35+
{
36+
para991{5, 8},
37+
ans991{2},
38+
},
39+
40+
{
41+
para991{3, 10},
42+
ans991{3},
43+
},
44+
45+
{
46+
para991{1024, 1},
47+
ans991{1023},
48+
},
49+
}
50+
51+
fmt.Printf("------------------------Leetcode Problem 991------------------------\n")
52+
53+
for _, q := range qs {
54+
_, p := q.ans991, q.para991
55+
fmt.Printf("【input】:%v 【output】:%v\n", p, brokenCalc(p.X, p.Y))
56+
}
57+
fmt.Printf("\n\n\n")
58+
}
Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
# [991. Broken Calculator](https://leetcode.com/problems/broken-calculator/)
2+
3+
4+
## 题目
5+
6+
On a broken calculator that has a number showing on its display, we can perform two operations:
7+
8+
- **Double**: Multiply the number on the display by 2, or;
9+
- **Decrement**: Subtract 1 from the number on the display.
10+
11+
Initially, the calculator is displaying the number `X`.
12+
13+
Return the minimum number of operations needed to display the number `Y`.
14+
15+
**Example 1:**
16+
17+
```
18+
Input: X = 2, Y = 3
19+
Output: 2
20+
Explanation: Use double operation and then decrement operation {2 -> 4 -> 3}.
21+
```
22+
23+
**Example 2:**
24+
25+
```
26+
Input: X = 5, Y = 8
27+
Output: 2
28+
Explanation: Use decrement and then double {5 -> 4 -> 8}.
29+
```
30+
31+
**Example 3:**
32+
33+
```
34+
Input: X = 3, Y = 10
35+
Output: 3
36+
Explanation: Use double, decrement and double {3 -> 6 -> 5 -> 10}.
37+
```
38+
39+
**Example 4:**
40+
41+
```
42+
Input: X = 1024, Y = 1
43+
Output: 1023
44+
Explanation: Use decrement operations 1023 times.
45+
```
46+
47+
**Note:**
48+
49+
1. `1 <= X <= 10^9`
50+
2. `1 <= Y <= 10^9`
51+
52+
## 题目大意
53+
54+
在显示着数字的坏计算器上,我们可以执行以下两种操作:
55+
56+
- 双倍(Double):将显示屏上的数字乘 2;
57+
- 递减(Decrement):将显示屏上的数字减 1 。
58+
59+
最初,计算器显示数字 X。返回显示数字 Y 所需的最小操作数。
60+
61+
## 解题思路
62+
63+
- 看到本题的数据规模非常大,`10^9`,算法只能采用 `O(sqrt(n))``O(log n)``O(1)` 的算法。`O(sqrt(n))``O(1)` 在本题中是不可能的。所以按照数据规模来估计,本题只能尝试 `O(log n)` 的算法。`O(log n)` 的算法有二分搜索,不过本题不太符合二分搜索算法背景。题目中明显出现乘 2,这很明显是可以达到 `O(log n)` 的。最终确定解题思路是数学方法,循环中会用到乘 2 或者除 2 的计算。
64+
- 既然出现了乘 2 和减一的操作,很容易考虑到奇偶性上。题目要求最小操作数,贪心思想,应该尽可能多的使用除 2 操作,使得 Y 和 X 大小差不多,最后再利用加一操作微调。只要 Y 比 X 大就执行除法操作。当然这里要考虑一次奇偶性,如果 Y 是奇数,先加一变成偶数再除二;如果 Y 是偶数,直接除二。如此操作直到 Y 不大于 X,最后执行 `X-Y` 次加法操作微调即可。
65+
66+
## 代码
67+
68+
```go
69+
package leetcode
70+
71+
func brokenCalc(X int, Y int) int {
72+
res := 0
73+
for Y > X {
74+
res++
75+
if Y&1 == 1 {
76+
Y++
77+
} else {
78+
Y /= 2
79+
}
80+
}
81+
return res + X - Y
82+
}
83+
```

website/content/ChapterFour/0900~0999/0990.Satisfiability-of-Equality-Equations.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,5 +102,5 @@ func equationsPossible(equations []string) bool {
102102
----------------------------------------------
103103
<div style="display: flex;justify-content: space-between;align-items: center;">
104104
<p><a href="https://books.halfrost.com/leetcode/ChapterFour/0900~0999/0989.Add-to-Array-Form-of-Integer/">⬅️上一页</a></p>
105-
<p><a href="https://books.halfrost.com/leetcode/ChapterFour/0900~0999/0992.Subarrays-with-K-Different-Integers/">下一页➡️</a></p>
105+
<p><a href="https://books.halfrost.com/leetcode/ChapterFour/0900~0999/0991.Broken-Calculator/">下一页➡️</a></p>
106106
</div>
Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
# [991. Broken Calculator](https://leetcode.com/problems/broken-calculator/)
2+
3+
4+
## 题目
5+
6+
On a broken calculator that has a number showing on its display, we can perform two operations:
7+
8+
- **Double**: Multiply the number on the display by 2, or;
9+
- **Decrement**: Subtract 1 from the number on the display.
10+
11+
Initially, the calculator is displaying the number `X`.
12+
13+
Return the minimum number of operations needed to display the number `Y`.
14+
15+
**Example 1:**
16+
17+
```
18+
Input: X = 2, Y = 3
19+
Output: 2
20+
Explanation: Use double operation and then decrement operation {2 -> 4 -> 3}.
21+
```
22+
23+
**Example 2:**
24+
25+
```
26+
Input: X = 5, Y = 8
27+
Output: 2
28+
Explanation: Use decrement and then double {5 -> 4 -> 8}.
29+
```
30+
31+
**Example 3:**
32+
33+
```
34+
Input: X = 3, Y = 10
35+
Output: 3
36+
Explanation: Use double, decrement and double {3 -> 6 -> 5 -> 10}.
37+
```
38+
39+
**Example 4:**
40+
41+
```
42+
Input: X = 1024, Y = 1
43+
Output: 1023
44+
Explanation: Use decrement operations 1023 times.
45+
```
46+
47+
**Note:**
48+
49+
1. `1 <= X <= 10^9`
50+
2. `1 <= Y <= 10^9`
51+
52+
## 题目大意
53+
54+
在显示着数字的坏计算器上,我们可以执行以下两种操作:
55+
56+
- 双倍(Double):将显示屏上的数字乘 2;
57+
- 递减(Decrement):将显示屏上的数字减 1 。
58+
59+
最初,计算器显示数字 X。返回显示数字 Y 所需的最小操作数。
60+
61+
## 解题思路
62+
63+
- 看到本题的数据规模非常大,`10^9`,算法只能采用 `O(sqrt(n))``O(log n)``O(1)` 的算法。`O(sqrt(n))``O(1)` 在本题中是不可能的。所以按照数据规模来估计,本题只能尝试 `O(log n)` 的算法。`O(log n)` 的算法有二分搜索,不过本题不太符合二分搜索算法背景。题目中明显出现乘 2,这很明显是可以达到 `O(log n)` 的。最终确定解题思路是数学方法,循环中会用到乘 2 或者除 2 的计算。
64+
- 既然出现了乘 2 和减一的操作,很容易考虑到奇偶性上。题目要求最小操作数,贪心思想,应该尽可能多的使用除 2 操作,使得 Y 和 X 大小差不多,最后再利用加一操作微调。只要 Y 比 X 大就执行除法操作。当然这里要考虑一次奇偶性,如果 Y 是奇数,先加一变成偶数再除二;如果 Y 是偶数,直接除二。如此操作直到 Y 不大于 X,最后执行 `X-Y` 次加法操作微调即可。
65+
66+
## 代码
67+
68+
```go
69+
package leetcode
70+
71+
func brokenCalc(X int, Y int) int {
72+
res := 0
73+
for Y > X {
74+
res++
75+
if Y&1 == 1 {
76+
Y++
77+
} else {
78+
Y /= 2
79+
}
80+
}
81+
return res + X - Y
82+
}
83+
```
84+
85+
86+
----------------------------------------------
87+
<div style="display: flex;justify-content: space-between;align-items: center;">
88+
<p><a href="https://books.halfrost.com/leetcode/ChapterFour/0900~0999/0990.Satisfiability-of-Equality-Equations/">⬅️上一页</a></p>
89+
<p><a href="https://books.halfrost.com/leetcode/ChapterFour/0900~0999/0992.Subarrays-with-K-Different-Integers/">下一页➡️</a></p>
90+
</div>

website/content/ChapterFour/0900~0999/0992.Subarrays-with-K-Different-Integers.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,6 @@ func subarraysWithKDistinctSlideWindow(A []int, K int) int {
115115

116116
----------------------------------------------
117117
<div style="display: flex;justify-content: space-between;align-items: center;">
118-
<p><a href="https://books.halfrost.com/leetcode/ChapterFour/0900~0999/0990.Satisfiability-of-Equality-Equations/">⬅️上一页</a></p>
118+
<p><a href="https://books.halfrost.com/leetcode/ChapterFour/0900~0999/0991.Broken-Calculator/">⬅️上一页</a></p>
119119
<p><a href="https://books.halfrost.com/leetcode/ChapterFour/0900~0999/0993.Cousins-in-Binary-Tree/">下一页➡️</a></p>
120120
</div>

website/content/ChapterTwo/Array.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,14 @@ weight: 1
1717
|0026|Remove Duplicates from Sorted Array|[Go]({{< relref "/ChapterFour/0001~0099/0026.Remove-Duplicates-from-Sorted-Array.md" >}})|Easy| O(n)| O(1)||46.6%|
1818
|0027|Remove Element|[Go]({{< relref "/ChapterFour/0001~0099/0027.Remove-Element.md" >}})|Easy| O(n)| O(1)||49.2%|
1919
|0031|Next Permutation|[Go]({{< relref "/ChapterFour/0001~0099/0031.Next-Permutation.md" >}})|Medium||||33.8%|
20-
|0033|Search in Rotated Sorted Array|[Go]({{< relref "/ChapterFour/0001~0099/0033.Search-in-Rotated-Sorted-Array.md" >}})|Medium||||35.8%|
20+
|0033|Search in Rotated Sorted Array|[Go]({{< relref "/ChapterFour/0001~0099/0033.Search-in-Rotated-Sorted-Array.md" >}})|Medium||||35.9%|
2121
|0034|Find First and Last Position of Element in Sorted Array|[Go]({{< relref "/ChapterFour/0001~0099/0034.Find-First-and-Last-Position-of-Element-in-Sorted-Array.md" >}})|Medium||||37.3%|
2222
|0035|Search Insert Position|[Go]({{< relref "/ChapterFour/0001~0099/0035.Search-Insert-Position.md" >}})|Easy||||42.8%|
2323
|0039|Combination Sum|[Go]({{< relref "/ChapterFour/0001~0099/0039.Combination-Sum.md" >}})|Medium| O(n log n)| O(n)||59.2%|
2424
|0040|Combination Sum II|[Go]({{< relref "/ChapterFour/0001~0099/0040.Combination-Sum-II.md" >}})|Medium| O(n log n)| O(n)||50.1%|
2525
|0041|First Missing Positive|[Go]({{< relref "/ChapterFour/0001~0099/0041.First-Missing-Positive.md" >}})|Hard| O(n)| O(n)||33.7%|
2626
|0042|Trapping Rain Water|[Go]({{< relref "/ChapterFour/0001~0099/0042.Trapping-Rain-Water.md" >}})|Hard| O(n)| O(1)|❤️|51.1%|
27-
|0048|Rotate Image|[Go]({{< relref "/ChapterFour/0001~0099/0048.Rotate-Image.md" >}})|Medium| O(n)| O(1)||59.8%|
27+
|0048|Rotate Image|[Go]({{< relref "/ChapterFour/0001~0099/0048.Rotate-Image.md" >}})|Medium| O(n)| O(1)||59.9%|
2828
|0053|Maximum Subarray|[Go]({{< relref "/ChapterFour/0001~0099/0053.Maximum-Subarray.md" >}})|Easy| O(n)| O(n)||47.7%|
2929
|0054|Spiral Matrix|[Go]({{< relref "/ChapterFour/0001~0099/0054.Spiral-Matrix.md" >}})|Medium| O(n)| O(n^2)||35.9%|
3030
|0055|Jump Game|[Go]({{< relref "/ChapterFour/0001~0099/0055.Jump-Game.md" >}})|Medium||||35.1%|
@@ -48,7 +48,7 @@ weight: 1
4848
|0106|Construct Binary Tree from Inorder and Postorder Traversal|[Go]({{< relref "/ChapterFour/0100~0199/0106.Construct-Binary-Tree-from-Inorder-and-Postorder-Traversal.md" >}})|Medium||||49.6%|
4949
|0118|Pascal's Triangle|[Go]({{< relref "/ChapterFour/0100~0199/0118.Pascals-Triangle.md" >}})|Easy||||54.8%|
5050
|0119|Pascal's Triangle II|[Go]({{< relref "/ChapterFour/0100~0199/0119.Pascals-Triangle-II.md" >}})|Easy||||52.1%|
51-
|0120|Triangle|[Go]({{< relref "/ChapterFour/0100~0199/0120.Triangle.md" >}})|Medium| O(n^2)| O(n)||45.7%|
51+
|0120|Triangle|[Go]({{< relref "/ChapterFour/0100~0199/0120.Triangle.md" >}})|Medium| O(n^2)| O(n)||45.8%|
5252
|0121|Best Time to Buy and Sell Stock|[Go]({{< relref "/ChapterFour/0100~0199/0121.Best-Time-to-Buy-and-Sell-Stock.md" >}})|Easy| O(n)| O(1)||51.5%|
5353
|0122|Best Time to Buy and Sell Stock II|[Go]({{< relref "/ChapterFour/0100~0199/0122.Best-Time-to-Buy-and-Sell-Stock-II.md" >}})|Easy| O(n)| O(1)||58.5%|
5454
|0126|Word Ladder II|[Go]({{< relref "/ChapterFour/0100~0199/0126.Word-Ladder-II.md" >}})|Hard| O(n)| O(n^2)|❤️|23.7%|
@@ -72,7 +72,7 @@ weight: 1
7272
|0414|Third Maximum Number|[Go]({{< relref "/ChapterFour/0400~0499/0414.Third-Maximum-Number.md" >}})|Easy||||30.7%|
7373
|0448|Find All Numbers Disappeared in an Array|[Go]({{< relref "/ChapterFour/0400~0499/0448.Find-All-Numbers-Disappeared-in-an-Array.md" >}})|Easy||||56.1%|
7474
|0457|Circular Array Loop|[Go]({{< relref "/ChapterFour/0400~0499/0457.Circular-Array-Loop.md" >}})|Medium||||30.1%|
75-
|0485|Max Consecutive Ones|[Go]({{< relref "/ChapterFour/0400~0499/0485.Max-Consecutive-Ones.md" >}})|Easy||||53.0%|
75+
|0485|Max Consecutive Ones|[Go]({{< relref "/ChapterFour/0400~0499/0485.Max-Consecutive-Ones.md" >}})|Easy||||52.9%|
7676
|0509|Fibonacci Number|[Go]({{< relref "/ChapterFour/0500~0599/0509.Fibonacci-Number.md" >}})|Easy||||67.4%|
7777
|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.2%|
7878
|0561|Array Partition I|[Go]({{< relref "/ChapterFour/0500~0599/0561.Array-Partition-I.md" >}})|Easy||||73.2%|
@@ -89,7 +89,7 @@ weight: 1
8989
|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%|
9090
|0717|1-bit and 2-bit Characters|[Go]({{< relref "/ChapterFour/0700~0799/0717.1-bit-and-2-bit-Characters.md" >}})|Easy||||47.3%|
9191
|0718|Maximum Length of Repeated Subarray|[Go]({{< relref "/ChapterFour/0700~0799/0718.Maximum-Length-of-Repeated-Subarray.md" >}})|Medium||||50.3%|
92-
|0719|Find K-th Smallest Pair Distance|[Go]({{< relref "/ChapterFour/0700~0799/0719.Find-K-th-Smallest-Pair-Distance.md" >}})|Hard||||32.5%|
92+
|0719|Find K-th Smallest Pair Distance|[Go]({{< relref "/ChapterFour/0700~0799/0719.Find-K-th-Smallest-Pair-Distance.md" >}})|Hard||||32.6%|
9393
|0724|Find Pivot Index|[Go]({{< relref "/ChapterFour/0700~0799/0724.Find-Pivot-Index.md" >}})|Easy||||45.4%|
9494
|0729|My Calendar I|[Go]({{< relref "/ChapterFour/0700~0799/0729.My-Calendar-I.md" >}})|Medium||||53.3%|
9595
|0746|Min Cost Climbing Stairs|[Go]({{< relref "/ChapterFour/0700~0799/0746.Min-Cost-Climbing-Stairs.md" >}})|Easy| O(n)| O(1)||50.9%|
@@ -114,7 +114,7 @@ weight: 1
114114
|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%|
115115
|1018|Binary Prefix Divisible By 5|[Go]({{< relref "/ChapterFour/1000~1099/1018.Binary-Prefix-Divisible-By-5.md" >}})|Easy||||47.8%|
116116
|1040|Moving Stones Until Consecutive II|[Go]({{< relref "/ChapterFour/1000~1099/1040.Moving-Stones-Until-Consecutive-II.md" >}})|Medium||||54.1%|
117-
|1051|Height Checker|[Go]({{< relref "/ChapterFour/1000~1099/1051.Height-Checker.md" >}})|Easy||||72.2%|
117+
|1051|Height Checker|[Go]({{< relref "/ChapterFour/1000~1099/1051.Height-Checker.md" >}})|Easy||||72.1%|
118118
|1052|Grumpy Bookstore Owner|[Go]({{< relref "/ChapterFour/1000~1099/1052.Grumpy-Bookstore-Owner.md" >}})|Medium||||55.8%|
119119
|1074|Number of Submatrices That Sum to Target|[Go]({{< relref "/ChapterFour/1000~1099/1074.Number-of-Submatrices-That-Sum-to-Target.md" >}})|Hard||||61.7%|
120120
|1089|Duplicate Zeros|[Go]({{< relref "/ChapterFour/1000~1099/1089.Duplicate-Zeros.md" >}})|Easy||||51.9%|
@@ -140,11 +140,11 @@ weight: 1
140140
|1300|Sum of Mutated Array Closest to Target|[Go]({{< relref "/ChapterFour/1300~1399/1300.Sum-of-Mutated-Array-Closest-to-Target.md" >}})|Medium||||43.0%|
141141
|1304|Find N Unique Integers Sum up to Zero|[Go]({{< relref "/ChapterFour/1300~1399/1304.Find-N-Unique-Integers-Sum-up-to-Zero.md" >}})|Easy||||76.9%|
142142
|1313|Decompress Run-Length Encoded List|[Go]({{< relref "/ChapterFour/1300~1399/1313.Decompress-Run-Length-Encoded-List.md" >}})|Easy||||85.4%|
143-
|1329|Sort the Matrix Diagonally|[Go]({{< relref "/ChapterFour/1300~1399/1329.Sort-the-Matrix-Diagonally.md" >}})|Medium||||81.8%|
143+
|1329|Sort the Matrix Diagonally|[Go]({{< relref "/ChapterFour/1300~1399/1329.Sort-the-Matrix-Diagonally.md" >}})|Medium||||81.7%|
144144
|1337|The K Weakest Rows in a Matrix|[Go]({{< relref "/ChapterFour/1300~1399/1337.The-K-Weakest-Rows-in-a-Matrix.md" >}})|Easy||||72.1%|
145145
|1380|Lucky Numbers in a Matrix|[Go]({{< relref "/ChapterFour/1300~1399/1380.Lucky-Numbers-in-a-Matrix.md" >}})|Easy||||70.8%|
146146
|1385|Find the Distance Value Between Two Arrays|[Go]({{< relref "/ChapterFour/1300~1399/1385.Find-the-Distance-Value-Between-Two-Arrays.md" >}})|Easy||||66.4%|
147-
|1389|Create Target Array in the Given Order|[Go]({{< relref "/ChapterFour/1300~1399/1389.Create-Target-Array-in-the-Given-Order.md" >}})|Easy||||84.7%|
147+
|1389|Create Target Array in the Given Order|[Go]({{< relref "/ChapterFour/1300~1399/1389.Create-Target-Array-in-the-Given-Order.md" >}})|Easy||||84.8%|
148148
|1423|Maximum Points You Can Obtain from Cards|[Go]({{< relref "/ChapterFour/1400~1499/1423.Maximum-Points-You-Can-Obtain-from-Cards.md" >}})|Medium||||46.6%|
149149
|1437|Check If All 1's Are at Least Length K Places Away|[Go]({{< relref "/ChapterFour/1400~1499/1437.Check-If-All-1s-Are-at-Least-Length-K-Places-Away.md" >}})|Easy||||62.6%|
150150
|1438|Longest Continuous Subarray With Absolute Diff Less Than or Equal to Limit|[Go]({{< relref "/ChapterFour/1400~1499/1438.Longest-Continuous-Subarray-With-Absolute-Diff-Less-Than-or-Equal-to-Limit.md" >}})|Medium||||44.3%|
@@ -157,16 +157,16 @@ weight: 1
157157
|1619|Mean of Array After Removing Some Elements|[Go]({{< relref "/ChapterFour/1600~1699/1619.Mean-of-Array-After-Removing-Some-Elements.md" >}})|Easy||||65.2%|
158158
|1629|Slowest Key|[Go]({{< relref "/ChapterFour/1600~1699/1629.Slowest-Key.md" >}})|Easy||||59.2%|
159159
|1636|Sort Array by Increasing Frequency|[Go]({{< relref "/ChapterFour/1600~1699/1636.Sort-Array-by-Increasing-Frequency.md" >}})|Easy||||66.8%|
160-
|1640|Check Array Formation Through Concatenation|[Go]({{< relref "/ChapterFour/1600~1699/1640.Check-Array-Formation-Through-Concatenation.md" >}})|Easy||||60.1%|
160+
|1640|Check Array Formation Through Concatenation|[Go]({{< relref "/ChapterFour/1600~1699/1640.Check-Array-Formation-Through-Concatenation.md" >}})|Easy||||60.0%|
161161
|1646|Get Maximum in Generated Array|[Go]({{< relref "/ChapterFour/1600~1699/1646.Get-Maximum-in-Generated-Array.md" >}})|Easy||||53.4%|
162162
|1652|Defuse the Bomb|[Go]({{< relref "/ChapterFour/1600~1699/1652.Defuse-the-Bomb.md" >}})|Easy||||62.9%|
163163
|1656|Design an Ordered Stream|[Go]({{< relref "/ChapterFour/1600~1699/1656.Design-an-Ordered-Stream.md" >}})|Easy||||82.3%|
164164
|1672|Richest Customer Wealth|[Go]({{< relref "/ChapterFour/1600~1699/1672.Richest-Customer-Wealth.md" >}})|Easy||||88.3%|
165165
|1700|Number of Students Unable to Eat Lunch|[Go]({{< relref "/ChapterFour/1700~1799/1700.Number-of-Students-Unable-to-Eat-Lunch.md" >}})|Easy||||68.7%|
166166
|1732|Find the Highest Altitude|[Go]({{< relref "/ChapterFour/1700~1799/1732.Find-the-Highest-Altitude.md" >}})|Easy||||81.4%|
167167
|1742|Maximum Number of Balls in a Box|[Go]({{< relref "/ChapterFour/1700~1799/1742.Maximum-Number-of-Balls-in-a-Box.md" >}})|Easy||||74.9%|
168-
|1748|Sum of Unique Elements|[Go]({{< relref "/ChapterFour/1700~1799/1748.Sum-of-Unique-Elements.md" >}})|Easy||||77.0%|
169-
|1752|Check if Array Is Sorted and Rotated|[Go]({{< relref "/ChapterFour/1700~1799/1752.Check-if-Array-Is-Sorted-and-Rotated.md" >}})|Easy||||66.4%|
168+
|1748|Sum of Unique Elements|[Go]({{< relref "/ChapterFour/1700~1799/1748.Sum-of-Unique-Elements.md" >}})|Easy||||76.9%|
169+
|1752|Check if Array Is Sorted and Rotated|[Go]({{< relref "/ChapterFour/1700~1799/1752.Check-if-Array-Is-Sorted-and-Rotated.md" >}})|Easy||||66.3%|
170170
|1758|Minimum Changes To Make Alternating Binary String|[Go]({{< relref "/ChapterFour/1700~1799/1758.Minimum-Changes-To-Make-Alternating-Binary-String.md" >}})|Easy||||59.5%|
171171
|------------|-------------------------------------------------------|-------| ----------------| ---------------|-------------|-------------|-------------|
172172

0 commit comments

Comments
 (0)