Problem 3779 · Medium

Minimum Number of Operations to Have Distinct Elements

While the array still contains a repeated value, drop its first three elements, or all of them if fewer remain. Return how many drops are needed.

Open the interactive visualisation