We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see ourdocumentation.
There was an error while loading.Please reload this page.
1 parent673e72f commit2746042Copy full SHA for 2746042
leetcode-300-Longest-Increasing-Subsequence.md
@@ -27,7 +27,7 @@ Explanation: The longest increasing subsequence is [2,3,7,101], therefore the le
27
28
`dp[i]`表示以第`i` 个数字**为结尾**的最长上升子序列的长度。
29
30
-求`dp[i]` 的时候,如果前边的某个数`nums[j] < nums[i]` ,那么我们可以将第`i` 个数接到第`x` 个数字的后边作为一个新的上升子序列,此时对应的上升子序列的长度就是`dp[j] + 1`。
+求`dp[i]` 的时候,如果前边的某个数`nums[j] < nums[i]` ,那么我们可以将第`i` 个数接到第`j` 个数字的后边作为一个新的上升子序列,此时对应的上升子序列的长度就是`dp[j] + 1`。
31
32
可以从下边情况中选择最大的。
33
@@ -81,7 +81,7 @@ public int lengthOfLIS(int[] nums) {
81
```java
82
nums= [4,5,6,3]
83
len=1: [4], [5], [6], [3]=> tails[0]=3
84
-长度为1 的上升子序列有4 个,末尾最小的值就是4
+长度为1 的上升子序列有4 个,末尾最小的值就是3
85
86
len=2: [4,5], [5,6]=> tails[1]=5
87
长度为2 的上升子序列有2 个,末尾最小的值就是5