Sales by Match

  • + 0 comments
    from collections import Counter
    def sockMerchant(n, ar):
        # Write your code here
        count = 0
        socks = Counter(ar)
        for key, value in socks.items():
            if value >= 2:
                count += value//2
        
        return count