[LeetCode] Find the Maximum Length of a Good Subsequence I

1 · · June 9, 2024, 5:39 a.m.
3176. Find the Maximum Length of a Good Subsequence I You are given an integer array nums and a non-negative integer k. A sequence of integers seq is called good if there are at most k indices i in the range [0, seq.length - 2] such that seq[i] != seq[i + 1]. Return the maximum possible length of a good subsequence of nums. ...