Skip to content

Commit 5e48812

Browse files
committed
0474 Reworded.
1 parent 09d2a24 commit 5e48812

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

problems/0474-ones-and-zeroes.md

+8-4
Original file line numberDiff line numberDiff line change
@@ -35,15 +35,19 @@ Constraints:
3535
```
3636

3737
## Thoughts
38-
* This is a two-dimensional `01 Knapsack Problem`. The solution is to first solve the problem in one dimension totally and then expand it to two dimensions.
38+
* This is a two-dimensional `01 Knapsack Problem`. The solution is to first solve the problem in one dimension once and for all and then expand it to two dimensions.
3939

40-
* Don't draw a grid that considers both dimensions together, that's too complicated.
40+
* It is no need to draw a grid that considers both dimensions together, that's too complicated.
4141

42-
* For example, let's only consider the case of `0`.
42+
* For example, let's first only consider the quantity limit of `0`.
4343

4444
Example 1: `Input: strs = ["10","0001","111001","1","0"], m = 5, n = 3`.
4545

46-
* After initialization: `dp = [0] * (zero_count + 1)`.
46+
* After initialization:
47+
````
48+
max_zero_count = m
49+
dp = [0] * (max_zero_count + 1)`.
50+
````
4751
* Finish this grid by using the `example 1`:
4852
```
4953
# 0 1 2 3 4 5

0 commit comments

Comments
 (0)