Find the Maximum Length of a Good Subsequence I

Asked at Snowflake · Coding Questions · Difficulty: Medium

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]`.

Loading the problem…