Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions Index/DFS.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
| [37. 解数独](https://leetcode-cn.com/problems/sudoku-solver/) | [LeetCode 题解链接](https://leetcode-cn.com/problems/sudoku-solver/solution/he-n-huang-hou-yi-yang-shi-yi-dao-hui-su-lfpd/) | 困难 | 🤩🤩🤩🤩 |
| [39. 组合总和](https://leetcode-cn.com/problems/combination-sum/) | [LeetCode 题解链接](https://leetcode-cn.com/problems/combination-sum/solution/dfs-hui-su-suan-fa-yi-ji-ru-he-que-ding-wpbo5/) | 中等 | 🤩🤩🤩🤩 |
| [40. 组合总和 II](https://leetcode-cn.com/problems/combination-sum-ii/) | [LeetCode 题解链接](https://leetcode-cn.com/problems/combination-sum-ii/solution/dfs-hui-su-jie-fa-yi-ji-ru-he-pan-duan-s-xlwy/) | 中等 | 🤩🤩🤩🤩 |
| [93. 复原 IP 地址](https://leetcode.cn/problems/restore-ip-addresses/) | [LeetCode 题解链接](https://acoier.com/2022/12/09/93.%20%E5%A4%8D%E5%8E%9F%20IP%20%E5%9C%B0%E5%9D%80%EF%BC%88%E4%B8%AD%E7%AD%89%EF%BC%89/) | 中等 | 🤩🤩🤩🤩 |
| [95. 不同的二叉搜索树 II](https://leetcode.cn/problems/unique-binary-search-trees-ii/) | [LeetCode 题解链接](https://www.acoier.com/2022/12/09/95.%20%E4%B8%8D%E5%90%8C%E7%9A%84%E4%BA%8C%E5%8F%89%E6%90%9C%E7%B4%A2%E6%A0%91%20II%EF%BC%88%E4%B8%AD%E7%AD%89%EF%BC%89/) | 中等 | 🤩🤩🤩🤩🤩 |
| [211. 添加与搜索单词 - 数据结构设计](https://leetcode-cn.com/problems/design-add-and-search-words-data-structure/) | [LeetCode 题解链接](https://leetcode-cn.com/problems/design-add-and-search-words-data-structure/solution/gong-shui-san-xie-yi-ti-shuang-jie-er-we-un94/) | 中等 | 🤩🤩🤩🤩🤩 |
| [241. 为运算表达式设计优先级](https://leetcode.cn/problems/different-ways-to-add-parentheses/) | [LeetCode 题解链接](https://leetcode.cn/problems/different-ways-to-add-parentheses/solution/by-ac_oier-z07i/) | 中等 | 🤩🤩🤩🤩🤩 |
| [282. 给表达式添加运算符](https://leetcode-cn.com/problems/expression-add-operators/) | [LeetCode 题解链接](https://leetcode-cn.com/problems/expression-add-operators/solution/gong-shui-san-xie-hui-su-suan-fa-yun-yon-nl9z/) | 困难 | 🤩🤩🤩🤩 |
Expand Down
1 change: 1 addition & 0 deletions Index/二叉树.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
| 题目 | 题解 | 难度 | 推荐指数 |
| ------------------------------------------------------------ | ------------------------------------------------------------ | ---- | -------- |
| [95. 不同的二叉搜索树 II](https://leetcode.cn/problems/unique-binary-search-trees-ii/) | [LeetCode 题解链接](https://www.acoier.com/2022/12/09/95.%20%E4%B8%8D%E5%90%8C%E7%9A%84%E4%BA%8C%E5%8F%89%E6%90%9C%E7%B4%A2%E6%A0%91%20II%EF%BC%88%E4%B8%AD%E7%AD%89%EF%BC%89/) | 中等 | 🤩🤩🤩🤩 |
| [230. 二叉搜索树中第K小的元素](https://leetcode-cn.com/problems/kth-smallest-element-in-a-bst/) | [LeetCode 题解链接](https://leetcode-cn.com/problems/kth-smallest-element-in-a-bst/solution/gong-shui-san-xie-yi-ti-san-jie-pai-xu-y-8uah/) | 中等 | 🤩🤩🤩🤩 |
| [240. 搜索二维矩阵 II](https://leetcode-cn.com/problems/search-a-2d-matrix-ii/) | [LeetCode 题解链接](https://leetcode-cn.com/problems/search-a-2d-matrix-ii/solution/gong-shui-san-xie-yi-ti-shuang-jie-er-fe-y1ns/) | 中等 | 🤩🤩🤩🤩🤩 |
| [297. 二叉树的序列化与反序列化](https://leetcode-cn.com/problems/serialize-and-deserialize-binary-tree/) | [LeetCode 题解链接](https://leetcode-cn.com/problems/xu-lie-hua-er-cha-shu-lcof/solution/gong-shui-san-xie-er-cha-shu-de-xu-lie-h-n89a/) | 困难 | 🤩🤩🤩🤩🤩 |
Expand Down
2 changes: 2 additions & 0 deletions Index/回溯算法.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
| [39. 组合总和](https://leetcode-cn.com/problems/combination-sum/) | [LeetCode 题解链接](https://leetcode-cn.com/problems/combination-sum/solution/dfs-hui-su-suan-fa-yi-ji-ru-he-que-ding-wpbo5/) | 中等 | 🤩🤩🤩🤩 |
| [40. 组合总和 II](https://leetcode-cn.com/problems/combination-sum-ii/) | [LeetCode 题解链接](https://leetcode-cn.com/problems/combination-sum-ii/solution/dfs-hui-su-jie-fa-yi-ji-ru-he-pan-duan-s-xlwy/) | 中等 | 🤩🤩🤩🤩 |
| [90. 子集 II](https://leetcode-cn.com/problems/subsets-ii/) | [LeetCode 题解链接](https://leetcode-cn.com/problems/subsets-ii/solution/gong-shui-san-xie-yi-ti-shuang-jie-hui-s-g77q/) | 中等 | 🤩🤩🤩🤩 |
| [93. 复原 IP 地址](https://leetcode.cn/problems/restore-ip-addresses/) | [LeetCode 题解链接](https://acoier.com/2022/12/09/93.%20%E5%A4%8D%E5%8E%9F%20IP%20%E5%9C%B0%E5%9D%80%EF%BC%88%E4%B8%AD%E7%AD%89%EF%BC%89/) | 中等 | 🤩🤩🤩🤩 |
| [95. 不同的二叉搜索树 II](https://leetcode.cn/problems/unique-binary-search-trees-ii/) | [LeetCode 题解链接](https://www.acoier.com/2022/12/09/95.%20%E4%B8%8D%E5%90%8C%E7%9A%84%E4%BA%8C%E5%8F%89%E6%90%9C%E7%B4%A2%E6%A0%91%20II%EF%BC%88%E4%B8%AD%E7%AD%89%EF%BC%89/) | 中等 | 🤩🤩🤩🤩🤩 |
| [131. 分割回文串](https://leetcode-cn.com/problems/palindrome-partitioning/) | [LeetCode 题解链接](https://leetcode-cn.com/problems/palindrome-partitioning/solution/wei-sha-yao-zhe-yang-bao-sou-ya-shi-ru-h-41gf/) | 中等 | 🤩🤩🤩🤩 |
| [212. 单词搜索 II](https://leetcode-cn.com/problems/word-search-ii/) | [LeetCode 题解链接](https://leetcode-cn.com/problems/word-search-ii/solution/gong-shui-san-xie-yi-ti-shuang-jie-hui-s-am8f/) | 困难 | 🤩🤩🤩 |
| [301. 删除无效的括号](https://leetcode-cn.com/problems/remove-invalid-parentheses/) | [LeetCode 题解链接](https://leetcode-cn.com/problems/remove-invalid-parentheses/solution/yi-fen-zhong-nei-kan-dong-jiang-gua-hao-aya6k/) | 困难 | 🤩🤩🤩🤩 |
Expand Down
1 change: 1 addition & 0 deletions Index/数学.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@
| [1720. 解码异或后的数组](https://leetcode-cn.com/problems/decode-xored-array/) | [LeetCode 题解链接](https://leetcode-cn.com/problems/decode-xored-array/solution/gong-shui-san-xie-li-yong-yi-huo-xing-zh-p1bi/) | 简单 | 🤩🤩🤩 |
| [1734. 解码异或后的排列](https://leetcode-cn.com/problems/decode-xored-permutation/) | [LeetCode 题解链接](https://leetcode-cn.com/problems/decode-xored-permutation/solution/gong-shui-san-xie-note-bie-pian-li-yong-zeh6o/) | 中等 | 🤩🤩🤩🤩 |
| [1738. 找出第 K 大的异或坐标值](https://leetcode-cn.com/problems/find-kth-largest-xor-coordinate-value/) | [LeetCode 题解链接](https://leetcode-cn.com/problems/find-kth-largest-xor-coordinate-value/solution/gong-shui-san-xie-xiang-jie-li-yong-er-w-ai0d/) | 中等 | 🤩🤩🤩 |
| [1775. 通过最少操作次数使数组的和相等](https://leetcode.cn/problems/equal-sum-arrays-with-minimum-number-of-operations/) | [LeetCode 题解链接](https://acoier.com/2022/12/09/1775.%20%E9%80%9A%E8%BF%87%E6%9C%80%E5%B0%91%E6%93%8D%E4%BD%9C%E6%AC%A1%E6%95%B0%E4%BD%BF%E6%95%B0%E7%BB%84%E7%9A%84%E5%92%8C%E7%9B%B8%E7%AD%89%EF%BC%88%E4%B8%AD%E7%AD%89%EF%BC%89/) | 中等 | 🤩🤩🤩🤩 |
| [剑指 Offer 44. 数字序列中某一位的数字](https://leetcode.cn/problems/shu-zi-xu-lie-zhong-mou-yi-wei-de-shu-zi-lcof/) | [LeetCode 题解链接](https://leetcode.cn/problems/shu-zi-xu-lie-zhong-mou-yi-wei-de-shu-zi-lcof/solution/by-ac_oier-wgr8/) | 中等 | 🤩🤩🤩🤩 |
| [面试题 10.02. 变位词组](https://leetcode-cn.com/problems/group-anagrams-lcci/) | [LeetCode 题解链接](https://leetcode-cn.com/problems/group-anagrams-lcci/solution/gong-shui-san-xie-tong-ji-bian-wei-ci-de-0iqe/) | 中等 | 🤩🤩🤩🤩 |
| [面试题 17.19. 消失的两个数字](https://leetcode.cn/problems/missing-two-lcci/) | [LeetCode 题解链接](https://leetcode.cn/problems/missing-two-lcci/solution/by-ac_oier-pgeh/) | 困难 | 🤩🤩🤩🤩 |
Expand Down
1 change: 1 addition & 0 deletions Index/贪心算法.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
| [1710. 卡车上的最大单元数](https://leetcode.cn/problems/maximum-units-on-a-truck/) | [LeetCode 题解链接](https://leetcode.cn/problems/maximum-units-on-a-truck/solution/by-ac_oier-5wlo/) | 简单 | 🤩🤩🤩🤩🤩 |
| [1713. 得到子序列的最少操作次数](https://leetcode-cn.com/problems/minimum-operations-to-make-a-subsequence/) | [LeetCode 题解链接](https://leetcode-cn.com/problems/minimum-operations-to-make-a-subsequence/solution/gong-shui-san-xie-noxiang-xin-ke-xue-xi-oj7yu/) | 困难 | 🤩🤩🤩🤩🤩 |
| [1736. 替换隐藏数字得到的最晚时间](https://leetcode-cn.com/problems/latest-time-by-replacing-hidden-digits/) | [LeetCode 题解链接](https://leetcode-cn.com/problems/latest-time-by-replacing-hidden-digits/solution/gong-shui-san-xie-ti-huan-yin-cang-shu-z-2l1h/) | 简单 | 🤩🤩🤩🤩🤩 |
| [1775. 通过最少操作次数使数组的和相等](https://leetcode.cn/problems/equal-sum-arrays-with-minimum-number-of-operations/) | [LeetCode 题解链接](https://acoier.com/2022/12/09/1775.%20%E9%80%9A%E8%BF%87%E6%9C%80%E5%B0%91%E6%93%8D%E4%BD%9C%E6%AC%A1%E6%95%B0%E4%BD%BF%E6%95%B0%E7%BB%84%E7%9A%84%E5%92%8C%E7%9B%B8%E7%AD%89%EF%BC%88%E4%B8%AD%E7%AD%89%EF%BC%89/) | 中等 | 🤩🤩🤩🤩 |
| [1833. 雪糕的最大数量](https://leetcode-cn.com/problems/maximum-ice-cream-bars/) | [LeetCode 题解链接](https://leetcode-cn.com/problems/maximum-ice-cream-bars/solution/gong-shui-san-xie-noxiang-xin-ke-xue-xi-yrhjx/) | 中等 | 🤩🤩🤩🤩🤩 |
| [1846. 减小和重新排列数组后的最大元素](https://leetcode-cn.com/problems/maximum-element-after-decreasing-and-rearranging/) | [LeetCode 题解链接](https://leetcode-cn.com/problems/maximum-element-after-decreasing-and-rearranging/solution/gong-shui-san-xie-noxiang-xin-ke-xue-xi-yh9qt/) | 中等 | 🤩🤩🤩🤩🤩 |
| [1877. 数组中最大数对和的最小值](https://leetcode-cn.com/problems/minimize-maximum-pair-sum-in-array/) | [LeetCode 题解链接](https://leetcode-cn.com/problems/minimize-maximum-pair-sum-in-array/solution/gong-shui-san-xie-noxiang-xin-ke-xue-xi-ru29y/) | 中等 | 🤩🤩🤩🤩🤩 |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ Tag : 「哈希表」、「双指针」、「模拟」



存在一个由 n 个不同元素组成的整数数组 nums ,但你已经记不清具体内容。好在你还记得 nums 中的每一对相邻元素。
存在一个由 `n` 个不同元素组成的整数数组 `nums` ,但你已经记不清具体内容。好在你还记得 `nums` 中的每一对相邻元素。

给你一个二维整数数组 adjacentPairs ,大小为 n - 1 ,其中每个 adjacentPairs[i] = [ui, vi] 表示元素 uivi 在 nums 中相邻。
给你一个二维整数数组 `adjacentPairs` ,大小为 `n - 1` ,其中每个 $adjacentPairs[i] = [u_i, v_i]$ 表示元素 $u_i$$v_i$`nums` 中相邻。

题目数据保证所有由元素 nums[i] 和 nums[i+1] 组成的相邻元素对都存在于 adjacentPairs 中,存在形式可能是 [nums[i], nums[i+1]] ,也可能是 [nums[i+1], nums[i]] 。这些相邻元素对可以 按任意顺序 出现。
题目数据保证所有由元素 `nums[i]``nums[i+1]` 组成的相邻元素对都存在于 `adjacentPairs` 中,存在形式可能是 `[nums[i], nums[i+1]]` ,也可能是 `[nums[i+1], nums[i]]` 。这些相邻元素对可以 按任意顺序 出现。

返回 原始数组 nums 。如果存在多种解答,返回 其中任意一个 即可。
返回 原始数组 `nums` 。如果存在多种解答,返回 其中任意一个 即可。

示例 1:
```
Expand Down Expand Up @@ -40,12 +40,12 @@ Tag : 「哈希表」、「双指针」、「模拟」
```

提示:
* nums.length == n
* adjacentPairs.length == n - 1
* adjacentPairs[i].length == 2
* 2 <= n <= $10^5$
* -$10^5$ <= nums[i], ui, vi <= $10^5$
* 题目数据保证存在一些以 adjacentPairs 作为元素对的数组
* $nums.length == n$
* $adjacentPairs.length == n - 1$
* $adjacentPairs[i].length == 2$
* $2 <= n <= 10^5$
* $-10^5 <= nums[i], u_i, v_i <= 10^5$
* 题目数据保证存在一些以 `adjacentPairs` 作为元素对的数组

---

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,160 @@
### 题目描述

这是 LeetCode 上的 **[1775. 通过最少操作次数使数组的和相等量](https://www.acoier.com/2022/12/09/1775.%20%E9%80%9A%E8%BF%87%E6%9C%80%E5%B0%91%E6%93%8D%E4%BD%9C%E6%AC%A1%E6%95%B0%E4%BD%BF%E6%95%B0%E7%BB%84%E7%9A%84%E5%92%8C%E7%9B%B8%E7%AD%89%EF%BC%88%E4%B8%AD%E7%AD%89%EF%BC%89/)** ,难度为 **中等**。

Tag : 「枚举」、「贪心」、「数学」



给你两个长度可能不等的整数数组 `nums1` 和 `nums2` 。两个数组中的所有值都在 `1` 到 `6` 之间(包含 `1` 和 `6`)。

每次操作中,你可以选择 任意 数组中的任意一个整数,将它变成 `1` 到 `6` 之间 任意 的值(包含 `1` 和 `6`)。

请你返回使 `nums1` 中所有数的和与 `nums2` 中所有数的和相等的最少操作次数。如果无法使两个数组的和相等,请返回 `-1` 。

示例 1:
```
输入:nums1 = [1,2,3,4,5,6], nums2 = [1,1,2,2,2,2]

输出:3

解释:你可以通过 3 次操作使 nums1 中所有数的和与 nums2 中所有数的和相等。以下数组下标都从 0 开始。
- 将 nums2[0] 变为 6 。 nums1 = [1,2,3,4,5,6], nums2 = [6,1,2,2,2,2] 。
- 将 nums1[5] 变为 1 。 nums1 = [1,2,3,4,5,1], nums2 = [6,1,2,2,2,2] 。
- 将 nums1[2] 变为 2 。 nums1 = [1,2,2,4,5,1], nums2 = [6,1,2,2,2,2] 。
```
示例 2:
```
输入:nums1 = [1,1,1,1,1,1,1], nums2 = [6]

输出:-1

解释:没有办法减少 nums1 的和或者增加 nums2 的和使二者相等。
```
示例 3:
```
输入:nums1 = [6,6], nums2 = [1]

输出:3

解释:你可以通过 3 次操作使 nums1 中所有数的和与 nums2 中所有数的和相等。以下数组下标都从 0 开始。
- 将 nums1[0] 变为 2 。 nums1 = [2,6], nums2 = [1] 。
- 将 nums1[1] 变为 2 。 nums1 = [2,2], nums2 = [1] 。
- 将 nums2[0] 变为 4 。 nums1 = [2,2], nums2 = [4] 。
```

提示:
* $1 <= nums1.length, nums2.length <= 10^5$
* $1 <= nums1[i], nums2[i] <= 6$

---

### 枚举 + 贪心 + 数学

令 `nums1` 的长度为 `n`,`nums2` 的长度为 `m`,根据题意两数组的值域分别为 $[n, 6n]$ 和 $[m, 6m]$,可分别视为数轴上的两条线段。

为了方便,我们人为固定 $n\leq m$,若不满足则交换两数组,返回 `minOperations(nums2, nums1)` 即可。

先来考虑无解的情况:当 $6n < m$ 时,说明两线段不重合,必然无法通过变换使得总和相等,直接返回 `-1`。

由于 $\max(n, m)$ 的范围为 $1e5$,且 $nums[i]$ 的值域大小 $C = 6$,因此我们可以通过枚举最终目标和 `x`(两线段的重合部分)来做,枚举范围不超过 $6 \times 1e5$。

于是问题转换为:**对于一个原总和为 `sum` 的数组 `nums` 而言,按照题目的变换规则,至少经过多少次变换,才能将其总和变为 `x`**。

根据原总和 `sum` 和目标结果 `x` 的大小关系进行分情况讨论(将两者差值绝对值记为 `d`):

* 当 $sum < x$ 时,对于原数为 $nums[i]$ 的数而言,其能变为不超过 $nums[i] - 1$ 的任意数。

例如 $6$ 能够变化为 $[1, 5]$ 中的任意数,即单个数值 $6$ 最多能够抵消 $6 - 1$ 个差值,不失一般性的可概括为原数为 $nums[i]$ 所能抵消的差值为 $nums[i] - 1$。

因此,我们贪心的使用较大数进行变换(从 $6$ 往 $2$ 枚举 `i`),对于每个数值 `i` 而言,其所能提供的个数为 $\min(\left \lceil \frac{d}{i - 1} \right \rceil, cnst[i])$。

* 当 $sum > x$ 时,同理,原数为 $nums[i]$ 所能提供的最大抵消数为 $6 - nums[i]$,因此我们贪心使用较小数进行变换(从 $1$ 往 $5$ 枚举 `i`),对于每个数值 `i` 而言,其所能提供的个数为 $\min(\left \lceil \frac{d}{6 - i} \right \rceil, cnst[i])$。

如此一来,我们通过枚举两线段重合点 `x`,复杂度为 $O(C \times \max(n, m))$,并通过复杂度为 $O(C)$ 的数学方法来得知将两原数组总和变为 `x` 所需要的操作次数 `cnt`,在所有的 `cnt` 取最小值即是答案。整体计算量为 $3.6 \times 10^6$,可以过。


Java 代码:
```Java
class Solution {
int[] c1 = new int[10], c2 = new int[10];
int s1, s2;
public int minOperations(int[] nums1, int[] nums2) {
int n = nums1.length, m = nums2.length;
if (n > m) return minOperations(nums2, nums1);
if (m > 6 * n) return -1;
for (int x : nums1) {
c1[x]++; s1 += x;
}
for (int x : nums2) {
c2[x]++; s2 += x;
}
int ans = n + m;
for (int i = m; i <= 6 * n; i++) ans = Math.min(ans, getCnt(c1, s1, i) + getCnt(c2, s2, i));
return ans;
}
int getCnt(int[] cnts, int sum, int x) {
int ans = 0;
if (sum > x) {
for (int i = 6, d = sum - x; i >= 2 && d > 0; i--) {
int c = Math.min((int) Math.ceil(d * 1.0 / (i - 1)), cnts[i]);
ans += c; d -= c * (i - 1);
}
} else if (sum < x) {
for (int i = 1, d = x - sum; i <= 5 && d > 0; i++) {
int c = Math.min((int) Math.ceil(d * 1.0 / (6 - i)), cnts[i]);
ans += c; d -= c * (6 - i);
}
}
return ans;
}
}
```
Python 代码:
```Python
class Solution:
def minOperations(self, nums1: List[int], nums2: List[int]) -> int:
n, m = len(nums1), len(nums2)
if n > m:
return self.minOperations(nums2, nums1)
if m > 6 * n:
return -1
c1, c2 = Counter(nums1), Counter(nums2)
s1, s2 = sum(nums1), sum(nums2)
def getCnt(cnts, tot, x):
ans = 0
if tot > x:
d = tot - x
for i in range(6, 1, -1):
if d <= 0:
break
c = min(math.ceil(d / (i - 1)), cnts[i])
ans, d = ans + c, d - c * (i - 1)
elif tot < x:
d = x - tot
for i in range(1, 6):
if d <= 0:
break
c = min(math.ceil(d / (6 - i)), cnts[i])
ans, d = ans + c, d - c * (6 - i)
return ans
ans = n + m
for i in range(m, 6 * n + 1):
ans = min(ans, getCnt(c1, s1, i) + getCnt(c2, s2, i))
return ans
```
* 时间复杂度:$O(C \times \max(n, m) \times C)$,其中 $C = 6$ 为 $nums[i]$ 的值域大小
* 空间复杂度:$O(C)$

---

### 最后

这是我们「刷穿 LeetCode」系列文章的第 `No.1775` 篇,系列开始于 2021/01/01,截止于起始日 LeetCode 上共有 1916 道题目,部分是有锁题,我们将先把所有不带锁的题目刷完。

在这个系列文章里面,除了讲解解题思路以外,还会尽可能给出最为简洁的代码。如果涉及通解还会相应的代码模板。

为了方便各位同学能够电脑上进行调试和提交代码,我建立了相关的仓库:https://github.com/SharingSource/LogicStack-LeetCode 。

在仓库地址里,你可以看到系列文章的题解链接、系列文章的相应代码、LeetCode 原题链接和其他优选题解。

4 changes: 2 additions & 2 deletions LeetCode/411-420/413. 等差数列划分(中等).md
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ Tag : 「双指针」、「模拟」、「数学」
```

提示:
* 1 <= nums.length <= 5000
* -1000 <= nums[i] <= 1000
* $1 <= nums.length <= 5000$
* $-1000 <= nums[i] <= 1000$

---

Expand Down
Loading