
[LeetCode] 3396. Minimum Number of Operations to Make Elements in Array Distinct (Python)

·
알고리즘/LeetCode
난이도: EasyProblem DescriptionYou are given an integer array nums. You need to ensure that the elements in the array are distinct. To achieve this, you can perform the following operation any number of times:Remove 3 elements from the beginning of the array. If the array has fewer than 3 elements, remove all remaining elements.Note that an empty array is considered to have distinct elements. Retur..