30:00
Given an integer array nums, return the number of longest strictly increasing subsequences.
1≤nums.length≤20001 \leq \text{nums.length} \leq 20001≤nums.length≤2000
−106≤nums[i]≤106-10^6 \leq \text{nums}[i] \leq 10^6−106≤nums[i]≤106
The answer is guaranteed to fit inside a 32-bit integer.
Run code to see results.
Every element alone is an increasing subsequence of length 1, and there is exactly 1 way to make it. So length[i] = 1 and count[i] = 1 to start.
nums
1
3
5
4
7
len
cnt
len = longest increasing run ending here
cnt = how many such runs
Find the length of the longest strictly increasing subsequence, then count how many different subsequences reach that length.