Skip to content

Commit 2cd54a2

Browse files
committed
补充第 700 ~ 799 题的题目解析(增加 9 道题)
1 parent 6a86403 commit 2cd54a2

14 files changed

Lines changed: 375 additions & 26 deletions

docs/00_preface/00_05_solutions_list.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# LeetCode 题解(已完成 1120 道)
1+
# LeetCode 题解(已完成 1123 道)
22

33
### 第 1 ~ 99 题
44

@@ -655,6 +655,7 @@
655655
| [0707. 设计链表](https://leetcode.cn/problems/design-linked-list/) | [题解](https://github.com/ITCharge/AlgoNote/tree/main/docs/solutions/0700-0799/design-linked-list.md) | 设计、链表 | 中等 |
656656
| [0708. 循环有序列表的插入](https://leetcode.cn/problems/insert-into-a-sorted-circular-linked-list/) | [题解](https://github.com/ITCharge/AlgoNote/tree/main/docs/solutions/0700-0799/insert-into-a-sorted-circular-linked-list.md) | 链表 | 中等 |
657657
| [0709. 转换成小写字母](https://leetcode.cn/problems/to-lower-case/) | [题解](https://github.com/ITCharge/AlgoNote/tree/main/docs/solutions/0700-0799/to-lower-case.md) | 字符串 | 简单 |
658+
| [0710. 黑名单中的随机数](https://leetcode.cn/problems/random-pick-with-blacklist/) | [题解](https://github.com/ITCharge/AlgoNote/tree/main/docs/solutions/0700-0799/random-pick-with-blacklist.md) | 数组、哈希表、数学、二分查找、排序、随机化 | 困难 |
658659
| [0712. 两个字符串的最小ASCII删除和](https://leetcode.cn/problems/minimum-ascii-delete-sum-for-two-strings/) | [题解](https://github.com/ITCharge/AlgoNote/tree/main/docs/solutions/0700-0799/minimum-ascii-delete-sum-for-two-strings.md) | 字符串、动态规划 | 中等 |
659660
| [0713. 乘积小于 K 的子数组](https://leetcode.cn/problems/subarray-product-less-than-k/) | [题解](https://github.com/ITCharge/AlgoNote/tree/main/docs/solutions/0700-0799/subarray-product-less-than-k.md) | 数组、二分查找、前缀和、滑动窗口 | 中等 |
660661
| [0714. 买卖股票的最佳时机含手续费](https://leetcode.cn/problems/best-time-to-buy-and-sell-stock-with-transaction-fee/) | [题解](https://github.com/ITCharge/AlgoNote/tree/main/docs/solutions/0700-0799/best-time-to-buy-and-sell-stock-with-transaction-fee.md) | 贪心、数组、动态规划 | 中等 |
@@ -683,6 +684,7 @@
683684
| [0741. 摘樱桃](https://leetcode.cn/problems/cherry-pickup/) | [题解](https://github.com/ITCharge/AlgoNote/tree/main/docs/solutions/0700-0799/cherry-pickup.md) | 数组、动态规划、矩阵 | 困难 |
684685
| [0743. 网络延迟时间](https://leetcode.cn/problems/network-delay-time/) | [题解](https://github.com/ITCharge/AlgoNote/tree/main/docs/solutions/0700-0799/network-delay-time.md) | 深度优先搜索、广度优先搜索、图、最短路、堆(优先队列) | 中等 |
685686
| [0744. 寻找比目标字母大的最小字母](https://leetcode.cn/problems/find-smallest-letter-greater-than-target/) | [题解](https://github.com/ITCharge/AlgoNote/tree/main/docs/solutions/0700-0799/find-smallest-letter-greater-than-target.md) | 数组、二分查找 | 简单 |
687+
| [0745. 前缀和后缀搜索](https://leetcode.cn/problems/prefix-and-suffix-search/) | [题解](https://github.com/ITCharge/AlgoNote/tree/main/docs/solutions/0700-0799/prefix-and-suffix-search.md) | 设计、字典树、数组、哈希表、字符串 | 困难 |
686688
| [0746. 使用最小花费爬楼梯](https://leetcode.cn/problems/min-cost-climbing-stairs/) | [题解](https://github.com/ITCharge/AlgoNote/tree/main/docs/solutions/0700-0799/min-cost-climbing-stairs.md) | 数组、动态规划 | 简单 |
687689
| [0747. 至少是其他数字两倍的最大数](https://leetcode.cn/problems/largest-number-at-least-twice-of-others/) | [题解](https://github.com/ITCharge/AlgoNote/tree/main/docs/solutions/0700-0799/largest-number-at-least-twice-of-others.md) | 数组、排序 | 简单 |
688690
| [0748. 最短补全词](https://leetcode.cn/problems/shortest-completing-word/) | [题解](https://github.com/ITCharge/AlgoNote/tree/main/docs/solutions/0700-0799/shortest-completing-word.md) | 数组、哈希表、字符串 | 简单 |
@@ -719,6 +721,7 @@
719721
| [0791. 自定义字符串排序](https://leetcode.cn/problems/custom-sort-string/) | [题解](https://github.com/ITCharge/AlgoNote/tree/main/docs/solutions/0700-0799/custom-sort-string.md) | 哈希表、字符串、排序 | 中等 |
720722
| [0792. 匹配子序列的单词数](https://leetcode.cn/problems/number-of-matching-subsequences/) | [题解](https://github.com/ITCharge/AlgoNote/tree/main/docs/solutions/0700-0799/number-of-matching-subsequences.md) | 字典树、数组、哈希表、字符串、二分查找、动态规划、排序 | 中等 |
721723
| [0793. 阶乘函数后 K 个零](https://leetcode.cn/problems/preimage-size-of-factorial-zeroes-function/) | [题解](https://github.com/ITCharge/AlgoNote/tree/main/docs/solutions/0700-0799/preimage-size-of-factorial-zeroes-function.md) | 数学、二分查找 | 困难 |
724+
| [0794. 有效的井字游戏](https://leetcode.cn/problems/valid-tic-tac-toe-state/) | [题解](https://github.com/ITCharge/AlgoNote/tree/main/docs/solutions/0700-0799/valid-tic-tac-toe-state.md) | 数组、矩阵 | 中等 |
722725
| [0795. 区间子数组个数](https://leetcode.cn/problems/number-of-subarrays-with-bounded-maximum/) | [题解](https://github.com/ITCharge/AlgoNote/tree/main/docs/solutions/0700-0799/number-of-subarrays-with-bounded-maximum.md) | 数组、双指针 | 中等 |
723726
| [0796. 旋转字符串](https://leetcode.cn/problems/rotate-string/) | [题解](https://github.com/ITCharge/AlgoNote/tree/main/docs/solutions/0700-0799/rotate-string.md) | 字符串、字符串匹配 | 简单 |
724727
| [0797. 所有可能的路径](https://leetcode.cn/problems/all-paths-from-source-to-target/) | [题解](https://github.com/ITCharge/AlgoNote/tree/main/docs/solutions/0700-0799/all-paths-from-source-to-target.md) | 深度优先搜索、广度优先搜索、图、回溯 | 中等 |

docs/others/update_time.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
## 2026-01
22

3+
- 2026-01-05 补充第 700 ~ 799 题的题目解析(增加 5 道题)
34
- 2026-01-04 补充第 700 ~ 799 题的题目解析(增加 9 道题)
45
- 2026-01-03 补充第 700 ~ 799 题的题目解析(增加 27 道题)
56
- 2026-01-02 补充第 600 ~ 699 题的题目解析(增加 34 道题)

docs/solutions/0700-0799/cheapest-flights-within-k-stops.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,13 @@
1111

1212
**描述**
1313

14-
有 $n$ 个城市通过一些航班连接。给你一个数组 $flights$,其中 $flights[i] = [from_i, to_i, price_i]$,表示该航班都从城市 $from_i$ 开始,以价格 $price_i$ 抵达 $to_i$。
14+
有 $n$ 个城市通过一些航班连接。给你一个数组 $flights$,其中 $flights[i] = [from_i, to_i, price_i]$,表示该航班都从城市 $from_i$ 开始,以价格 $price_i$ 抵达 $to_i$。
1515

1616
现在给定所有的城市和航班,以及出发城市 $src$ 和目的地 $dst$。
1717

1818
**要求**
1919

20-
找到出一条最多经过 $k$ 站中转的路线,使得从 $src$ 到 $dst$ 的「价格最便宜」,并返回该价格。如果不存在这样的路线,则输出 $-1$。
20+
找到出一条最多经过 $k$ 站中转的路线,使得从 $src$ 到 $dst$ 的「价格最便宜」,并返回该价格。如果不存在这样的路线,则输出 $-1$。
2121

2222
**说明**
2323

docs/solutions/0700-0799/delete-and-earn.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@
1111

1212
**描述**
1313

14-
给定一个整数数组 $nums$,你可以对它进行一些操作。
14+
给定一个整数数组 $nums$,你可以对它进行一些操作。
1515

16-
每次操作中,选择任意一个 $nums[i]$,删除它并获得 $nums[i]$ 的点数。之后,你必须删除所有等于 $nums[i] - 1$ 和 $nums[i] + 1$ 的元素。
16+
每次操作中,选择任意一个 $nums[i]$,删除它并获得 $nums[i]$ 的点数。之后,你必须删除所有等于 $nums[i] - 1$ 和 $nums[i] + 1$ 的元素。
1717

1818
开始你拥有 $0$ 个点数。
1919

@@ -23,7 +23,7 @@
2323

2424
**说明**
2525

26-
- $1 \le nums.length \le 2 * 10^{4}$。
26+
- $1 \le nums.length \le 2 \times 10^{4}$。
2727
- $1 \le nums[i] \le 10^{4}$。
2828

2929
**示例**

docs/solutions/0700-0799/index.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
- [0707. 设计链表](https://github.com/ITCharge/AlgoNote/tree/main/docs/solutions/0700-0799/design-linked-list.md)
1111
- [0708. 循环有序列表的插入](https://github.com/ITCharge/AlgoNote/tree/main/docs/solutions/0700-0799/insert-into-a-sorted-circular-linked-list.md)
1212
- [0709. 转换成小写字母](https://github.com/ITCharge/AlgoNote/tree/main/docs/solutions/0700-0799/to-lower-case.md)
13+
- [0710. 黑名单中的随机数](https://github.com/ITCharge/AlgoNote/tree/main/docs/solutions/0700-0799/random-pick-with-blacklist.md)
1314
- [0712. 两个字符串的最小ASCII删除和](https://github.com/ITCharge/AlgoNote/tree/main/docs/solutions/0700-0799/minimum-ascii-delete-sum-for-two-strings.md)
1415
- [0713. 乘积小于 K 的子数组](https://github.com/ITCharge/AlgoNote/tree/main/docs/solutions/0700-0799/subarray-product-less-than-k.md)
1516
- [0714. 买卖股票的最佳时机含手续费](https://github.com/ITCharge/AlgoNote/tree/main/docs/solutions/0700-0799/best-time-to-buy-and-sell-stock-with-transaction-fee.md)
@@ -38,6 +39,7 @@
3839
- [0741. 摘樱桃](https://github.com/ITCharge/AlgoNote/tree/main/docs/solutions/0700-0799/cherry-pickup.md)
3940
- [0743. 网络延迟时间](https://github.com/ITCharge/AlgoNote/tree/main/docs/solutions/0700-0799/network-delay-time.md)
4041
- [0744. 寻找比目标字母大的最小字母](https://github.com/ITCharge/AlgoNote/tree/main/docs/solutions/0700-0799/find-smallest-letter-greater-than-target.md)
42+
- [0745. 前缀和后缀搜索](https://github.com/ITCharge/AlgoNote/tree/main/docs/solutions/0700-0799/prefix-and-suffix-search.md)
4143
- [0746. 使用最小花费爬楼梯](https://github.com/ITCharge/AlgoNote/tree/main/docs/solutions/0700-0799/min-cost-climbing-stairs.md)
4244
- [0747. 至少是其他数字两倍的最大数](https://github.com/ITCharge/AlgoNote/tree/main/docs/solutions/0700-0799/largest-number-at-least-twice-of-others.md)
4345
- [0748. 最短补全词](https://github.com/ITCharge/AlgoNote/tree/main/docs/solutions/0700-0799/shortest-completing-word.md)
@@ -74,6 +76,7 @@
7476
- [0791. 自定义字符串排序](https://github.com/ITCharge/AlgoNote/tree/main/docs/solutions/0700-0799/custom-sort-string.md)
7577
- [0792. 匹配子序列的单词数](https://github.com/ITCharge/AlgoNote/tree/main/docs/solutions/0700-0799/number-of-matching-subsequences.md)
7678
- [0793. 阶乘函数后 K 个零](https://github.com/ITCharge/AlgoNote/tree/main/docs/solutions/0700-0799/preimage-size-of-factorial-zeroes-function.md)
79+
- [0794. 有效的井字游戏](https://github.com/ITCharge/AlgoNote/tree/main/docs/solutions/0700-0799/valid-tic-tac-toe-state.md)
7780
- [0795. 区间子数组个数](https://github.com/ITCharge/AlgoNote/tree/main/docs/solutions/0700-0799/number-of-subarrays-with-bounded-maximum.md)
7881
- [0796. 旋转字符串](https://github.com/ITCharge/AlgoNote/tree/main/docs/solutions/0700-0799/rotate-string.md)
7982
- [0797. 所有可能的路径](https://github.com/ITCharge/AlgoNote/tree/main/docs/solutions/0700-0799/all-paths-from-source-to-target.md)
Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
# [0745. 前缀和后缀搜索](https://leetcode.cn/problems/prefix-and-suffix-search/)
2+
3+
- 标签:设计、字典树、数组、哈希表、字符串
4+
- 难度:困难
5+
6+
## 题目链接
7+
8+
- [0745. 前缀和后缀搜索 - 力扣](https://leetcode.cn/problems/prefix-and-suffix-search/)
9+
10+
## 题目大意
11+
12+
**要求**
13+
14+
设计一个包含一些单词的特殊词典,并能够通过前缀和后缀来检索单词。
15+
16+
实现 WordFilter 类:
17+
- `WordFilter(string[] words)`:使用词典中的单词 $words$ 初始化对象。
18+
- `f(string pref, string suff)`:返回词典中具有前缀 $pref$ 和后缀 $suff$ 的单词的下标。如果存在不止一个满足要求的下标,返回其中「最大的下标」。如果不存在这样的单词,返回 $-1$。
19+
20+
**说明**
21+
22+
- $1 \le words.length \le 10^{4}$。
23+
- $1 \le words[i].length \le 7$。
24+
- $1 \le pref.length, suff.length \le 7$。
25+
- $words[i]$、$pref$ 和 $suff$ 仅由小写英文字母组成。
26+
- 最多对函数 $f$ 执行 $10^{4}$ 次调用。
27+
28+
**示例**
29+
30+
- 示例 1:
31+
32+
```python
33+
输入
34+
["WordFilter", "f"]
35+
[[["apple"]], ["a", "e"]]
36+
输出
37+
[null, 0]
38+
解释
39+
WordFilter wordFilter = new WordFilter(["apple"]);
40+
wordFilter.f("a", "e"); // 返回 0 ,因为下标为 0 的单词:前缀 prefix = "a" 且 后缀 suffix = "e"
41+
```
42+
43+
## 解题思路
44+
45+
### 思路 1:字典树(Trie)
46+
47+
使用字典树存储所有单词,同时为每个节点存储前缀和后缀的组合。
48+
49+
**实现步骤**
50+
51+
1. 对于每个单词 $word$,将所有可能的 `{suffix}#{word}` 形式插入字典树。
52+
- 例如,对于单词 `"apple"`,插入 `"e#apple"`, `"le#apple"`, `"ple#apple"`, `"pple#apple"`, `"apple#apple"`, `"#apple"`
53+
2. 查询时,将 `pref``suff` 组合成 `{suff}#{pref}`,在字典树中查找。
54+
3. 每个节点存储经过该节点的最大索引。
55+
56+
### 思路 1:代码
57+
58+
```python
59+
class TrieNode:
60+
def __init__(self):
61+
self.children = {}
62+
self.weight = -1 # 存储最大索引
63+
64+
class WordFilter:
65+
def __init__(self, words: List[str]):
66+
self.root = TrieNode()
67+
68+
# 对于每个单词,插入所有可能的 {suffix}#{word} 形式
69+
for index, word in enumerate(words):
70+
word_len = len(word)
71+
# 遍历所有后缀(包括空后缀)
72+
for i in range(word_len + 1):
73+
suffix = word[i:]
74+
# 插入 suffix#word
75+
key = suffix + '#' + word
76+
node = self.root
77+
for char in key:
78+
if char not in node.children:
79+
node.children[char] = TrieNode()
80+
node = node.children[char]
81+
node.weight = index # 更新最大索引
82+
83+
def f(self, pref: str, suff: str) -> int:
84+
# 查找 suff#pref
85+
key = suff + '#' + pref
86+
node = self.root
87+
for char in key:
88+
if char not in node.children:
89+
return -1
90+
node = node.children[char]
91+
return node.weight
92+
93+
94+
# Your WordFilter object will be instantiated and called as such:
95+
# obj = WordFilter(words)
96+
# param_1 = obj.f(pref,suff)
97+
```
98+
99+
### 思路 1:复杂度分析
100+
101+
- **时间复杂度**
102+
- 初始化:$O(n \times L^2)$,其中 $n$ 是单词数量,$L$ 是单词的平均长度。
103+
- 查询:$O(L)$,$L$ 是前缀和后缀的长度之和。
104+
- **空间复杂度**:$O(n \times L^2)$,字典树的空间。

docs/solutions/0700-0799/preimage-size-of-factorial-zeroes-function.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,15 @@
1111

1212
**描述**
1313

14-
$f(x)$ 是 $x!$ 末尾是 $0$ 的数量。回想一下 $x! = 1 \times 2 \times 3 \times ... \times x$,且 $0! = 1$。
14+
$f(x)$$x!$ 末尾是 $0$ 的数量。回想一下 $x! = 1 \times 2 \times 3 \times ... \times x$,且 $0! = 1$。
1515

1616
- 例如,$f(3) = 0$,因为 $3! = 6$ 的末尾没有 $0$;而 $f(11) = 2$,因为 $11! = 39916800$ 末端有 $2$ 个 $0$。
1717

18-
给定 k。
18+
给定 k。
1919

2020
**要求**
2121

22-
找出返回能满足 $f(x) = k$ 的非负整数 $x$ 的数量。
22+
找出返回能满足 $f(x) = k$ 的非负整数 $x$ 的数量。
2323

2424
**说明**
2525

@@ -32,7 +32,7 @@ $f(x)$ 是 $x!$ 末尾是 $0$ 的数量。回想一下 $x! = 1 \times 2 \tim
3232
```python
3333
输入:k = 0
3434
输出:5
35-
解释:0!, 1!, 2!, 3!, 和 4! 均符合 k = 0 的条件。
35+
解释:0!, 1!, 2!, 3!, 和 4! 均符合 k = 0 的条件。
3636
```
3737

3838
- 示例 2:
Lines changed: 116 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,116 @@
1+
# [0710. 黑名单中的随机数](https://leetcode.cn/problems/random-pick-with-blacklist/)
2+
3+
- 标签:数组、哈希表、数学、二分查找、排序、随机化
4+
- 难度:困难
5+
6+
## 题目链接
7+
8+
- [0710. 黑名单中的随机数 - 力扣](https://leetcode.cn/problems/random-pick-with-blacklist/)
9+
10+
## 题目大意
11+
12+
**描述**
13+
14+
给定一个整数 $n$ 和一个「无重复」黑名单整数数组 $blacklist$。设计一种算法,从 $[0, n - 1]$ 范围内的任意整数中选取一个「未加入」黑名单 $blacklist$ 的整数。任何在上述范围内且不在黑名单 $blacklist$ 中的整数都应该有「同等的可能性」被返回。
15+
16+
优化你的算法,使它最小化调用语言「内置」随机函数的次数。
17+
18+
**要求**
19+
20+
实现 Solution 类:
21+
22+
- `Solution(int n, int[] blacklist)` 初始化整数 $n$ 和被加入黑名单 $blacklist$ 的整数。
23+
- `int pick()` 返回一个范围为 $[0, n - 1]$ 且不在黑名单 $blacklist$ 中的随机整数。
24+
25+
**说明**
26+
27+
- $1 \le n \le 10^{9}$。
28+
- $0 \le blacklist.length \le min(10^{5}, n - 1)$。
29+
- $0 \le blacklist[i] \lt n$。
30+
- $blacklist$ 中所有值都不同。
31+
- $pick$ 最多被调用 $2 \times 10^{4}$ 次。
32+
33+
**示例**
34+
35+
- 示例 1:
36+
37+
```python
38+
输入
39+
["Solution", "pick", "pick", "pick", "pick", "pick", "pick", "pick"]
40+
[[7, [2, 3, 5]], [], [], [], [], [], [], []]
41+
输出
42+
[null, 0, 4, 1, 6, 1, 0, 4]
43+
44+
解释
45+
Solution solution = new Solution(7, [2, 3, 5]);
46+
solution.pick(); // 返回0,任何[0,1,4,6]的整数都可以。注意,对于每一个pick的调用,
47+
// 0146的返回概率必须相等(即概率为1/4)。
48+
solution.pick(); // 返回 4
49+
solution.pick(); // 返回 1
50+
solution.pick(); // 返回 6
51+
solution.pick(); // 返回 1
52+
solution.pick(); // 返回 0
53+
solution.pick(); // 返回 4
54+
```
55+
56+
## 解题思路
57+
58+
### 思路 1:哈希表 + 随机映射
59+
60+
将黑名单中的数字映射到 $[n - len(blacklist), n)$ 范围内的白名单数字。
61+
62+
**实现步骤**
63+
64+
1. 计算白名单的大小:$white\_count = n - len(blacklist)$。
65+
2. 将黑名单中 $\ge white\_count$ 的数字放入集合 $black\_set$。
66+
3. 对于黑名单中 $< white\_count$ 的数字,将其映射到 $[white\_count, n)$ 范围内不在黑名单中的数字。
67+
4. 随机生成 $[0, white\_count)$ 范围内的数字:
68+
- 如果在映射表中,返回映射后的值。
69+
- 否则,直接返回该数字。
70+
71+
### 思路 1:代码
72+
73+
```python
74+
class Solution:
75+
def __init__(self, n: int, blacklist: List[int]):
76+
import random
77+
self.random = random
78+
79+
# 白名单的大小
80+
self.white_count = n - len(blacklist)
81+
82+
# 黑名单中 >= white_count 的数字
83+
black_set = set()
84+
for b in blacklist:
85+
if b >= self.white_count:
86+
black_set.add(b)
87+
88+
# 映射表:将黑名单中 < white_count 的数字映射到 [white_count, n) 范围内的白名单数字
89+
self.mapping = {}
90+
white = self.white_count
91+
for b in blacklist:
92+
if b < self.white_count:
93+
# 找到下一个不在黑名单中的数字
94+
while white in black_set or white in blacklist:
95+
white += 1
96+
self.mapping[b] = white
97+
white += 1
98+
99+
def pick(self) -> int:
100+
# 随机生成 [0, white_count) 范围内的数字
101+
rand = self.random.randint(0, self.white_count - 1)
102+
# 如果在映射表中,返回映射后的值
103+
return self.mapping.get(rand, rand)
104+
105+
106+
# Your Solution object will be instantiated and called as such:
107+
# obj = Solution(n, blacklist)
108+
# param_1 = obj.pick()
109+
```
110+
111+
### 思路 1:复杂度分析
112+
113+
- **时间复杂度**
114+
- 初始化:$O(B)$,其中 $B$ 是黑名单的长度。
115+
- 查询:$O(1)$。
116+
- **空间复杂度**:$O(B)$,映射表的空间。

docs/solutions/0700-0799/reach-a-number.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,18 +16,18 @@
1616
你可以做一些数量的移动 $numMoves$:
1717

1818
- 每次你可以选择向左或向右移动。
19-
- 第 $i$ 次移动(从 $i == 1$ 开始,到 $i == numMoves$),在选择的方向上走 $i$ 步。
19+
- 第 $i$ 次移动(从 $i == 1$ 开始,到 $i == numMoves$),在选择的方向上走 $i$ 步。
2020

21-
给定整数 $target$。
21+
给定整数 $target$。
2222

2323
**要求**
2424

25-
返回 到达目标所需的 最小 移动次数(即最小 $numMoves$ ) 
25+
返回 到达目标所需的 最小 移动次数(即最小 $numMoves$ )
2626

2727

2828
**说明**
2929

30-
- $-10^{9} \le target \le 10^{9}$。
30+
- $-10^{9} \le target \le 10^{9}$。
3131
- target != 0。
3232

3333
**示例**

docs/solutions/0700-0799/reaching-points.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,13 @@
1111

1212
**描述**
1313

14-
给定四个整数 $sx$,$sy$,$tx$ 和 $ty$。
14+
给定四个整数 $sx$,$sy$,$tx$$ty$。
1515

1616
**要求**
1717

18-
如果通过一系列的转换可以从起点 $(sx, sy)$ 到达终点 $(tx, ty)$,则返回 true,否则返回 false。
18+
如果通过一系列的转换可以从起点 $(sx, sy)$ 到达终点 $(tx, ty)$,则返回 true,否则返回 false。
1919

20-
从点 $(x, y)$ 可以转换到 $(x, x+y)$  或者 $(x+y, y)$。
20+
从点 $(x, y)$ 可以转换到 $(x, x+y)$ 或者 $(x+y, y)$。
2121

2222
**说明**
2323

0 commit comments

Comments
 (0)