Search
⌘K
Get Premium
Leetcode 2216. Minimum Deletions to Make Array Beautiful
Delete the fewest elements so the remaining array has even length and every consecutive pair (indices 0&1, 2&3, ...) contains two different values. The core challenge is to form as many non-equal adjacent pairs as possible (via a linear greedy scan) and count the elements that must be removed.
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.