Skip to content

Commit a5bef5a

Browse files
committed
✨update: Modify 673
1 parent f5005a8 commit a5bef5a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

LeetCode/671-680/673. 最长递增子序列的个数(中等).md

+1-1
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ class Solution {
9999
我们可以使用「树状数组」维护二元组 $(len, cnt)$ 信息:
100100

101101
1. 因为数据范围较大($-10^6 <= nums[i] <= 10^6$),但数的个数为 $2000$,因此第一步先对 $nums$ 进行离散化操作;
102-
2. 在遍历 $nums$ 时,每次从树状数组中查询值严格小于 $nums[i]$ 离散值(利用 $nums[i]$ 离散化后的值仍为正整数,我们可以直接查询小于等于 $nums[i]$ 离散值 $-1$ 的值)的最小长度,及最小长度对应的数量
102+
2. 在遍历 $nums$ 时,每次从树状数组中查询值严格小于 $nums[i]$ 离散值(利用 $nums[i]$ 离散化后的值仍为正整数,我们可以直接查询小于等于 $nums[i]$ 离散值 $-1$ 的值)的最大长度,及最大长度对应的数量
103103
3. 对于流程 $2$ 中查得的 $(len, cnt)$,由于 $nums[i]$ 可以接在其后,因此首先长度加一,同时数量将 $cnt$ 累加到该离散值中。
104104

105105
代码:

0 commit comments

Comments
 (0)