Skip to content

Commit 652dde4

Browse files
authored
feat: add weekly contest 436 (#4048)
1 parent 9953fd3 commit 652dde4

File tree

34 files changed

+1886
-48
lines changed

34 files changed

+1886
-48
lines changed

solution/0800-0899/0870.Advantage Shuffle/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ tags:
2121

2222
<p>给定两个长度相等的数组&nbsp;<code>nums1</code>&nbsp;&nbsp;<code>nums2</code>,<code>nums1</code>&nbsp;相对于 <code>nums2</code> 的<em>优势</em>可以用满足&nbsp;<code>nums1[i] &gt; nums2[i]</code>&nbsp;的索引 <code>i</code>&nbsp;的数目来描述。</p>
2323

24-
<p>返回 <font color="#c7254e" face="Menlo, Monaco, Consolas, Courier New, monospace" size="1"><span style="background-color: rgb(249, 242, 244);">nums1</span></font>&nbsp;<strong>任意</strong>排列,使其相对于 <code>nums2</code>&nbsp;的优势最大化。</p>
24+
<p>返回 <code>nums1</code> 的&nbsp;<strong>任意&nbsp;</strong>排列,使其相对于 <code>nums2</code>&nbsp;的优势最大化。</p>
2525

2626
<p>&nbsp;</p>
2727

solution/1800-1899/1880.Check if Word Equals Summation of Two Words/README_EN.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ We return true because 21 + 210 == 231.
4848
<pre>
4949
<strong>Input:</strong> firstWord = &quot;aaa&quot;, secondWord = &quot;a&quot;, targetWord = &quot;aab&quot;
5050
<strong>Output:</strong> false
51-
<strong>Explanation:</strong>
51+
<strong>Explanation:</strong>
5252
The numerical value of firstWord is &quot;aaa&quot; -&gt; &quot;000&quot; -&gt; 0.
5353
The numerical value of secondWord is &quot;a&quot; -&gt; &quot;0&quot; -&gt; 0.
5454
The numerical value of targetWord is &quot;aab&quot; -&gt; &quot;001&quot; -&gt; 1.
@@ -60,7 +60,7 @@ We return false because 0 + 0 != 1.
6060
<pre>
6161
<strong>Input:</strong> firstWord = &quot;aaa&quot;, secondWord = &quot;a&quot;, targetWord = &quot;aaaa&quot;
6262
<strong>Output:</strong> true
63-
<strong>Explanation:</strong>
63+
<strong>Explanation:</strong>
6464
The numerical value of firstWord is &quot;aaa&quot; -&gt; &quot;000&quot; -&gt; 0.
6565
The numerical value of secondWord is &quot;a&quot; -&gt; &quot;0&quot; -&gt; 0.
6666
The numerical value of targetWord is &quot;aaaa&quot; -&gt; &quot;0000&quot; -&gt; 0.

solution/1800-1899/1882.Process Tasks Using Servers/README_EN.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -52,12 +52,12 @@ tags:
5252
<pre>
5353
<strong>Input:</strong> servers = [5,1,4,3,2], tasks = [2,1,2,4,5,2,1]
5454
<strong>Output:</strong> [1,4,1,4,1,3,2]
55-
<strong>Explanation: </strong>Events in chronological order go as follows:
55+
<strong>Explanation: </strong>Events in chronological order go as follows:
5656
- At second 0, task 0 is added and processed using server 1 until second 2.
5757
- At second 1, task 1 is added and processed using server 4 until second 2.
58-
- At second 2, servers 1 and 4 become free. Task 2 is added and processed using server 1 until second 4.
58+
- At second 2, servers 1 and 4 become free. Task 2 is added and processed using server 1 until second 4.
5959
- At second 3, task 3 is added and processed using server 4 until second 7.
60-
- At second 4, server 1 becomes free. Task 4 is added and processed using server 1 until second 9.
60+
- At second 4, server 1 becomes free. Task 4 is added and processed using server 1 until second 9.
6161
- At second 5, task 5 is added and processed using server 3 until second 7.
6262
- At second 6, task 6 is added and processed using server 2 until second 7.
6363
</pre>

solution/1900-1999/1920.Build Array from Permutation/README_EN.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ tags:
2929
<pre>
3030
<strong>Input:</strong> nums = [0,2,1,5,3,4]
3131
<strong>Output:</strong> [0,1,2,4,5,3]<strong>
32-
Explanation:</strong> The array ans is built as follows:
32+
Explanation:</strong> The array ans is built as follows:
3333
ans = [nums[nums[0]], nums[nums[1]], nums[nums[2]], nums[nums[3]], nums[nums[4]], nums[nums[5]]]
3434
= [nums[0], nums[2], nums[1], nums[5], nums[3], nums[4]]
3535
= [0,1,2,4,5,3]</pre>

solution/1900-1999/1942.The Number of the Smallest Unoccupied Chair/README_EN.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ tags:
3838
<pre>
3939
<strong>Input:</strong> times = [[1,4],[2,3],[4,6]], targetFriend = 1
4040
<strong>Output:</strong> 1
41-
<strong>Explanation:</strong>
41+
<strong>Explanation:</strong>
4242
- Friend 0 arrives at time 1 and sits on chair 0.
4343
- Friend 1 arrives at time 2 and sits on chair 1.
4444
- Friend 1 leaves at time 3 and chair 1 becomes empty.
@@ -52,7 +52,7 @@ Since friend 1 sat on chair 1, we return 1.
5252
<pre>
5353
<strong>Input:</strong> times = [[3,10],[1,5],[2,6]], targetFriend = 0
5454
<strong>Output:</strong> 2
55-
<strong>Explanation:</strong>
55+
<strong>Explanation:</strong>
5656
- Friend 1 arrives at time 1 and sits on chair 0.
5757
- Friend 2 arrives at time 2 and sits on chair 1.
5858
- Friend 0 arrives at time 3 and sits on chair 2.

solution/1900-1999/1946.Largest Number After Mutating Substring/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ tags:
4949
- 2 映射为 change[2] = 3 。
5050
- 1 映射为 change[1] = 4 。
5151
因此,"<strong><em>021</em></strong>" 变为 "<strong><em>934</em></strong>" 。
52-
"934" 是可以构造的最大整数,所以返回它的字符串表示。
52+
"934" 是可以构造的最大整数,所以返回它的字符串表示。
5353
</pre>
5454

5555
<p><strong>示例 3:</strong></p>

solution/3400-3499/3436.Find Valid Emails/README.md

+22-21
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,15 @@ tags:
88

99
<!-- problem:start -->
1010

11-
# [3436. Find Valid Emails](https://leetcode.cn/problems/find-valid-emails)
11+
# [3436. 查找合法邮箱](https://leetcode.cn/problems/find-valid-emails)
1212

1313
[English Version](/solution/3400-3499/3436.Find%20Valid%20Emails/README_EN.md)
1414

1515
## 题目描述
1616

1717
<!-- description:start -->
1818

19-
<p>Table: <code>Users</code></p>
19+
<p>表:<code>Users</code></p>
2020

2121
<pre>
2222
+-----------------+---------+
@@ -25,28 +25,29 @@ tags:
2525
| user_id | int |
2626
| email | varchar |
2727
+-----------------+---------+
28-
(user_id) is the unique key for this table.
29-
Each row contains a user&#39;s unique ID and email address.
28+
(user_id) 是这张表的唯一主键。
29+
每一行包含用户的唯一 ID 和邮箱地址。
3030
</pre>
3131

32-
<p>Write a solution to find all the <strong>valid email addresses</strong>. A valid email address meets the following criteria:</p>
32+
<p>编写一个解决方案来查找所有 <b>合法邮箱地址</b>。一个合法的邮箱地址符合下述条件:</p>
3333

3434
<ul>
35-
<li>It contains exactly one <code>@</code> symbol.</li>
36-
<li>It ends with <code>.com</code>.</li>
37-
<li>The part before the <code>@</code> symbol contains only <strong>alphanumeric</strong> characters and <strong>underscores</strong>.</li>
38-
<li>The part after the <code>@</code> symbol and before <code>.com</code> contains a domain name <strong>that contains only letters</strong>.</li>
35+
<li>只包含一个&nbsp;<code>@</code>&nbsp;符号。</li>
36+
<li>以&nbsp;<code>.com</code>&nbsp;结尾。</li>
37+
<li><code>@</code>&nbsp;符号前面的部分只包含&nbsp;<strong>字母数字</strong>&nbsp;字符和&nbsp;<strong>下划线</strong></li>
38+
<li><code>@</code>&nbsp;符号后面与&nbsp;<code>.com</code>&nbsp;前面的部分 包含 <strong>只有字母&nbsp;</strong>的域名。</li>
3939
</ul>
4040

41-
<p>Return<em> the result table ordered by</em> <code>user_id</code> <em>in</em> <strong>ascending </strong><em>order</em>.</p>
41+
<p>返回结果表以&nbsp;<code>user_id</code> <strong>升序</strong>&nbsp;排序。</p>
4242

4343
<p>&nbsp;</p>
44-
<p><strong class="example">Example:</strong></p>
44+
45+
<p><strong class="example">示例:</strong></p>
4546

4647
<div class="example-block">
47-
<p><strong>Input:</strong></p>
48+
<p><strong>输入:</strong></p>
4849

49-
<p>Users table:</p>
50+
<p>Users 表:</p>
5051

5152
<pre class="example-io">
5253
+---------+---------------------+
@@ -60,7 +61,7 @@ Each row contains a user&#39;s unique ID and email address.
6061
+---------+---------------------+
6162
</pre>
6263

63-
<p><strong>Output:</strong></p>
64+
<p><strong>输出:</strong></p>
6465

6566
<pre class="example-io">
6667
+---------+-------------------+
@@ -71,17 +72,17 @@ Each row contains a user&#39;s unique ID and email address.
7172
+---------+-------------------+
7273
</pre>
7374

74-
<p><strong>Explanation:</strong></p>
75+
<p><strong>解释:</strong></p>
7576

7677
<ul>
77-
<li><strong>alice@example.com</strong> is valid because it contains one <code>@</code>, alice&nbsp;is alphanumeric, and example.com&nbsp;starts with a letter and ends with .com.</li>
78-
<li><strong>bob_at_example.com</strong> is invalid because it contains an underscore instead of an <code>@</code>.</li>
79-
<li><strong>charlie@example.net</strong> is invalid because the domain does not end with <code>.com</code>.</li>
80-
<li><strong>david@domain.com</strong> is valid because it meets all criteria.</li>
81-
<li><strong>eve@invalid</strong> is invalid because the domain does not end with <code>.com</code>.</li>
78+
<li><strong>alice@example.com</strong>&nbsp;是合法的因为它包含一个&nbsp;<code>@</code>alice 是只有字母数字的,并且&nbsp;example.com 以字母开始并以 .com&nbsp;结束。</li>
79+
<li><strong>bob_at_example.com</strong>&nbsp;是不合法的因为它包含下划线但没有&nbsp;<code>@</code></li>
80+
<li><strong>charlie@example.net</strong>&nbsp;是不合法的因为域名没有以&nbsp;<code>.com</code>&nbsp;结尾。</li>
81+
<li><strong>david@domain.com</strong>&nbsp;是合法的因为它满足所有条件。</li>
82+
<li><strong>eve@invalid</strong>&nbsp;是不合法的因为域名没有以&nbsp;<code>.com</code>&nbsp;结尾。</li>
8283
</ul>
8384

84-
<p>Result table is ordered by user_id in ascending order.</p>
85+
<p>结果表以 user_id 升序排序。</p>
8586
</div>
8687

8788
<!-- description:end -->

solution/3400-3499/3437.Permutations III/README.md

+15-13
Original file line numberDiff line numberDiff line change
@@ -9,45 +9,47 @@ tags:
99

1010
<!-- problem:start -->
1111

12-
# [3437. Permutations III 🔒](https://leetcode.cn/problems/permutations-iii)
12+
# [3437. 全排列 III 🔒](https://leetcode.cn/problems/permutations-iii)
1313

1414
[English Version](/solution/3400-3499/3437.Permutations%20III/README_EN.md)
1515

1616
## 题目描述
1717

1818
<!-- description:start -->
1919

20-
<p>Given an integer <code>n</code>, an <strong>alternating permutation</strong> is a permutation of the first <code>n</code> positive integers such that no <strong>two</strong> adjacent elements are <strong>both</strong> odd or <strong>both</strong> even.</p>
20+
<p>给定一个整数&nbsp;<code>n</code>,一个 <strong>交替排列</strong> 是没有 <strong>两个</strong> 相邻元素 <strong>同时</strong> 为奇数或偶数的前 <code>n</code> 个正整数的排列。</p>
2121

22-
<p>Return <em>all such </em><strong>alternating permutations</strong> sorted in lexicographical order.</p>
22+
<p>返回所有这样的 <strong>交替排列</strong>&nbsp;以字典序排序。</p>
2323

2424
<p>&nbsp;</p>
25-
<p><strong class="example">Example 1:</strong></p>
25+
26+
<p><strong class="example">示例 1:</strong></p>
2627

2728
<div class="example-block">
28-
<p><strong>Input:</strong> <span class="example-io">n = 4</span></p>
29+
<p><span class="example-io"><b>输入:</b>n = 4</span></p>
2930

30-
<p><strong>Output:</strong> <span class="example-io">[[1,2,3,4],[1,4,3,2],[2,1,4,3],[2,3,4,1],[3,2,1,4],[3,4,1,2],[4,1,2,3],[4,3,2,1]]</span></p>
31+
<p><span class="example-io"><b>输出:</b>[[1,2,3,4],[1,4,3,2],[2,1,4,3],[2,3,4,1],[3,2,1,4],[3,4,1,2],[4,1,2,3],[4,3,2,1]]</span></p>
3132
</div>
3233

33-
<p><strong class="example">Example 2:</strong></p>
34+
<p><strong class="example">示例 2:</strong></p>
3435

3536
<div class="example-block">
36-
<p><strong>Input:</strong> <span class="example-io">n = 2</span></p>
37+
<p><span class="example-io"><b>输入:</b>n = 2</span></p>
3738

38-
<p><strong>Output:</strong> <span class="example-io">[[1,2],[2,1]]</span></p>
39+
<p><span class="example-io"><b>输出:</b>[[1,2],[2,1]]</span></p>
3940
</div>
4041

41-
<p><strong class="example">Example 3:</strong></p>
42+
<p><strong class="example">示例 3:</strong></p>
4243

4344
<div class="example-block">
44-
<p><strong>Input:</strong> <span class="example-io">n = 3</span></p>
45+
<p><strong>输入:</strong><span class="example-io">n = 3</span></p>
4546

46-
<p><strong>Output:</strong> <span class="example-io">[[1,2,3],[3,2,1]]</span></p>
47+
<p><span class="example-io"><b>输出:</b>[[1,2,3],[3,2,1]]</span></p>
4748
</div>
4849

4950
<p>&nbsp;</p>
50-
<p><strong>Constraints:</strong></p>
51+
52+
<p><strong>提示:</strong></p>
5153

5254
<ul>
5355
<li><code>1 &lt;= n &lt;= 10</code></li>

0 commit comments

Comments
 (0)