Longest Subsequence With Limited Value Changes
Asked at Snowflake · Coding Questions · Difficulty: Medium
Pick some elements of an integer array, keeping them in their original order, so that the picked sequence changes value only a few times. A change is a position where an element of the picked sequence differs from the element right after it. Given the array `nums` and a budget `k`, find how many elements you can pick at most while making at most `k` changes.
Loading the problem…
More Snowflake interview questions
- Design a Distributed Job Scheduler with Cron, Pause, Resume
- Design an ACL Authorization Service
- Design an S3-Style Blob Store with Deduplication
- SQL: Project Duration & Budget per Employee
- Cross-Platform Client Logging Library
- Design a Quota System