Skip to content

Commit 1172edf

Browse files
committedOct 1, 2021
feat: add solutions to lcof2 problem: No.073.Koko Eating Bananas
1 parent 83afc09 commit 1172edf

File tree

16 files changed

+607
-44
lines changed

16 files changed

+607
-44
lines changed
 

‎lcof2/剑指 Offer II 073. 狒狒吃香蕉/README.md

+114-1
Original file line numberDiff line numberDiff line change
@@ -57,22 +57,135 @@
5757

5858
<!-- 这里可写通用的实现逻辑 -->
5959

60+
二分查找。
61+
6062
<!-- tabs:start -->
6163

6264
### **Python3**
6365

6466
<!-- 这里可写当前语言的特殊实现逻辑 -->
6567

6668
```python
67-
69+
class Solution:
70+
def minEatingSpeed(self, piles: List[int], h: int) -> int:
71+
left, right = 1, max(piles)
72+
while left < right:
73+
mid = (left + right) >> 1
74+
s = sum((pile + mid - 1) // mid for pile in piles)
75+
if s <= h:
76+
right = mid
77+
else:
78+
left = mid + 1
79+
return left
6880
```
6981

7082
### **Java**
7183

7284
<!-- 这里可写当前语言的特殊实现逻辑 -->
7385

7486
```java
87+
class Solution {
88+
public int minEatingSpeed(int[] piles, int h) {
89+
int mx = 0;
90+
for (int pile : piles) {
91+
mx = Math.max(mx, pile);
92+
}
93+
int left = 1, right = mx;
94+
while (left < right) {
95+
int mid = (left + right) >>> 1;
96+
int s = 0;
97+
for (int pile : piles) {
98+
s += (pile + mid - 1) / mid;
99+
}
100+
if (s <= h) {
101+
right = mid;
102+
} else {
103+
left = mid + 1;
104+
}
105+
}
106+
return left;
107+
}
108+
}
109+
```
110+
111+
### **C++**
112+
113+
```cpp
114+
class Solution {
115+
public:
116+
int minEatingSpeed(vector<int>& piles, int h) {
117+
int left = 1, right = *max_element(piles.begin(), piles.end());
118+
while (left < right)
119+
{
120+
int mid = left + right >> 1;
121+
int s = 0;
122+
for (int pile : piles) s += (pile + mid - 1) / mid;
123+
if (s <= h) right = mid;
124+
else left = mid + 1;
125+
}
126+
return left;
127+
}
128+
};
129+
```
130+
131+
### **Go**
132+
133+
```go
134+
func minEatingSpeed(piles []int, h int) int {
135+
mx := 0
136+
for _, pile := range piles {
137+
mx = max(mx, pile)
138+
}
139+
left, right := 1, mx
140+
for left < right {
141+
mid := (left + right) >> 1
142+
s := 0
143+
for _, pile := range piles {
144+
s += (pile + mid - 1) / mid
145+
}
146+
if s <= h {
147+
right = mid
148+
} else {
149+
left = mid + 1
150+
}
151+
}
152+
return left
153+
}
154+
155+
func max(a, b int) int {
156+
if a > b {
157+
return a
158+
}
159+
return b
160+
}
161+
```
75162

163+
### **C#**
164+
165+
```cs
166+
public class Solution {
167+
public int MinEatingSpeed(int[] piles, int h) {
168+
int left = 1, right = piles.Max();
169+
while (left < right)
170+
{
171+
int mid = (left + right) >> 1;
172+
int s = 0;
173+
foreach (int pile in piles)
174+
{
175+
s += (pile + mid - 1) / mid;
176+
}
177+
if (s <= h)
178+
{
179+
right = mid;
180+
}
181+
else
182+
{
183+
left = mid + 1;
184+
}
185+
}
186+
return left;
187+
}
188+
}
76189
```
77190

