Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 96e5023

Browse files
feat: add weekly contest 422 (doocs#3706)
1 parent 7c00420 commit 96e5023

File tree

29 files changed

+1118
-58
lines changed

29 files changed

+1118
-58
lines changed

‎solution/0000-0099/0008.String to Integer (atoi)/README_EN.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ tags:
2222

2323
<ol>
2424
<li><strong>Whitespace</strong>: Ignore any leading whitespace (<code>&quot; &quot;</code>).</li>
25-
<li><strong>Signedness</strong>: Determine the sign by checking if the next character is <code>&#39;-&#39;</code> or <code>&#39;+&#39;</code>, assuming positivity is neither present.</li>
25+
<li><strong>Signedness</strong>: Determine the sign by checking if the next character is <code>&#39;-&#39;</code> or <code>&#39;+&#39;</code>, assuming positivity if neither present.</li>
2626
<li><strong>Conversion</strong>: Read the integer by skipping leading zeros&nbsp;until a non-digit character is encountered or the end of the string is reached. If no digits were read, then the result is 0.</li>
2727
<li><strong>Rounding</strong>: If the integer is out of the 32-bit signed integer range <code>[-2<sup>31</sup>, 2<sup>31</sup> - 1]</code>, then round the integer to remain in the range. Specifically, integers less than <code>-2<sup>31</sup></code> should be rounded to <code>-2<sup>31</sup></code>, and integers greater than <code>2<sup>31</sup> - 1</code> should be rounded to <code>2<sup>31</sup> - 1</code>.</li>
2828
</ol>

‎solution/0200-0299/0209.Minimum Size Subarray Sum/README.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ tags:
5454
<ul>
5555
<li><code>1 &lt;= target &lt;= 10<sup>9</sup></code></li>
5656
<li><code>1 &lt;= nums.length &lt;= 10<sup>5</sup></code></li>
57-
<li><code>1 &lt;= nums[i] &lt;= 10<sup>5</sup></code></li>
57+
<li><code>1 &lt;= nums[i] &lt;= 10<sup>4</sup></code></li>
5858
</ul>
5959

6060
<p>&nbsp;</p>

‎solution/0700-0799/0729.My Calendar I/README.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,13 @@ tags:
2424

2525
<p>当两个日程安排有一些时间上的交叉时(例如两个日程安排都在同一时间内),就会产生 <strong>重复预订</strong> 。</p>
2626

27-
<p>日程可以用一对整数 <code>start</code> 和 <code>end</code> 表示,这里的时间是半开区间,即 <code>[start, end)</code>, 实数&nbsp;<code>x</code> 的范围为, &nbsp;<code>start &lt;= x &lt; end</code> 。</p>
27+
<p>日程可以用一对整数 <code>startTime</code> 和 <code>endTime</code> 表示,这里的时间是半开区间,即 <code>[startTime, endTime)</code>, 实数&nbsp;<code>x</code> 的范围为, &nbsp;<code>startTime &lt;= x &lt; endTime</code> 。</p>
2828

2929
<p>实现 <code>MyCalendar</code> 类:</p>
3030

3131
<ul>
3232
<li><code>MyCalendar()</code> 初始化日历对象。</li>
33-
<li><code>boolean book(int start, int end)</code> 如果可以将日程安排成功添加到日历中而不会导致重复预订,返回 <code>true</code> 。否则,返回 <code>false</code>&nbsp;并且不要将该日程安排添加到日历中。</li>
33+
<li><code>boolean book(int startTime, int endTime)</code> 如果可以将日程安排成功添加到日历中而不会导致重复预订,返回 <code>true</code> 。否则,返回 <code>false</code>&nbsp;并且不要将该日程安排添加到日历中。</li>
3434
</ul>
3535

3636
<p>&nbsp;</p>

‎solution/0700-0799/0731.My Calendar II/README.md‎

Lines changed: 25 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -21,43 +21,47 @@ tags:
2121

2222
<!-- description:start -->
2323

24-
<p>实现一个 <code>MyCalendar</code> 类来存放你的日程安排。如果要添加的时间内不会导致三重预订时,则可以存储这个新的日程安排。</p>
24+
<p>实现一个程序来存放你的日程安排。如果要添加的时间内不会导致三重预订时,则可以存储这个新的日程安排。</p>
2525

26-
<p><code>MyCalendar</code> 有一个 <code>book(int start, int end)</code>方法。它意味着在 <code>start</code> 到 <code>end</code> 时间内增加一个日程安排,注意,这里的时间是半开区间,即 <code>[start, end)</code>, 实数&nbsp;<code>x</code> 的范围为, &nbsp;<code>start &lt;= x &lt; end</code>。</p>
26+
<p>当三个日程安排有一些时间上的交叉时(例如三个日程安排都在同一时间内),就会产生 <strong>三重预订</strong>。</p>
2727

28-
<p>当三个日程安排有一些时间上的交叉时(例如三个日程安排都在同一时间内),就会产生三重预订。</p>
28+
<p>事件能够用一对整数&nbsp;<code>startTime</code>&nbsp;&nbsp;<code>endTime</code>&nbsp;表示,在一个半开区间的时间&nbsp;<code>[startTime, endTime)</code>&nbsp;上预定。实数&nbsp;<code>x</code> 的范围为&nbsp;&nbsp;<code>startTime &lt;= x &lt; endTime</code>。</p>
2929

30-
<p>每次调用 <code>MyCalendar.book</code>方法时,如果可以将日程安排成功添加到日历中而不会导致三重预订,返回 <code>true</code>。否则,返回 <code>false</code> 并且不要将该日程安排添加到日历中。</p>
30+
<p>实现&nbsp;<code>MyCalendarTwo</code> 类:</p>
3131

32-
<p>请按照以下步骤调用<code>MyCalendar</code> 类: <code>MyCalendar cal = new MyCalendar();</code> <code>MyCalendar.book(start, end)</code></p>
32+
<ul>
33+
<li><code>MyCalendarTwo()</code>&nbsp;初始化日历对象。</li>
34+
<li><code>boolean book(int startTime, int endTime)</code>&nbsp;如果可以将日程安排成功添加到日历中而不会导致三重预订,返回 <code>true</code>。否则,返回 <code>false</code> 并且不要将该日程安排添加到日历中。</li>
35+
</ul>
3336

3437
<p>&nbsp;</p>
3538

36-
<p><strong class="example">示例:</strong></p>
39+
<p><strong class="example">示例 1:</strong></p>
3740

3841
<pre>
39-
MyCalendar();
40-
MyCalendar.book(10, 20); // returns true
41-
MyCalendar.book(50, 60); // returns true
42-
MyCalendar.book(10, 40); // returns true
43-
MyCalendar.book(5, 15); // returns false
44-
MyCalendar.book(5, 10); // returns true
45-
MyCalendar.book(25, 55); // returns true
46-
<strong>解释:</strong>
47-
前两个日程安排可以添加至日历中。 第三个日程安排会导致双重预订,但可以添加至日历中。
48-
第四个日程安排活动(5,15)不能添加至日历中,因为它会导致三重预订。
49-
第五个日程安排(5,10)可以添加至日历中,因为它未使用已经双重预订的时间10。
50-
第六个日程安排(25,55)可以添加至日历中,因为时间 [25,40] 将和第三个日程安排双重预订;
51-
时间 [40,50] 将单独预订,时间 [50,55)将和第二个日程安排双重预订。
42+
<strong>输入:</strong>
43+
["MyCalendarTwo", "book", "book", "book", "book", "book", "book"]
44+
[[], [10, 20], [50, 60], [10, 40], [5, 15], [5, 10], [25, 55]]
45+
<strong>输出:</strong>
46+
[null, true, true, true, false, true, true]
47+
48+
<strong>解释:</strong>
49+
MyCalendarTwo myCalendarTwo = new MyCalendarTwo();
50+
myCalendarTwo.book(10, 20); // 返回 True,能够预定该日程。
51+
myCalendarTwo.book(50, 60); // 返回 True,能够预定该日程。
52+
myCalendarTwo.book(10, 40); // 返回 True,该日程能够被重复预定。
53+
myCalendarTwo.book(5, 15); // 返回 False,该日程导致了三重预定,所以不能预定。
54+
myCalendarTwo.book(5, 10); // 返回 True,能够预定该日程,因为它不使用已经双重预订的时间 10。
55+
myCalendarTwo.book(25, 55); // 返回 True,能够预定该日程,因为时间段 [25, 40) 将被第三个日程重复预定,时间段 [40, 50) 将被单独预定,而时间段 [50, 55) 将被第二个日程重复预定。
5256
</pre>
5357

5458
<p>&nbsp;</p>
5559

5660
<p><strong>提示:</strong></p>
5761

5862
<ul>
59-
<li>每个测试用例,调用&nbsp;<code>MyCalendar.book</code>&nbsp;函数最多不超过&nbsp;<code>1000</code>次。</li>
60-
<li>调用函数&nbsp;<code>MyCalendar.book(start, end)</code>时,&nbsp;<code>start</code> 和&nbsp;<code>end</code> 的取值范围为&nbsp;<code>[0, 10^9]</code>。</li>
63+
<li><code>0 &lt;= start &lt; end &lt;= 10<sup>9</sup></code></li>
64+
<li>最多调用&nbsp;<code>book</code>&nbsp;1000 次。</li>
6165
</ul>
6266

6367
<!-- description:end -->

‎solution/2200-2299/2222.Number of Ways to Select Buildings/README_EN.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ tags:
4141
<pre>
4242
<strong>Input:</strong> s = &quot;001101&quot;
4343
<strong>Output:</strong> 6
44-
<strong>Explanation:</strong>
44+
<strong>Explanation:</strong>
4545
The following sets of indices selected are valid:
4646
- [0,2,4] from &quot;<u><strong>0</strong></u>0<strong><u>1</u></strong>1<strong><u>0</u></strong>1&quot; forms &quot;010&quot;
4747
- [0,3,4] from &quot;<u><strong>0</strong></u>01<u><strong>10</strong></u>1&quot; forms &quot;010&quot;

‎solution/2900-2999/2904.Shortest and Lexicographically Smallest Beautiful String/README.md‎

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -41,13 +41,13 @@ tags:
4141
<strong>输入:</strong>s = "100011001", k = 3
4242
<strong>输出:</strong>"11001"
4343
<strong>解释:</strong>示例中共有 7 个美丽子字符串:
44-
1. 子字符串 "<em><strong>100011</strong></em>001" 。
45-
2. 子字符串 "<strong><em>1000110</em></strong>01" 。
46-
3. 子字符串 "<strong><em>100011001</em></strong>" 。
47-
4. 子字符串 "1<strong><em>00011001</em></strong>" 。
48-
5. 子字符串 "10<strong><em>0011001</em></strong>" 。
49-
6. 子字符串 "100<em><strong>011001</strong></em>" 。
50-
7. 子字符串 "1000<strong><em>11001</em></strong>" 。
44+
1. 子字符串 "<u>100011</u>001" 。
45+
2. 子字符串 "<u>1000110</u>01" 。
46+
3. 子字符串 "<u>10001100</u>1" 。
47+
4. 子字符串 "1<u>00011001</u>" 。
48+
5. 子字符串 "10<u>0011001</u>" 。
49+
6. 子字符串 "100<u>011001</u>" 。
50+
7. 子字符串 "1000<u>11001</u>" 。
5151
最短美丽子字符串的长度是 5 。
5252
长度为 5 且字典序最小的美丽子字符串是子字符串 "11001" 。
5353
</pre>
@@ -58,9 +58,9 @@ tags:
5858
<strong>输入:</strong>s = "1011", k = 2
5959
<strong>输出:</strong>"11"
6060
<strong>解释:</strong>示例中共有 3 个美丽子字符串:
61-
1. 子字符串 "<em><strong>101</strong></em>1" 。
62-
2. 子字符串 "1<em><strong>011</strong></em>" 。
63-
3. 子字符串 "10<em><strong>11</strong></em>" 。
61+
1. 子字符串 "<u>101</u>1" 。
62+
2. 子字符串 "1<u>011</u>" 。
63+
3. 子字符串 "10<u>11</u>" 。
6464
最短美丽子字符串的长度是 2 。
6565
长度为 2 且字典序最小的美丽子字符串是子字符串 "11" 。
6666
</pre>

‎solution/3200-3299/3211.Generate Binary Strings Without Adjacent Zeros/README.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ rating: 1352
66
source: 第 405 场周赛 Q2
77
tags:
88
- 位运算
9-
- 递归
109
- 字符串
10+
- 回溯
1111
---
1212

1313
<!-- problem:start -->

‎solution/3200-3299/3211.Generate Binary Strings Without Adjacent Zeros/README_EN.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ rating: 1352
66
source: Weekly Contest 405 Q2
77
tags:
88
- Bit Manipulation
9-
- Recursion
109
- String
10+
- Backtracking
1111
---
1212

1313
<!-- problem:start -->

‎solution/3300-3399/3322.Premier League Table Ranking III/README.md‎

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -86,20 +86,20 @@ tags:
8686
<p><strong>输出:</strong></p>
8787

8888
<pre>
89-
+------------+---------+-------------------+--------+-----------------+------+
90-
| season_id | team_id | team_name | points | goal_difference | rank |
91-
+------------+---------+-------------------+--------+-----------------+------+
92-
| 2021 | 1 | Manchester City | 93 | 73 | 1 |
93-
| 2021 | 2 | Liverpool | 92 | 68 | 2 |
94-
| 2021 | 3 | Chelsea | 74 | 43 | 3 |
95-
| 2021 | 4 | Tottenham | 71 | 29 | 4 |
96-
| 2021 | 5 | Arsenal | 69 | 13 | 5 |
97-
| 2022 | 1 | Manchester City | 89 | 61 | 1 |
98-
| 2022 | 2 | Arsenal | 84 | 45 | 2 |
99-
| 2022 | 3 | Manchester United | 75 | 15 | 3 |
100-
| 2022 | 4 | Newcastle | 71 | 35 | 4 |
101-
| 2022 | 5 | Liverpool | 67 | 28 | 5 |
102-
+------------+---------+-------------------+--------+-----------------+------+
89+
+------------+---------+-------------------+--------+-----------------+----------+
90+
| season_id | team_id | team_name | points | goal_difference | position |
91+
+------------+---------+-------------------+--------+-----------------+----------+
92+
| 2021 | 1 | Manchester City | 93 | 73 | 1 |
93+
| 2021 | 2 | Liverpool | 92 | 68 | 2 |
94+
| 2021 | 3 | Chelsea | 74 | 43 | 3 |
95+
| 2021 | 4 | Tottenham | 71 | 29 | 4 |
96+
| 2021 | 5 | Arsenal | 69 | 13 | 5 |
97+
| 2022 | 1 | Manchester City | 89 | 61 | 1 |
98+
| 2022 | 2 | Arsenal | 84 | 45 | 2 |
99+
| 2022 | 3 | Manchester United | 75 | 15 | 3 |
100+
| 2022 | 4 | Newcastle | 71 | 35 | 4 |
101+
| 2022 | 5 | Liverpool | 67 | 28 | 5 |
102+
+------------+---------+-------------------+--------+-----------------+----------+
103103
</pre>
104104

105105
<p><strong>解释:</strong></p>

‎solution/3300-3399/3339.Find the Number of K-Even Arrays/README.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ tags:
2424
<li><code>(arr[i] * arr[i + 1]) - arr[i] - arr[i + 1]</code>&nbsp;是偶数。</li>
2525
</ul>
2626

27-
<p>返回大小为 <code>n</code>&nbsp;的满足&nbsp;<strong>K 偶数</strong> 的数组的数量,其中所有元素的范围在&nbsp;<code>[1, m]</code>。</p>
27+
<p>返回长度为 <code>n</code>&nbsp;的满足&nbsp;<strong>K 偶数</strong> 的数组的数量,其中所有元素的范围在&nbsp;<code>[1, m]</code>。</p>
2828

2929
<p>因为答案可能很大,返回答案对&nbsp;<code>10<sup>9</sup> + 7</code>&nbsp;取模。</p>
3030

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /