Skip to content

Commit 2746042

Browse files
committed
300
1 parent 673e72f commit 2746042

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

leetcode-300-Longest-Increasing-Subsequence.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ Explanation: The longest increasing subsequence is [2,3,7,101], therefore the le
2727

2828
`dp[i]`表示以第 `i` 个数字**为结尾**的最长上升子序列的长度。
2929

30-
`dp[i]` 的时候,如果前边的某个数 `nums[j] < nums[i]` ,那么我们可以将第 `i` 个数接到第 `x` 个数字的后边作为一个新的上升子序列,此时对应的上升子序列的长度就是 `dp[j] + 1`
30+
`dp[i]` 的时候,如果前边的某个数 `nums[j] < nums[i]` ,那么我们可以将第 `i` 个数接到第 `j` 个数字的后边作为一个新的上升子序列,此时对应的上升子序列的长度就是 `dp[j] + 1`
3131

3232
可以从下边情况中选择最大的。
3333

@@ -81,7 +81,7 @@ public int lengthOfLIS(int[] nums) {
8181
```java
8282
nums = [4,5,6,3]
8383
len = 1 : [4], [5], [6], [3] => tails[0] = 3
84-
长度为 1 的上升子序列有 4 个,末尾最小的值就是 4
84+
长度为 1 的上升子序列有 4 个,末尾最小的值就是 3
8585

8686
len = 2 : [4, 5], [5, 6] => tails[1] = 5
8787
长度为 2 的上升子序列有 2 个,末尾最小的值就是 5

0 commit comments

Comments
 (0)