78191
### **...**
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
class Solution {
2+
public:
3+
int minEatingSpeed(vector<int>& piles, int h) {
4+
int left = 1, right = *max_element(piles.begin(), piles.end());
5+
while (left < right)
6+
{
7+
int mid = left + right >> 1;
8+
int s = 0;
9+
for (int pile : piles) s += (pile + mid - 1) / mid;
10+
if (s <= h) right = mid;
11+
else left = mid + 1;
12+
}
13+
return left;
14+
}
15+
};
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
public class Solution {
2+
public int MinEatingSpeed(int[] piles, int h) {
3+
int left = 1, right = piles.Max();
4+
while (left < right)
5+
{
6+
int mid = (left + right) >> 1;
7+
int s = 0;
8+
foreach (int pile in piles)
9+
{
10+
s += (pile + mid - 1) / mid;
11+
}
12+
if (s <= h)
13+
{
14+
right = mid;
15+
}
16+
else
17+
{
18+
left = mid + 1;
19+
}
20+
}
21+
return left;
22+
}
23+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
func minEatingSpeed(piles []int, h int) int {
2+
mx := 0
3+
for _, pile := range piles {
4+
mx = max(mx, pile)
5+
}
6+
left, right := 1, mx
7+
for left < right {
8+
mid := (left + right) >> 1
9+
s := 0
10+
for _, pile := range piles {
11+
s += (pile + mid - 1) / mid
12+
}
13+
if s <= h {
14+
right = mid
15+
} else {
16+
left = mid + 1
17+
}
18+
}
19+
return left
20+
}
21+
22+
func max(a, b int) int {
23+
if a > b {
24+
return a
25+
}
26+
return b
27+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
class Solution {
2+
public int minEatingSpeed(int[] piles, int h) {
3+
int mx = 0;
4+
for (int pile : piles) {
5+
mx = Math.max(mx, pile);
6+
}
7+
int left = 1, right = mx;
8+
while (left < right) {
9+
int mid = (left + right) >>> 1;
10+
int s = 0;
11+
for (int pile : piles) {
12+
s += (pile + mid - 1) / mid;
13+
}
14+
if (s <= h) {
15+
right = mid;
16+
} else {
17+
left = mid + 1;
18+
}
19+
}
20+
return left;
21+
}
22+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
class Solution:
2+
def minEatingSpeed(self, piles: List[int], h: int) -> int:
3+
left, right = 1, max(piles)
4+
while left < right:
5+
mid = (left + right) >> 1
6+
s = sum([(pile + mid - 1) // mid for pile in piles])
7+
if s <= h:
8+
right = mid
9+
else:
10+
left = mid + 1
11+
return left

‎solution/0800-0899/0875.Koko Eating Bananas/README.md

+7-15
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ class Solution:
6666
left, right = 1, max(piles)
6767
while left < right:
6868
mid = (left + right) >> 1
69-
s = sum([(pile + mid - 1) // mid for pile in piles])
69+
s = sum((pile + mid - 1) // mid for pile in piles)
7070
if s <= h:
7171
right = mid
7272
else:
@@ -109,22 +109,14 @@ class Solution {
109109
class Solution {
110110
public:
111111
int minEatingSpeed(vector<int>& piles, int h) {
112-
int mx = 0;
113-
for (auto pile : piles) {
114-
mx = max(mx, pile);
115-
}
116-
int left = 1, right = mx;
117-
while (left < right) {
112+
int left = 1, right = *max_element(piles.begin(), piles.end());
113+
while (left < right)
114+
{
118115
int mid = left + right >> 1;
119116
int s = 0;
120-
for (auto pile : piles) {
121-
s += (pile + mid - 1) / mid;
122-
}
123-
if (s <= h) {
124-
right = mid;
125-
} else {
126-
left = mid + 1;
127-
}
117+
for (int pile : piles) s += (pile + mid - 1) / mid;
118+
if (s <= h) right = mid;
119+
else left = mid + 1;
128120
}
129121
return left;
130122
}

‎solution/0800-0899/0875.Koko Eating Bananas/README_EN.md

+6-14
Original file line numberDiff line numberDiff line change
@@ -99,22 +99,14 @@ class Solution {
9999
class Solution {
100100
public:
101101
int minEatingSpeed(vector<int>& piles, int h) {
102-
int mx = 0;
103-
for (auto pile : piles) {
104-
mx = max(mx, pile);
105-
}
106-
int left = 1, right = mx;
107-
while (left < right) {
102+
int left = 1, right = *max_element(piles.begin(), piles.end());
103+
while (left < right)
104+
{
108105
int mid = left + right >> 1;
109106
int s = 0;
110-
for (auto pile : piles) {
111-
s += (pile + mid - 1) / mid;
112-
}
113-
if (s <= h) {
114-
right = mid;
115-
} else {
116-
left = mid + 1;
117-
}
107+
for (int pile : piles) s += (pile + mid - 1) / mid;
108+
if (s <= h) right = mid;
109+
else left = mid + 1;
118110
}
119111
return left;
120112
}

‎solution/0800-0899/0875.Koko Eating Bananas/Solution.cpp

+6-14
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,14 @@
11
class Solution {
22
public:
33
int minEatingSpeed(vector<int>& piles, int h) {
4-
int mx = 0;
5-
for (auto pile : piles) {
6-
mx = max(mx, pile);
7-
}
8-
int left = 1, right = mx;
9-
while (left < right) {
4+
int left = 1, right = *max_element(piles.begin(), piles.end());
5+
while (left < right)
6+
{
107
int mid = left + right >> 1;
118
int s = 0;
12-
for (auto pile : piles) {
13-
s += (pile + mid - 1) / mid;
14-
}
15-
if (s <= h) {
16-
right = mid;
17-
} else {
18-
left = mid + 1;
19-
}
9+
for (int pile : piles) s += (pile + mid - 1) / mid;
10+
if (s <= h) right = mid;
11+
else left = mid + 1;
2012
}
2113
return left;
2214
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
# [2020. Number of Accounts That Did Not Stream](https://leetcode-cn.com/problems/number-of-accounts-that-did-not-stream)
2+
3+
[English Version](/solution/2000-2099/2020.Number%20of%20Accounts%20That%20Did%20Not%20Stream/README_EN.md)
4+
5+
## 题目描述
6+
7+
<!-- 这里写题目描述 -->
8+
9+
<p>Table: <code>Subscriptions</code></p>
10+
11+
<pre>
12+
+-------------+------+
13+
| Column Name | Type |
14+
+-------------+------+
15+
| account_id | int |
16+
| start_date | date |
17+
| end_date | date |
18+
+-------------+------+
19+
account_id is the primary key column for this table.
20+
Each row of this table indicates the start and end dates of an account&#39;s subscription.
21+
Note that always start_date &lt; end_date.
22+
</pre>
23+
24+
<p>&nbsp;</p>
25+
26+
<p>Table: <code>Streams</code></p>
27+
28+
<pre>
29+
+-------------+------+
30+
| Column Name | Type |
31+
+-------------+------+
32+
| session_id | int |
33+
| account_id | int |
34+
| stream_date | date |
35+
+-------------+------+
36+
session_id is the primary key column for this table.
37+
account_id is a foreign key from the Subscriptions table.
38+
Each row of this table contains information about the account and the date associated with a stream session.
39+
</pre>
40+
41+
<p>&nbsp;</p>
42+
43+
<p>Write an SQL query to report the number of accounts that bought a subscription in <code>2021</code> but did not have any stream session.</p>
44+
45+
<p>The query result format is in the following example.</p>
46+
47+
<p>&nbsp;</p>
48+
<p><strong>Example 1:</strong></p>
49+
50+
<pre>
51+
<strong>Input:</strong>
52+
Subscription table:
53+
+------------+------------+------------+
54+
| account_id | start_date | end_date |
55+
+------------+------------+------------+
56+
| 9 | 2020-02-18 | 2021-10-30 |
57+
| 3 | 2021-09-21 | 2021-11-13 |
58+
| 11 | 2020-02-28 | 2020-08-18 |
59+
| 13 | 2021-04-20 | 2021-09-22 |
60+
| 4 | 2020-10-26 | 2021-05-08 |
61+
| 5 | 2020-09-11 | 2021-01-17 |
62+
+------------+------------+------------+
63+
Streams table:
64+
+------------+------------+-------------+
65+
| session_id | account_id | stream_date |
66+
+------------+------------+-------------+
67+
| 14 | 9 | 2020-05-16 |
68+
| 16 | 3 | 2021-10-27 |
69+
| 18 | 11 | 2020-04-29 |
70+
| 17 | 13 | 2021-08-08 |
71+
| 19 | 4 | 2020-12-31 |
72+
| 13 | 5 | 2021-01-05 |
73+
+------------+------------+-------------+
74+
<strong>Output:</strong>
75+
+----------------+
76+
| accounts_count |
77+
+----------------+
78+
| 2 |
79+
+----------------+
80+
<strong>Explanation:</strong> Users 4 and 9 did not stream in 2021.
81+
User 11 did not subscribe in 2021.
82+
</pre>
83+
84+
## 解法
85+
86+
<!-- 这里可写通用的实现逻辑 -->
87+
88+
<!-- tabs:start -->
89+
90+
### **SQL**
91+
92+
<!-- 这里可写当前语言的特殊实现逻辑 -->
93+
94+
```sql
95+
96+
```
97+
98+
<!-- tabs:end -->
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
# [2020. Number of Accounts That Did Not Stream](https://leetcode.com/problems/number-of-accounts-that-did-not-stream)
2+
3+
[中文文档](/solution/2000-2099/2020.Number%20of%20Accounts%20That%20Did%20Not%20Stream/README.md)
4+
5+
## Description
6+
7+
<p>Table: <code>Subscriptions</code></p>
8+
9+
<pre>
10+
+-------------+------+
11+
| Column Name | Type |
12+
+-------------+------+
13+
| account_id | int |
14+
| start_date | date |
15+
| end_date | date |
16+
+-------------+------+
17+
account_id is the primary key column for this table.
18+
Each row of this table indicates the start and end dates of an account&#39;s subscription.
19+
Note that always start_date &lt; end_date.
20+
</pre>
21+
22+
<p>&nbsp;</p>
23+
24+
<p>Table: <code>Streams</code></p>
25+
26+
<pre>
27+
+-------------+------+
28+
| Column Name | Type |
29+
+-------------+------+
30+
| session_id | int |
31+
| account_id | int |
32+
| stream_date | date |
33+
+-------------+------+
34+
session_id is the primary key column for this table.
35+
account_id is a foreign key from the Subscriptions table.
36+
Each row of this table contains information about the account and the date associated with a stream session.
37+
</pre>
38+
39+
<p>&nbsp;</p>
40+
41+
<p>Write an SQL query to report the number of accounts that bought a subscription in <code>2021</code> but did not have any stream session.</p>
42+
43+
<p>The query result format is in the following example.</p>
44+
45+
<p>&nbsp;</p>
46+
<p><strong>Example 1:</strong></p>
47+
48+
<pre>
49+
<strong>Input:</strong>
50+
Subscription table:
51+
+------------+------------+------------+
52+
| account_id | start_date | end_date |
53+
+------------+------------+------------+
54+
| 9 | 2020-02-18 | 2021-10-30 |
55+
| 3 | 2021-09-21 | 2021-11-13 |
56+
| 11 | 2020-02-28 | 2020-08-18 |
57+
| 13 | 2021-04-20 | 2021-09-22 |
58+
| 4 | 2020-10-26 | 2021-05-08 |
59+
| 5 | 2020-09-11 | 2021-01-17 |
60+
+------------+------------+------------+
61+
Streams table:
62+
+------------+------------+-------------+
63+
| session_id | account_id | stream_date |
64+
+------------+------------+-------------+
65+
| 14 | 9 | 2020-05-16 |
66+
| 16 | 3 | 2021-10-27 |
67+
| 18 | 11 | 2020-04-29 |
68+
| 17 | 13 | 2021-08-08 |
69+
| 19 | 4 | 2020-12-31 |
70+
| 13 | 5 | 2021-01-05 |
71+
+------------+------------+-------------+
72+
<strong>Output:</strong>
73+
+----------------+
74+
| accounts_count |
75+
+----------------+
76+
| 2 |
77+
+----------------+
78+
<strong>Explanation:</strong> Users 4 and 9 did not stream in 2021.
79+
User 11 did not subscribe in 2021.
80+
</pre>
81+
82+
## Solutions
83+
84+
<!-- tabs:start -->
85+
86+
### **SQL**
87+
88+
```sql
89+
90+
```
91+
92+
<!-- tabs:end -->
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
# [2021. Brightest Position on Street](https://leetcode-cn.com/problems/brightest-position-on-street)
2+
3+
[English Version](/solution/2000-2099/2021.Brightest%20Position%20on%20Street/README_EN.md)
4+
5+
## 题目描述
6+
7+
<!-- 这里写题目描述 -->
8+
9+
<p>A perfectly straight street is represented by a number line. The street has street lamp(s) on it and is represented by a 2D integer array <code>lights</code>. Each <code>lights[i] = [position<sub>i</sub>, range<sub>i</sub>]</code> indicates that there is a street lamp at position <code>position<sub>i</sub></code> that lights up the area from <code>[position<sub>i</sub> - range<sub>i</sub>, position<sub>i</sub> + range<sub>i</sub>]</code> (<strong>inclusive</strong>).</p>
10+
11+
<p>The <strong>brightness</strong> of a position <code>p</code> is defined as the number of street lamp that light up the position <code>p</code>.</p>
12+
13+
<p>Given <code>lights</code>, return <em>the <strong>brightest</strong> position on the</em><em> street. If there are multiple brightest positions, return the <strong>smallest</strong> one.</em></p>
14+
15+
<p>&nbsp;</p>
16+
<p><strong>Example 1:</strong></p>
17+
<img src="https://cdn.jsdelivr.net/gh/doocs/leetcode@main/solution/2000-2099/2021.Brightest%20Position%20on%20Street/images/image-20210928155140-1.png" style="width: 700px; height: 165px;" />
18+
<pre>
19+
<strong>Input:</strong> lights = [[-3,2],[1,2],[3,3]]
20+
<strong>Output:</strong> -1
21+
<strong>Explanation:</strong>
22+
The first street lamp lights up the area from [(-3) - 2, (-3) + 2] = [-5, -1].
23+
The second street lamp lights up the area from [1 - 2, 1 + 2] = [-1, 3].
24+
The third street lamp lights up the area from [3 - 3, 3 + 3] = [0, 6].
25+
26+
Position -1 has a brightness of 2, illuminated by the first and second street light.
27+
Positions 0, 1, 2, and 3 have a brightness of 2, illuminated by the second and third street light.
28+
Out of all these positions, -1 is the smallest, so return it.
29+
</pre>
30+
31+
<p><strong>Example 2:</strong></p>
32+
33+
<pre>
34+
<strong>Input:</strong> lights = [[1,0],[0,1]]
35+
<strong>Output:</strong> 1
36+
<strong>Explanation:</strong>
37+
The first street lamp lights up the area from [1 - 0, 1 + 0] = [1, 1].
38+
The second street lamp lights up the area from [0 - 1, 0 + 1] = [-1, 1].
39+
40+
Position 1 has a brightness of 2, illuminated by the first and second street light.
41+
Return 1 because it is the brightest position on the street.
42+
</pre>
43+
44+
<p><strong>Example 3:</strong></p>
45+
46+
<pre>
47+
<strong>Input:</strong> lights = [[1,2]]
48+
<strong>Output:</strong> -1
49+
<strong>Explanation:</strong>
50+
The first street lamp lights up the area from [1 - 2, 1 + 2] = [-1, 3].
51+
52+
Positions -1, 0, 1, 2, and 3 have a brightness of 1, illuminated by the first street light.
53+
Out of all these positions, -1 is the smallest, so return it.
54+
</pre>
55+
56+
<p>&nbsp;</p>
57+
<p><strong>Constraints:</strong></p>
58+
59+
<ul>
60+
<li><code>1 &lt;= lights.length &lt;= 10<sup>5</sup></code></li>
61+
<li><code>lights[i].length == 2</code></li>
62+
<li><code>-10<sup>8</sup> &lt;= position<sub>i</sub> &lt;= 10<sup>8</sup></code></li>
63+
<li><code>0 &lt;= range<sub>i</sub> &lt;= 10<sup>8</sup></code></li>
64+
</ul>
65+
66+
67+
## 解法
68+
69+
<!-- 这里可写通用的实现逻辑 -->
70+
71+
<!-- tabs:start -->
72+
73+
### **Python3**
74+
75+
<!-- 这里可写当前语言的特殊实现逻辑 -->
76+
77+
```python
78+
79+
```
80+
81+
### **Java**
82+
83+
<!-- 这里可写当前语言的特殊实现逻辑 -->
84+
85+
```java
86+
87+
```
88+
89+
### **...**
90+
91+
```
92+
93+
```
94+
95+
<!-- tabs:end -->
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
# [2021. Brightest Position on Street](https://leetcode.com/problems/brightest-position-on-street)
2+
3+
[中文文档](/solution/2000-2099/2021.Brightest%20Position%20on%20Street/README.md)
4+
5+
## Description
6+
7+
<p>A perfectly straight street is represented by a number line. The street has street lamp(s) on it and is represented by a 2D integer array <code>lights</code>. Each <code>lights[i] = [position<sub>i</sub>, range<sub>i</sub>]</code> indicates that there is a street lamp at position <code>position<sub>i</sub></code> that lights up the area from <code>[position<sub>i</sub> - range<sub>i</sub>, position<sub>i</sub> + range<sub>i</sub>]</code> (<strong>inclusive</strong>).</p>
8+
9+
<p>The <strong>brightness</strong> of a position <code>p</code> is defined as the number of street lamp that light up the position <code>p</code>.</p>
10+
11+
<p>Given <code>lights</code>, return <em>the <strong>brightest</strong> position on the</em><em> street. If there are multiple brightest positions, return the <strong>smallest</strong> one.</em></p>
12+
13+
<p>&nbsp;</p>
14+
<p><strong>Example 1:</strong></p>
15+
<img src="https://cdn.jsdelivr.net/gh/doocs/leetcode@main/solution/2000-2099/2021.Brightest%20Position%20on%20Street/images/image-20210928155140-1.png" style="width: 700px; height: 165px;" />
16+
<pre>
17+
<strong>Input:</strong> lights = [[-3,2],[1,2],[3,3]]
18+
<strong>Output:</strong> -1
19+
<strong>Explanation:</strong>
20+
The first street lamp lights up the area from [(-3) - 2, (-3) + 2] = [-5, -1].
21+
The second street lamp lights up the area from [1 - 2, 1 + 2] = [-1, 3].
22+
The third street lamp lights up the area from [3 - 3, 3 + 3] = [0, 6].
23+
24+
Position -1 has a brightness of 2, illuminated by the first and second street light.
25+
Positions 0, 1, 2, and 3 have a brightness of 2, illuminated by the second and third street light.
26+
Out of all these positions, -1 is the smallest, so return it.
27+
28+
</pre>
29+
30+
<p><strong>Example 2:</strong></p>
31+
32+
<pre>
33+
<strong>Input:</strong> lights = [[1,0],[0,1]]
34+
<strong>Output:</strong> 1
35+
<strong>Explanation:</strong>
36+
The first street lamp lights up the area from [1 - 0, 1 + 0] = [1, 1].
37+
The second street lamp lights up the area from [0 - 1, 0 + 1] = [-1, 1].
38+
39+
Position 1 has a brightness of 2, illuminated by the first and second street light.
40+
Return 1 because it is the brightest position on the street.
41+
</pre>
42+
43+
<p><strong>Example 3:</strong></p>
44+
45+
<pre>
46+
<strong>Input:</strong> lights = [[1,2]]
47+
<strong>Output:</strong> -1
48+
<strong>Explanation:</strong>
49+
The first street lamp lights up the area from [1 - 2, 1 + 2] = [-1, 3].
50+
51+
Positions -1, 0, 1, 2, and 3 have a brightness of 1, illuminated by the first street light.
52+
Out of all these positions, -1 is the smallest, so return it.
53+
</pre>
54+
55+
<p>&nbsp;</p>
56+
<p><strong>Constraints:</strong></p>
57+
58+
<ul>
59+
<li><code>1 &lt;= lights.length &lt;= 10<sup>5</sup></code></li>
60+
<li><code>lights[i].length == 2</code></li>
61+
<li><code>-10<sup>8</sup> &lt;= position<sub>i</sub> &lt;= 10<sup>8</sup></code></li>
62+
<li><code>0 &lt;= range<sub>i</sub> &lt;= 10<sup>8</sup></code></li>
63+
</ul>
64+
65+
## Solutions
66+
67+
<!-- tabs:start -->
68+
69+
### **Python3**
70+
71+
```python
72+
73+
```
74+
75+
### **Java**
76+
77+
```java
78+
79+
```
80+
81+
### **...**
82+
83+
```
84+
85+
```
86+
87+
<!-- tabs:end -->
Loading

‎solution/summary.md

+2
Original file line numberDiff line numberDiff line change
@@ -2060,3 +2060,5 @@
20602060
- [2017.Grid Game](/solution/2000-2099/2017.Grid%20Game/README.md)
20612061
- [2018.Check if Word Can Be Placed In Crossword](/solution/2000-2099/2018.Check%20if%20Word%20Can%20Be%20Placed%20In%20Crossword/README.md)
20622062
- [2019.The Score of Students Solving Math Expression](/solution/2000-2099/2019.The%20Score%20of%20Students%20Solving%20Math%20Expression/README.md)
2063+
- [2020.Number of Accounts That Did Not Stream](/solution/2000-2099/2020.Number%20of%20Accounts%20That%20Did%20Not%20Stream/README.md)
2064+
- [2021.Brightest Position on Street](/solution/2000-2099/2021.Brightest%20Position%20on%20Street/README.md)

‎solution/summary_en.md

+2
Original file line numberDiff line numberDiff line change
@@ -2060,3 +2060,5 @@
20602060
- [2017.Grid Game](/solution/2000-2099/2017.Grid%20Game/README_EN.md)
20612061
- [2018.Check if Word Can Be Placed In Crossword](/solution/2000-2099/2018.Check%20if%20Word%20Can%20Be%20Placed%20In%20Crossword/README_EN.md)
20622062
- [2019.The Score of Students Solving Math Expression](/solution/2000-2099/2019.The%20Score%20of%20Students%20Solving%20Math%20Expression/README_EN.md)
2063+
- [2020.Number of Accounts That Did Not Stream](/solution/2000-2099/2020.Number%20of%20Accounts%20That%20Did%20Not%20Stream/README_EN.md)
2064+
- [2021.Brightest Position on Street](/solution/2000-2099/2021.Brightest%20Position%20on%20Street/README_EN.md)

0 commit comments

Comments
 (0)
Please sign in to comment.