2025-08-17 16:54:48 +0000 UTC
Divide Array Into Equal Pairs
Categories:
Links
Code
class Solution:
def divideArray(self, nums: List[int]) -> bool:
freqs = defaultdict(int)
for num in nums:
freqs[num] += 1
for freq in freqs.values():
if freq % 2 != 0:
return False
return True