Skip to content

Commit e79e15a

Browse files
authored
docs: update solution to lc problem: No.2809 (doocs#2241)
1 parent 126ef4f commit e79e15a

File tree

2 files changed

+2
-6
lines changed

2 files changed

+2
-6
lines changed

solution/2800-2899/2809.Minimum Time to Make Array Sum At Most x/README.md

+1-3
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,6 @@ $$
7979

8080
时间复杂度 $O(n^2)$,空间复杂度 $O(n^2)$。其中 $n$ 是数组的长度。
8181

82-
我们注意到,状态 $f[i][j]$ 只与 $f[i-1][j]$ 和 $f[i-1][j-1]$ 有关,因此我们可以优化掉第一维,将空间复杂度降低到 $O(n)$。
83-
8482
<!-- tabs:start -->
8583

8684
```python
@@ -238,7 +236,7 @@ function minimumTime(nums1: number[], nums2: number[], x: number): number {
238236

239237
<!-- tabs:end -->
240238

241-
### 方法二
239+
我们注意到,状态 $f[i][j]$ 只与 $f[i-1][j]$ 和 $f[i-1][j-1]$ 有关,因此我们可以优化掉第一维,将空间复杂度降低到 $O(n)$。
242240

243241
<!-- tabs:start -->
244242

solution/2800-2899/2809.Minimum Time to Make Array Sum At Most x/README_EN.md

+1-3
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,6 @@ Finally, we enumerate $j$ and find the smallest $j$ that satisfies $s_1 + s_2 \t
7676

7777
The time complexity is $O(n^2)$, and the space complexity is $O(n^2)$, where $n$ is the length of the array.
7878

79-
We notice that the state $f[i][j]$ is only related to $f[i-1][j]$ and $f[i-1][j-1]$, so we can optimize the first dimension and reduce the space complexity to $O(n)$.
80-
8179
<!-- tabs:start -->
8280

8381
```python
@@ -235,7 +233,7 @@ function minimumTime(nums1: number[], nums2: number[], x: number): number {
235233

236234
<!-- tabs:end -->
237235

238-
### Solution 2
236+
We notice that the state $f[i][j]$ is only related to $f[i-1][j]$ and $f[i-1][j-1]$, so we can optimize the first dimension and reduce the space complexity to $O(n)$.
239237

240238
<!-- tabs:start -->
241239

0 commit comments

Comments
 (0)