You are given an integer array nums and a nonnegative integer k.
A sequence of integers sub is considered good if there are at most k indices i where sub.length sub[i] != sub[i + 1].
Return the maximum possible length of a good subsequence of nums.
Note: A subsequence is an array that can be derived from another array by deleting some or no elements without changing the order of the remaining elements.
Constraints:
nums.length
nums[i]
k nums.length
You are given an integer array nums and a nonnegative integer k.
A sequence of integers sub is considered good if there are at most k indices i where sub.length sub[i] != sub[i + 1].
Return the maximum possible length of a good subsequence of nums.
Note: A subsequence is an array that can be derived from another array by deleting some or no elements without changing the order of the remaining elements.
Constraints:
nums.length
nums[i]
k nums.length