Skip to content

Commit cd14f64

Browse files
authored
Merge pull request CyC2018#435 from zhulinn/patch-2
上升子序列
2 parents 3a604c2 + 5eaf1da commit cd14f64

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

notes/Leetcode 题解.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2781,7 +2781,7 @@ return ret;
27812781
定义一个 tails 数组,其中 tails[i] 存储长度为 i + 1 的最长递增子序列的最后一个元素。对于一个元素 x,
27822782

27832783
- 如果它大于 tails 数组所有的值,那么把它添加到 tails 后面,表示最长递增子序列长度加 1;
2784-
- 如果 tails[i-1] < x <= tails[i],那么更新 tails[i-1] = x。
2784+
- 如果 tails[i-1] < x <= tails[i],那么更新 tails[i] = x。
27852785

27862786
例如对于数组 [4,3,6,5],有:
27872787

0 commit comments

Comments
 (0)