2206. Divide Array Into Equal Pairs

Updated: 2024-03-12
1 min read
[]

On This Page

LeetCode problem 2206

class Solution:
    def divideArray(self, nums: List[int]) -> bool:
        cnt = Counter(nums)
        return all(v % 2 == 0 for v in cnt.values())