A metrics panel highlights the longest strictly rising sequences in a list of readings nums, where a sequence keeps the original order but may skip readings. Two sequences are different if they use a different set of positions, even when the values are the same.
Write countLongestRises(nums) that returns how many strictly increasing subsequences have the maximum possible length, modulo 1000000007.
Input: nums = [1,3,2,4] Output: 2
The longest length is 3, reached by 1, 3, 4 and by 1, 2, 4.
Input: nums = [3,3,3] Output: 3
The longest length is 1, and each of the three positions is one such sequence.
1 <= nums.length <= 2000-10^6 <= nums[i] <= 10^6Run tries your code on the examples. Submit runs every test, including hidden edge cases, and solves the problem when they all pass.
Ctrl + Enter runs, Ctrl + Shift + Enter submits (⌘ on a Mac).
I'm here to help with #525 Count the Longest Rising Sequences. I give hints, never the solution, so you get to solve it yourself. Ask for a hint, select code to ask about it, or press Ask Tuto why on a failing test.
Your first 3 answers need no account. for free to keep asking.