Skip to content

Commit c28d245

Browse files
authored
feat:替换英文 (azl397985856#441)
1 parent 58ee11a commit c28d245

File tree

136 files changed

+1842
-1425
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

136 files changed

+1842
-1425
lines changed

Diff for: SUMMARY.md

+159-160
Large diffs are not rendered by default.

Diff for: problems/1011.capacity-to-ship-packages-within-d-days-cn.md renamed to problems/1011.capacity-to-ship-packages-within-d-days.md

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
## 题目地址(1011. 在 D 天内送达包裹的能力)
22

3-
https://leetcode-cn.com/problems/capacity-to-ship-packages-within-d-days
3+
https://leetcode-cn.com/problems/capacity-to-ship-packages-within-d-days/
44

55
## 题目描述
66

7+
```
8+
79
传送带上的包裹必须在 D 天内从一个港口运送到另一个港口。
810
911
传送带上的第 i  个包裹的重量为  weights[i]。每一天,我们都会按给出重量的顺序往传送带上装载包裹。我们装载的重量不会超过船的最大运载重量。
@@ -47,6 +49,8 @@ https://leetcode-cn.com/problems/capacity-to-ship-packages-within-d-days
4749
1 <= D <= weights.length <= 50000
4850
1 <= weights[i] <= 500
4951
52+
```
53+
5054
## 前置知识
5155

5256
- 二分法

Diff for: problems/1014.best-sightseeing-pair.md

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
## 题目地址(1014. 最佳观光组合)
22

3-
https://leetcode-cn.com/problems/best-sightseeing-pair/description/
3+
https://leetcode-cn.com/problems/best-sightseeing-pair/
44

55
## 题目描述
66

7+
```
8+
79
给定正整数数组  A,A[i]  表示第 i 个观光景点的评分,并且两个景点  i 和  j  之间的距离为  j - i。
810
911
一对景点(i < j)组成的观光组合的得分为(A[i] + A[j] + i - j):景点的评分之和减去它们两者之间的距离。
@@ -21,6 +23,8 @@ https://leetcode-cn.com/problems/best-sightseeing-pair/description/
2123
2 <= A.length <= 50000
2224
1 <= A[i] <= 1000
2325
26+
```
27+
2428
## 前置知识
2529

2630
- 动态规划

Diff for: problems/1015.smallest-integer-divisible-by-k.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
## 题目地址
1+
## 题目地址(1015. 可被 K 整除的最小整数)
22

3-
https://leetcode-cn.com/problems/smallest-integer-divisible-by-k/description/
3+
https://leetcode-cn.com/problems/smallest-integer-divisible-by-k/
44

55
## 题目描述
66

Diff for: problems/1019.next-greater-node-in-linked-list.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
## 题目地址
1+
## 题目地址(1019. 链表中的下一个更大节点)
22

3-
https://leetcode-cn.com/problems/next-greater-node-in-linked-list/submissions/
3+
https://leetcode-cn.com/problems/next-greater-node-in-linked-list/
44

55
## 题目描述
66

Diff for: problems/102.binary-tree-level-order-traversal.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11

2-
## 题目地址
3-
https://leetcode.com/problems/binary-tree-level-order-traversal/description/
2+
## 题目地址(102. 二叉树的层序遍历)
3+
https://leetcode-cn.com/problems/binary-tree-level-order-traversal/
44

55
## 题目描述
66
```

Diff for: problems/1020.number-of-enclaves.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
## 题目地址
1+
## 题目地址(1020. 飞地的数量)
22

33
https://leetcode-cn.com/problems/number-of-enclaves/
44

Diff for: problems/1023.camelcase-matching.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
## 题目地址
1+
## 题目地址(1023. 驼峰式匹配)
22

33
https://leetcode-cn.com/problems/camelcase-matching/
44

Diff for: problems/103.binary-tree-zigzag-level-order-traversal.md

+9-6
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,29 @@
11

2-
## 题目地址
3-
https://leetcode.com/problems/binary-tree-zigzag-level-order-traversal/description/
2+
## 题目地址(103. 二叉树的锯齿形层次遍历)
3+
https://leetcode-cn.com/problems/binary-tree-zigzag-level-order-traversal/
44

55
## 题目描述
66
和leetcode 102 基本是一样的,思路是完全一样的。
77

88
```
9-
Given a binary tree, return the zigzag level order traversal of its nodes' values. (ie, from left to right, then right to left for the next level and alternate between).
9+
给定一个二叉树,返回其节点值的锯齿形层次遍历。(即先从左往右,再从右往左进行下一层遍历,以此类推,层与层之间交替进行)。
10+
11+
例如:
12+
给定二叉树 [3,9,20,null,null,15,7],
1013
11-
For example:
12-
Given binary tree [3,9,20,null,null,15,7],
1314
3
1415
/ \
1516
9 20
1617
/ \
1718
15 7
18-
return its zigzag level order traversal as:
19+
返回锯齿形层次遍历如下:
20+
1921
[
2022
[3],
2123
[20,9],
2224
[15,7]
2325
]
26+
2427
```
2528

2629
## 前置知识

Diff for: problems/1031.maximum-sum-of-two-non-overlapping-subarrays.md

+23-20
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,43 @@
1-
## 题目地址
2-
https://leetcode.com/problems/maximum-sum-of-two-non-overlapping-subarrays/
1+
## 题目地址(1031. 两个非重叠子数组的最大和)
2+
https://leetcode-cn.com/problems/maximum-sum-of-two-non-overlapping-subarrays/
33

44
## 题目描述
55

66
```
7-
Given an array A of non-negative integers, return the maximum sum of elements in two non-overlapping (contiguous) subarrays, which have lengths L and M. (For clarification, the L-length subarray could occur before or after the M-length subarray.)
7+
给出非负整数数组 A ,返回两个非重叠(连续)子数组中元素的最大和,子数组的长度分别为 L 和 M。(这里需要澄清的是,长为 L 的子数组可以出现在长为 M 的子数组之前或之后。)
88
9-
Formally, return the largest V for which V = (A[i] + A[i+1] + ... + A[i+L-1]) + (A[j] + A[j+1] + ... + A[j+M-1]) and either:
9+
从形式上看,返回最大的 V,而 V = (A[i] + A[i+1] + ... + A[i+L-1]) + (A[j] + A[j+1] + ... + A[j+M-1]) 并满足下列条件之一:
1010
11-
0 <= i < i + L - 1 < j < j + M - 1 < A.length, or
11+
 
12+
13+
0 <= i < i + L - 1 < j < j + M - 1 < A.length, 或
1214
0 <= j < j + M - 1 < i < i + L - 1 < A.length.
13-
15+
 
1416
15-
Example 1:
17+
示例 1:
1618
17-
Input: A = [0,6,5,2,2,5,1,9,4], L = 1, M = 2
18-
Output: 20
19-
Explanation: One choice of subarrays is [9] with length 1, and [6,5] with length 2.
20-
Example 2:
19+
输入:A = [0,6,5,2,2,5,1,9,4], L = 1, M = 2
20+
输出:20
21+
解释:子数组的一种选择中,[9] 长度为 1,[6,5] 长度为 2。
22+
示例 2:
2123
22-
Input: A = [3,8,1,3,2,1,8,9,0], L = 3, M = 2
23-
Output: 29
24-
Explanation: One choice of subarrays is [3,8,1] with length 3, and [8,9] with length 2.
25-
Example 3:
24+
输入:A = [3,8,1,3,2,1,8,9,0], L = 3, M = 2
25+
输出:29
26+
解释:子数组的一种选择中,[3,8,1] 长度为 3,[8,9] 长度为 2。
27+
示例 3:
2628
27-
Input: A = [2,1,5,6,0,9,5,0,3,8], L = 4, M = 3
28-
Output: 31
29-
Explanation: One choice of subarrays is [5,6,0,9] with length 4, and [3,8] with length 3.
30-
29+
输入:A = [2,1,5,6,0,9,5,0,3,8], L = 4, M = 3
30+
输出:31
31+
解释:子数组的一种选择中,[5,6,0,9] 长度为 4,[0,3,8] 长度为 3。
32+
 
3133
32-
Note:
34+
提示:
3335
3436
L >= 1
3537
M >= 1
3638
L + M <= A.length <= 1000
3739
0 <= A[i] <= 1000
40+
3841
```
3942

4043
## 前置知识

Diff for: problems/105.Construct-Binary-Tree-from-Preorder-and-Inorder-Traversal.md

+11-13
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,27 @@
1-
## 问题地址/Problem URL
1+
## 题目地址(105. 从前序与中序遍历序列构造二叉树)
22

33
https://leetcode.com/problems/construct-binary-tree-from-preorder-and-inorder-traversal/
44

5-
## 问题介绍/Problem Description
5+
## 题目描述
66

7-
Given preorder and inorder traversal of a tree, construct the binary tree.
7+
```
8+
根据一棵树的前序遍历与中序遍历构造二叉树。
89
9-
Note:
10-
You may assume that duplicates do not exist in the tree.
10+
注意:
11+
你可以假设树中没有重复的元素。
1112
12-
For example, given
13+
例如,给出
1314
14-
```java
15-
preorder = [3,9,20,15,7]
16-
inorder = [9,3,15,20,7]
17-
```
15+
前序遍历 preorder = [3,9,20,15,7]
16+
中序遍历 inorder = [9,3,15,20,7]
17+
返回如下的二叉树:
1818
19-
Return the following binary tree:
20-
21-
```bash
2219
3
2320
/ \
2421
9 20
2522
/ \
2623
15 7
24+
2725
```
2826

2927
## 前置知识

Diff for: problems/11.container-with-most-water.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
## 题目地址
1+
## 题目地址(11. 盛最多水的容器)
22

33
https://leetcode-cn.com/problems/container-with-most-water/description/
44

Diff for: problems/1104.path-in-zigzag-labelled-binary-tree.md

+6-2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
1-
## 题目地址
1+
## 题目地址(1104. 二叉树寻路)
22

3-
https://leetcode-cn.com/problems/path-in-zigzag-labelled-binary-tree/description/
3+
https://leetcode-cn.com/problems/path-in-zigzag-labelled-binary-tree/
44

55
## 题目描述
66

7+
```
8+
79
在一棵无限的二叉树上,每个节点都有两个子节点,树中的节点 逐行 依次按 “之” 字形进行标记。
810
911
如下图所示,在奇数行(即,第一行、第三行、第五行……)中,按从左到右的顺序进行标记;
@@ -27,6 +29,8 @@ https://leetcode-cn.com/problems/path-in-zigzag-labelled-binary-tree/description
2729
2830
1 <= label <= 10^6
2931
32+
```
33+
3034
## 前置知识
3135

3236
- 二叉树

Diff for: problems/113.path-sum-ii.md

+15-15
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,29 @@
1-
## 题目地址
2-
https://leetcode.com/problems/path-sum-ii/description/
1+
## 题目地址(113. 路径总和 II)
2+
https://leetcode-cn.com/problems/path-sum-ii/
33

44
## 题目描述
55
```
6-
Given a binary tree and a sum, find all root-to-leaf paths where each path's sum equals the given sum.
6+
给定一个二叉树和一个目标和,找到所有从根节点到叶子节点路径总和等于给定目标和的路径。
77
8-
Note: A leaf is a node with no children.
8+
说明: 叶子节点是指没有子节点的节点。
99
10-
Example:
10+
示例:
11+
给定如下二叉树,以及目标和 sum = 22,
1112
12-
Given the below binary tree and sum = 22,
13-
14-
5
15-
/ \
16-
4 8
17-
/ / \
18-
11 13 4
19-
/ \ / \
20-
7 2 5 1
21-
Return:
13+
5
14+
/ \
15+
4 8
16+
/ / \
17+
11 13 4
18+
/ \ / \
19+
7 2 5 1
20+
返回:
2221
2322
[
2423
[5,4,11,2],
2524
[5,8,4,5]
2625
]
26+
2727
```
2828

2929
## 前置知识

Diff for: problems/1131.maximum-of-absolute-value-expression.md

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
## 题目地址(1131. 绝对值表达式的最大值)
22

3-
https://leetcode-cn.com/problems/maximum-of-absolute-value-expression/description/
3+
https://leetcode-cn.com/problems/maximum-of-absolute-value-expression/
44

55
## 题目描述
66

7+
```
8+
79
给你两个长度相等的整数数组,返回下面表达式的最大值:
810
911
|arr1[i] - arr1[j]| + |arr2[i] - arr2[j]| + |i - j|
@@ -24,6 +26,8 @@ https://leetcode-cn.com/problems/maximum-of-absolute-value-expression/descriptio
2426
2 <= arr1.length == arr2.length <= 40000
2527
-10^6 <= arr1[i], arr2[i] <= 10^6
2628
29+
```
30+
2731
## 前置知识
2832

2933
- 数组

Diff for: problems/1168.optimize-water-distribution-in-a-village-cn.md renamed to problems/1168.optimize-water-distribution-in-a-village.md

+10-10
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,23 @@
1-
## 题目地址
1+
## 题目地址(1168. 水资源分配优化)
22
https://leetcode.com/problems/optimize-water-distribution-in-a-village/
33

44
## 题目描述
55
```
6-
There are n houses in a village. We want to supply water for all the houses by building wells and laying pipes.
6+
村庄内有n户人家,我们可以通过挖井或者建造水管向每家供水。
77
8-
For each house i, we can either build a well inside it directly with cost wells[i], or pipe in water from another well to it. The costs to lay pipes between houses are given by the array pipes, where each pipes[i] = [house1, house2, cost] represents the cost to connect house1 and house2 together using a pipe. Connections are bidirectional.
8+
对于每户人家i,我们可以通过花费 wells[i] 直接在其房内挖水井,或者通过水管连接到其他的水井。每两户住户间铺设水管的费用通过 pipes 数组表示。 pipes[i] = [house1, house2, cost] 表示住户1到住户2间铺设水管的费用为cost。
99
10-
Find the minimum total cost to supply water to all houses.
10+
请求出所有住户都能通水的最小花费。
1111
12-
Example 1:
12+
示例1:
1313
14-
Input: n = 3, wells = [1,2,2], pipes = [[1,2,1],[2,3,1]]
15-
Output: 3
16-
Explanation:
14+
15+
输入: n = 3, wells = [1,2,2], pipes = [[1,2,1],[2,3,1]]
16+
输出: 3
17+
解释:
1718
The image shows the costs of connecting houses using pipes.
1819
The best strategy is to build a well in the first house with cost 1 and connect the other houses to it with cost 2 so the total cost is 3.
19-
20-
Constraints:
20+
提示:
2121
2222
1 <= n <= 10000
2323
wells.length == n

Diff for: problems/1186.maximum-subarray-sum-with-one-deletion.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
## 题目地址
1+
## 题目地址(1186. 删除一次得到子数组最大和)
22

3-
https://leetcode.com/problems/maximum-subarray-sum-with-one-deletion/
3+
https://leetcode-cn.com/problems/maximum-subarray-sum-with-one-deletion/
44

55
## 题目描述
66

Diff for: problems/1218.longest-arithmetic-subsequence-of-given-difference.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
## 题目地址
1+
## 题目地址(1218. 最长定差子序列)
22

33
https://leetcode-cn.com/problems/longest-arithmetic-subsequence-of-given-difference/
44

Diff for: problems/1227.airplane-seat-assignment-probability.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
## 题目地址(1227. 飞机座位分配概率)
22

3-
https://leetcode-cn.com/problems/airplane-seat-assignment-probability/description/
3+
https://leetcode-cn.com/problems/airplane-seat-assignment-probability/
44

55
## 题目描述
66

0 commit comments

Comments
 (0)