Longest Increasing Subsequence II
You're given an integer array, nums, and an integer, k. Your task is to find the longest subsequence of nums that meets the following requirements:
- The subsequence is strictly increasing.
- The difference between adjacent elements in the subsequence is at most k.
Your function should print the length of the longest subsequence that meets these requirements.
Ada AI
I want to discuss a solution
Help me solve this
Give more examples
What's wrong with my code?
How to use 'for loop' in javascript?
javascript (node 13.12.0)