2341. Maximum Number of Pairs in Array Updated: 2024-03-12 1 min read Algorithms , LeetCode On This PageLeetCode problem 2341class Solution: def numberOfPairs(self, nums: List[int]) -> List[int]: cnt = Counter(nums) s = sum(v // 2 for v in cnt.values()) return [s, len(nums) - s * 2]