Search
⌘K

Leetcode 3396. Minimum Number of Operations to Make Elements in Array Distinct

You are given an array and can repeatedly remove the first three elements (or all remaining if fewer than three); return the minimum number of such prefix-removals needed so that the remaining array has all distinct elements (the empty array counts). Equivalently, find the smallest k such that the subarray nums[3k:] contains no duplicates.


Question Timeline

See when this question was last asked and where, including any notes left by other candidates.

Comments

Your account is free and you can post anonymously if you choose.