Hard
LABLongest Increasing Subsequence II
Return the longest strictly increasing subsequence length where adjacent chosen values differ by at most k.
EXAMPLES
Example 1
Input
{
"nums": [
4,
2,
1,
4,
3,
4,
5,
8,
15
],
"k": 3
}
Output
5FUNCTION SHAPE
nums: intArrayk: int→int