Skip to content

Commit 78aec05

Browse files
committed
Create 3396. Minimum Number of Operations to Make Elements in Array Distinct.py
1 parent e457734 commit 78aec05

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
def minOperationsToDistinct(nums):
2+
seen = set()
3+
count = 0
4+
while len(set(nums)) != len(nums):
5+
nums = nums[3:] # Remove first 3 elements
6+
count += 1
7+
return count

0 commit comments

Comments
 (0)