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.
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.