Skip to content

Commit 31c18df

Browse files
committed
feat: add solutions to lc problem: No.0279. Perfect Squares
1 parent c07136b commit 31c18df

File tree

11 files changed

+125
-82
lines changed

11 files changed

+125
-82
lines changed

README.md

+1
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,7 @@
202202
- [零钱兑换 II](./solution/0500-0599/0518.Coin%20Change%202/README.md)
203203
- [组合总和 Ⅳ](./solution/0300-0399/0377.Combination%20Sum%20IV/README.md)
204204
- [整数拆分](./solution/0300-0399/0343.Integer%20Break/README.md)
205+
- [完全平方数](./solution/0200-0299/0279.Perfect%20Squares/README.md)
205206
- [礼物的最大价值](./lcof/面试题47.%20礼物的最大价值/README.md)
206207
- [俄罗斯套娃信封问题](./solution/0300-0399/0354.Russian%20Doll%20Envelopes/README.md)
207208

README_EN.md

+1
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,7 @@ Complete solutions to [LeetCode](https://leetcode.com/problemset/all/), [LCOF](h
196196
- [Coin Change 2](./solution/0500-0599/0518.Coin%20Change%202/README_EN.md)
197197
- [Combination Sum IV](./solution/0300-0399/0377.Combination%20Sum%20IV/README_EN.md)
198198
- [Integer Break](./solution/0300-0399/0343.Integer%20Break/README_EN.md)
199+
- [Perfect Squares](./solution/0200-0299/0279.Perfect%20Squares/README_EN.md)
199200
- [Russian Doll Envelopes](./solution/0300-0399/0354.Russian%20Doll%20Envelopes/README_EN.md)
200201

201202
### Backtracking

solution/0200-0299/0279.Perfect Squares/README.md

+38-26
Original file line numberDiff line numberDiff line change
@@ -51,14 +51,14 @@
5151
```python
5252
class Solution:
5353
def numSquares(self, n: int) -> int:
54-
dp = [0 for i in range(n + 1)]
54+
dp = [0] * (n + 1)
5555
for i in range(1, n + 1):
56-
j, mi = 1, 0x3f3f3f3f
56+
j, mi = 1, float('inf')
5757
while j * j <= i:
5858
mi = min(mi, dp[i - j * j])
5959
j += 1
6060
dp[i] = mi + 1
61-
return dp[n]
61+
return dp[-1]
6262
```
6363

6464
### **Java**
@@ -68,20 +68,38 @@ class Solution:
6868
```java
6969
class Solution {
7070
public int numSquares(int n) {
71-
List<Integer> ans = new ArrayList<>();
72-
ans.add(0);
73-
while (ans.size() <= n) {
74-
int m = ans.size(), val = Integer.MAX_VALUE;
75-
for (int i = 1; i * i <= m; i++) {
76-
val = Math.min(val, ans.get(m - i * i) + 1);
71+
int[] dp = new int[n + 1];
72+
for (int i = 1; i <= n; ++i) {
73+
int mi = Integer.MAX_VALUE;
74+
for (int j = 1; j * j <= i; ++j) {
75+
mi = Math.min(mi, dp[i - j * j]);
7776
}
78-
ans.add(val);
77+
dp[i] = mi + 1;
7978
}
80-
return ans.get(n);
79+
return dp[n];
8180
}
8281
}
8382
```
8483

84+
### **C++**
85+
86+
```cpp
87+
class Solution {
88+
public:
89+
int numSquares(int n) {
90+
vector<int> dp(n + 1);
91+
for (int i = 1; i <= n; ++i) {
92+
int mi = 100000;
93+
for (int j = 1; j * j <= i; ++j) {
94+
mi = min(mi, dp[i - j * j]);
95+
}
96+
dp[i] = mi + 1;
97+
}
98+
return dp[n];
99+
}
100+
};
101+
```
102+
85103
### **TypeScript**
86104
87105
```ts
@@ -101,29 +119,23 @@ function numSquares(n: number): number {
101119
### **Go**
102120

103121
```go
104-
/*
105-
* @lc app=leetcode.cn id=279 lang=golang
106-
* 动态规划的思路,状态转移方程:dp[n] = min(dp[n-1*1]+1, dp[n-2*2]+1, ..., dp[n-k*k]+1), ( 0< k*k <=n )
107-
*/
108122
func numSquares(n int) int {
109-
if n <= 0 {
110-
return 0
111-
}
112-
dp := make([]int, n+1) // 多申请了一份整形,使代码更容易理解, dp[n] 就是 n 的完全平方数的求解
123+
dp := make([]int, n+1)
113124
for i := 1; i <= n; i++ {
114-
dp[i] = i // 初始值 dp[n] 的最大值的解,也是最容易求的解
115-
for j := 0; j*j <= i; j++ {
116-
dp[i] = minInt(dp[i-j*j]+1, dp[i])
125+
mi := 100000
126+
for j := 1; j*j <= i; j++ {
127+
mi = min(mi, dp[i-j*j])
117128
}
129+
dp[i] = mi + 1
118130
}
119131
return dp[n]
120132
}
121133

122-
func minInt(x, y int) int {
123-
if x < y {
124-
return x
134+
func min(a, b int) int {
135+
if a < b {
136+
return a
125137
}
126-
return y
138+
return b
127139
}
128140
```
129141

solution/0200-0299/0279.Perfect Squares/README_EN.md

+38-26
Original file line numberDiff line numberDiff line change
@@ -44,35 +44,53 @@ For dynamic programming, define `dp[i]` to represent the least number of perfect
4444
```python
4545
class Solution:
4646
def numSquares(self, n: int) -> int:
47-
dp = [0 for i in range(n + 1)]
47+
dp = [0] * (n + 1)
4848
for i in range(1, n + 1):
49-
j, mi = 1, 0x3f3f3f3f
49+
j, mi = 1, float('inf')
5050
while j * j <= i:
5151
mi = min(mi, dp[i - j * j])
5252
j += 1
5353
dp[i] = mi + 1
54-
return dp[n]
54+
return dp[-1]
5555
```
5656

5757
### **Java**
5858

5959
```java
6060
class Solution {
6161
public int numSquares(int n) {
62-
List<Integer> ans = new ArrayList<>();
63-
ans.add(0);
64-
while (ans.size() <= n) {
65-
int m = ans.size(), val = Integer.MAX_VALUE;
66-
for (int i = 1; i * i <= m; i++) {
67-
val = Math.min(val, ans.get(m - i * i) + 1);
62+
int[] dp = new int[n + 1];
63+
for (int i = 1; i <= n; ++i) {
64+
int mi = Integer.MAX_VALUE;
65+
for (int j = 1; j * j <= i; ++j) {
66+
mi = Math.min(mi, dp[i - j * j]);
6867
}
69-
ans.add(val);
68+
dp[i] = mi + 1;
7069
}
71-
return ans.get(n);
70+
return dp[n];
7271
}
7372
}
7473
```
7574

75+
### **C++**
76+
77+
```cpp
78+
class Solution {
79+
public:
80+
int numSquares(int n) {
81+
vector<int> dp(n + 1);
82+
for (int i = 1; i <= n; ++i) {
83+
int mi = 100000;
84+
for (int j = 1; j * j <= i; ++j) {
85+
mi = min(mi, dp[i - j * j]);
86+
}
87+
dp[i] = mi + 1;
88+
}
89+
return dp[n];
90+
}
91+
};
92+
```
93+
7694
### **TypeScript**
7795
7896
```ts
@@ -92,29 +110,23 @@ function numSquares(n: number): number {
92110
### **Go**
93111

94112
```go
95-
/*
96-
* @lc app=leetcode.cn id=279 lang=golang
97-
* 动态规划的思路,状态转移方程:dp[n] = min(dp[n-1*1]+1, dp[n-2*2]+1, ..., dp[n-k*k]+1), ( 0< k*k <=n )
98-
*/
99113
func numSquares(n int) int {
100-
if n <= 0 {
101-
return 0
102-
}
103-
dp := make([]int, n+1) // 多申请了一份整形,使代码更容易理解, dp[n] 就是 n 的完全平方数的求解
114+
dp := make([]int, n+1)
104115
for i := 1; i <= n; i++ {
105-
dp[i] = i // 初始值 dp[n] 的最大值的解,也是最容易求的解
106-
for j := 0; j*j <= i; j++ {
107-
dp[i] = minInt(dp[i-j*j]+1, dp[i])
116+
mi := 100000
117+
for j := 1; j*j <= i; j++ {
118+
mi = min(mi, dp[i-j*j])
108119
}
120+
dp[i] = mi + 1
109121
}
110122
return dp[n]
111123
}
112124

113-
func minInt(x, y int) int {
114-
if x < y {
115-
return x
125+
func min(a, b int) int {
126+
if a < b {
127+
return a
116128
}
117-
return y
129+
return b
118130
}
119131
```
120132

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
class Solution {
2+
public:
3+
int numSquares(int n) {
4+
vector<int> dp(n + 1);
5+
for (int i = 1; i <= n; ++i) {
6+
int mi = 100000;
7+
for (int j = 1; j * j <= i; ++j) {
8+
mi = min(mi, dp[i - j * j]);
9+
}
10+
dp[i] = mi + 1;
11+
}
12+
return dp[n];
13+
}
14+
};
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,18 @@
1-
/*
2-
* @lc app=leetcode.cn id=279 lang=golang
3-
* 动态规划的思路,状态转移方程:dp[n] = min(dp[n-1*1]+1, dp[n-2*2]+1, ..., dp[n-k*k]+1), ( 0< k*k <=n )
4-
*/
51
func numSquares(n int) int {
6-
if n <= 0 {
7-
return 0
8-
}
9-
dp := make([]int, n+1) // 多申请了一份整形,使代码更容易理解, dp[n] 就是 n 的完全平方数的求解
2+
dp := make([]int, n+1)
103
for i := 1; i <= n; i++ {
11-
dp[i] = i // 初始值 dp[n] 的最大值的解,也是最容易求的解
12-
for j := 0; j*j <= i; j++ {
13-
dp[i] = minInt(dp[i-j*j]+1, dp[i])
4+
mi := 100000
5+
for j := 1; j*j <= i; j++ {
6+
mi = min(mi, dp[i-j*j])
147
}
8+
dp[i] = mi + 1
159
}
1610
return dp[n]
1711
}
1812

19-
func minInt(x, y int) int {
20-
if x < y {
21-
return x
13+
func min(a, b int) int {
14+
if a < b {
15+
return a
2216
}
23-
return y
17+
return b
2418
}
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
11
class Solution {
22
public int numSquares(int n) {
3-
List<Integer> ans = new ArrayList<>();
4-
ans.add(0);
5-
while (ans.size() <= n) {
6-
int m = ans.size(), val = Integer.MAX_VALUE;
7-
for (int i = 1; i * i <= m; i++) {
8-
val = Math.min(val, ans.get(m - i * i) + 1);
3+
int[] dp = new int[n + 1];
4+
for (int i = 1; i <= n; ++i) {
5+
int mi = Integer.MAX_VALUE;
6+
for (int j = 1; j * j <= i; ++j) {
7+
mi = Math.min(mi, dp[i - j * j]);
98
}
10-
ans.add(val);
9+
dp[i] = mi + 1;
1110
}
12-
return ans.get(n);
11+
return dp[n];
1312
}
14-
}
13+
}
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
class Solution:
22
def numSquares(self, n: int) -> int:
3-
dp = [0 for i in range(n + 1)]
3+
dp = [0] * (n + 1)
44
for i in range(1, n + 1):
5-
j, mi = 1, 0x3f3f3f3f
5+
j, mi = 1, float('inf')
66
while j * j <= i:
77
mi = min(mi, dp[i - j * j])
88
j += 1
99
dp[i] = mi + 1
10-
return dp[n]
10+
return dp[-1]

solution/README.md

+6-1
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,7 @@
185185
| [0172](https://leetcode-cn.com/problems/factorial-trailing-zeroes) | [阶乘后的零](/solution/0100-0199/0172.Factorial%20Trailing%20Zeroes/README.md) | `数学` | 简单 | |
186186
| [0173](https://leetcode-cn.com/problems/binary-search-tree-iterator) | [二叉搜索树迭代器](/solution/0100-0199/0173.Binary%20Search%20Tree%20Iterator/README.md) | ``,``,`设计`,`二叉搜索树`,`二叉树`,`迭代器` | 中等 | |
187187
| [0174](https://leetcode-cn.com/problems/dungeon-game) | [地下城游戏](/solution/0100-0199/0174.Dungeon%20Game/README.md) | `数组`,`动态规划`,`矩阵` | 困难 | |
188+
| [0175](https://leetcode-cn.com/problems/combine-two-tables) | [组合两个表](/solution/0100-0199/0175.Combine%20Two%20Tables/README.md) | `数据库` | 简单 | |
188189
| [0176](https://leetcode-cn.com/problems/second-highest-salary) | [第二高的薪水](/solution/0100-0199/0176.Second%20Highest%20Salary/README.md) | `数据库` | 简单 | |
189190
| [0177](https://leetcode-cn.com/problems/nth-highest-salary) | [第N高的薪水](/solution/0100-0199/0177.Nth%20Highest%20Salary/README.md) | `数据库` | 中等 | |
190191
| [0178](https://leetcode-cn.com/problems/rank-scores) | [分数排名](/solution/0100-0199/0178.Rank%20Scores/README.md) | `数据库` | 中等 | |
@@ -242,6 +243,7 @@
242243
| [0230](https://leetcode-cn.com/problems/kth-smallest-element-in-a-bst) | [二叉搜索树中第K小的元素](/solution/0200-0299/0230.Kth%20Smallest%20Element%20in%20a%20BST/README.md) | ``,`深度优先搜索`,`二叉搜索树`,`二叉树` | 中等 | |
243244
| [0231](https://leetcode-cn.com/problems/power-of-two) | [2 的幂](/solution/0200-0299/0231.Power%20of%20Two/README.md) | `位运算`,`递归`,`数学` | 简单 | |
244245
| [0232](https://leetcode-cn.com/problems/implement-queue-using-stacks) | [用栈实现队列](/solution/0200-0299/0232.Implement%20Queue%20using%20Stacks/README.md) | ``,`设计`,`队列` | 简单 | |
246+
| [0233](https://leetcode-cn.com/problems/number-of-digit-one) | [数字 1 的个数](/solution/0200-0299/0233.Number%20of%20Digit%20One/README.md) | `递归`,`数学`,`动态规划` | 困难 | |
245247
| [0234](https://leetcode-cn.com/problems/palindrome-linked-list) | [回文链表](/solution/0200-0299/0234.Palindrome%20Linked%20List/README.md) | ``,`递归`,`链表`,`双指针` | 简单 | |
246248
| [0235](https://leetcode-cn.com/problems/lowest-common-ancestor-of-a-binary-search-tree) | [二叉搜索树的最近公共祖先](/solution/0200-0299/0235.Lowest%20Common%20Ancestor%20of%20a%20Binary%20Search%20Tree/README.md) | ``,`深度优先搜索`,`二叉搜索树`,`二叉树` | 简单 | |
247249
| [0236](https://leetcode-cn.com/problems/lowest-common-ancestor-of-a-binary-tree) | [二叉树的最近公共祖先](/solution/0200-0299/0236.Lowest%20Common%20Ancestor%20of%20a%20Binary%20Tree/README.md) | ``,`深度优先搜索`,`二叉树` | 中等 | |
@@ -599,6 +601,7 @@
599601
| [0588](https://leetcode-cn.com/problems/design-in-memory-file-system) | [设计内存文件系统](/solution/0500-0599/0588.Design%20In-Memory%20File%20System/README.md) | `设计`,`字典树`,`哈希表`,`字符串` | 困难 | 🔒 |
600602
| [0589](https://leetcode-cn.com/problems/n-ary-tree-preorder-traversal) | [N 叉树的前序遍历](/solution/0500-0599/0589.N-ary%20Tree%20Preorder%20Traversal/README.md) | ``,``,`深度优先搜索` | 简单 | |
601603
| [0590](https://leetcode-cn.com/problems/n-ary-tree-postorder-traversal) | [N 叉树的后序遍历](/solution/0500-0599/0590.N-ary%20Tree%20Postorder%20Traversal/README.md) | ``,``,`深度优先搜索` | 简单 | |
604+
| [0591](https://leetcode-cn.com/problems/tag-validator) | [标签验证器](/solution/0500-0599/0591.Tag%20Validator/README.md) | ``,`字符串` | 困难 | |
602605
| [0592](https://leetcode-cn.com/problems/fraction-addition-and-subtraction) | [分数加减运算](/solution/0500-0599/0592.Fraction%20Addition%20and%20Subtraction/README.md) | `数学`,`字符串`,`模拟` | 中等 | |
603606
| [0593](https://leetcode-cn.com/problems/valid-square) | [有效的正方形](/solution/0500-0599/0593.Valid%20Square/README.md) | `几何`,`数学` | 中等 | |
604607
| [0594](https://leetcode-cn.com/problems/longest-harmonious-subsequence) | [最长和谐子序列](/solution/0500-0599/0594.Longest%20Harmonious%20Subsequence/README.md) | `数组`,`哈希表`,`排序` | 简单 | |
@@ -898,6 +901,7 @@
898901
| [0888](https://leetcode-cn.com/problems/fair-candy-swap) | [公平的糖果棒交换](/solution/0800-0899/0888.Fair%20Candy%20Swap/README.md) | `数组`,`哈希表`,`二分查找`,`排序` | 简单 | |
899902
| [0889](https://leetcode-cn.com/problems/construct-binary-tree-from-preorder-and-postorder-traversal) | [根据前序和后序遍历构造二叉树](/solution/0800-0899/0889.Construct%20Binary%20Tree%20from%20Preorder%20and%20Postorder%20Traversal/README.md) | ``,`数组`,`哈希表`,`分治`,`二叉树` | 中等 | |
900903
| [0890](https://leetcode-cn.com/problems/find-and-replace-pattern) | [查找和替换模式](/solution/0800-0899/0890.Find%20and%20Replace%20Pattern/README.md) | `数组`,`哈希表`,`字符串` | 中等 | |
904+
| [0891](https://leetcode-cn.com/problems/sum-of-subsequence-widths) | [子序列宽度之和](/solution/0800-0899/0891.Sum%20of%20Subsequence%20Widths/README.md) | `数组`,`数学`,`排序` | 困难 | |
901905
| [0892](https://leetcode-cn.com/problems/surface-area-of-3d-shapes) | [三维形体的表面积](/solution/0800-0899/0892.Surface%20Area%20of%203D%20Shapes/README.md) | `几何`,`数组`,`数学`,`矩阵` | 简单 | |
902906
| [0893](https://leetcode-cn.com/problems/groups-of-special-equivalent-strings) | [特殊等价字符串组](/solution/0800-0899/0893.Groups%20of%20Special-Equivalent%20Strings/README.md) | `数组`,`哈希表`,`字符串` | 简单 | |
903907
| [0894](https://leetcode-cn.com/problems/all-possible-full-binary-trees) | [所有可能的满二叉树](/solution/0800-0899/0894.All%20Possible%20Full%20Binary%20Trees/README.md) | ``,`递归`,`记忆化搜索`,`动态规划`,`二叉树` | 中等 | |
@@ -1062,7 +1066,6 @@
10621066
| [1053](https://leetcode-cn.com/problems/previous-permutation-with-one-swap) | [交换一次的先前排列](/solution/1000-1099/1053.Previous%20Permutation%20With%20One%20Swap/README.md) | `贪心`,`数组` | 中等 | |
10631067
| [1054](https://leetcode-cn.com/problems/distant-barcodes) | [距离相等的条形码](/solution/1000-1099/1054.Distant%20Barcodes/README.md) | `贪心`,`数组`,`哈希表`,`计数`,`排序`,`堆(优先队列)` | 中等 | |
10641068
| [1055](https://leetcode-cn.com/problems/shortest-way-to-form-string) | [形成字符串的最短路径](/solution/1000-1099/1055.Shortest%20Way%20to%20Form%20String/README.md) | `贪心`,`字符串`,`动态规划` | 中等 | 🔒 |
1065-
| [1056](https://leetcode-cn.com/problems/confusing-number) | [易混淆数](/solution/1000-1099/1056.Confusing%20Number/README.md) | `数学` | 简单 | 🔒 |
10661069
| [1057](https://leetcode-cn.com/problems/campus-bikes) | [校园自行车分配](/solution/1000-1099/1057.Campus%20Bikes/README.md) | `贪心`,`数组`,`排序` | 中等 | 🔒 |
10671070
| [1058](https://leetcode-cn.com/problems/minimize-rounding-error-to-meet-target) | [最小化舍入误差以满足目标](/solution/1000-1099/1058.Minimize%20Rounding%20Error%20to%20Meet%20Target/README.md) | `贪心`,`数组`,`数学`,`字符串` | 中等 | 🔒 |
10681071
| [1059](https://leetcode-cn.com/problems/all-paths-from-source-lead-to-destination) | [从始点到终点的所有路径](/solution/1000-1099/1059.All%20Paths%20from%20Source%20Lead%20to%20Destination/README.md) | `深度优先搜索`,`` | 中等 | 🔒 |
@@ -1282,6 +1285,7 @@
12821285
| [1273](https://leetcode-cn.com/problems/delete-tree-nodes) | [删除树节点](/solution/1200-1299/1273.Delete%20Tree%20Nodes/README.md) | ``,`深度优先搜索`,`广度优先搜索` | 中等 | 🔒 |
12831286
| [1274](https://leetcode-cn.com/problems/number-of-ships-in-a-rectangle) | [矩形内船只的数目](/solution/1200-1299/1274.Number%20of%20Ships%20in%20a%20Rectangle/README.md) | `数组`,`分治`,`交互` | 困难 | 🔒 |
12841287
| [1275](https://leetcode-cn.com/problems/find-winner-on-a-tic-tac-toe-game) | [找出井字棋的获胜者](/solution/1200-1299/1275.Find%20Winner%20on%20a%20Tic%20Tac%20Toe%20Game/README.md) | `数组`,`哈希表`,`矩阵`,`模拟` | 简单 | |
1288+
| [1276](https://leetcode-cn.com/problems/number-of-burgers-with-no-waste-of-ingredients) | [不浪费原料的汉堡制作方案](/solution/1200-1299/1276.Number%20of%20Burgers%20with%20No%20Waste%20of%20Ingredients/README.md) | `数学` | 中等 | |
12851289
| [1277](https://leetcode-cn.com/problems/count-square-submatrices-with-all-ones) | [统计全为 1 的正方形子矩阵](/solution/1200-1299/1277.Count%20Square%20Submatrices%20with%20All%20Ones/README.md) | `数组`,`动态规划`,`矩阵` | 中等 | |
12861290
| [1278](https://leetcode-cn.com/problems/palindrome-partitioning-iii) | [分割回文串 III](/solution/1200-1299/1278.Palindrome%20Partitioning%20III/README.md) | `字符串`,`动态规划` | 困难 | |
12871291
| [1279](https://leetcode-cn.com/problems/traffic-light-controlled-intersection) | [红绿灯路口](/solution/1200-1299/1279.Traffic%20Light%20Controlled%20Intersection/README.md) | `多线程` | 简单 | 🔒 |
@@ -1691,6 +1695,7 @@
16911695
| [1683](https://leetcode-cn.com/problems/invalid-tweets) | [无效的推文](/solution/1600-1699/1683.Invalid%20Tweets/README.md) | `数据库` | 简单 | 🔒 |
16921696
| [1684](https://leetcode-cn.com/problems/count-the-number-of-consistent-strings) | [统计一致字符串的数目](/solution/1600-1699/1684.Count%20the%20Number%20of%20Consistent%20Strings/README.md) | `位运算`,`数组`,`哈希表`,`字符串` | 简单 | |
16931697
| [1685](https://leetcode-cn.com/problems/sum-of-absolute-differences-in-a-sorted-array) | [有序数组中差绝对值之和](/solution/1600-1699/1685.Sum%20of%20Absolute%20Differences%20in%20a%20Sorted%20Array/README.md) | `数组`,`数学`,`前缀和` | 中等 | |
1698+
| [1686](https://leetcode-cn.com/problems/stone-game-vi) | [石子游戏 VI](/solution/1600-1699/1686.Stone%20Game%20VI/README.md) | `贪心`,`数组`,`数学`,`博弈`,`排序`,`堆(优先队列)` | 中等 | |
16941699
| [1687](https://leetcode-cn.com/problems/delivering-boxes-from-storage-to-ports) | [从仓库到码头运输箱子](/solution/1600-1699/1687.Delivering%20Boxes%20from%20Storage%20to%20Ports/README.md) | `线段树`,`队列`,`数组`,`动态规划`,`单调队列`,`堆(优先队列)` | 困难 | |
16951700
| [1688](https://leetcode-cn.com/problems/count-of-matches-in-tournament) | [比赛中的配对次数](/solution/1600-1699/1688.Count%20of%20Matches%20in%20Tournament/README.md) | `数学`,`模拟` | 简单 | |
16961701
| [1689](https://leetcode-cn.com/problems/partitioning-into-minimum-number-of-deci-binary-numbers) | [十-二进制数的最少数目](/solution/1600-1699/1689.Partitioning%20Into%20Minimum%20Number%20Of%20Deci-Binary%20Numbers/README.md) | `贪心`,`字符串` | 中等 | |

0 commit comments

Comments
 (0)