2341. Maximum Number of Pairs in Array Обновлено: 2024-03-12 1 мин Algorithms , LeetCode СодержаниеLeetCode 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]