Your Dashboard
Interview Coaching
Learn
System Design
ML System Design
Code
Behavioral
Salary Negotiation
Interview Guides
Search
⌘K
Get Premium
Leetcode 3177. Find the Maximum Length of a Good Subsequence II
Find the longest subsequence of nums that has at most k adjacent changes (i.e., at most k indices i with seq[i] != seq[i+1], equivalently at most k+1 constant runs). The core challenge is maximizing picks under a small transition budget (k ≤ 50), typically solved with dynamic programming over transition count and last chosen value or run.
Question Timeline
See when this question was last asked and where, including any notes left by other candidates.
All Regions
Comments
Hello Interview Premium
Your account is free and you can post anonymously if you choose.