Sales by Match

  • + 0 comments

    python

    def sockMerchant(n, ar):
        d={i:ar.count(i) for i in set(ar)}
        res=0
        for i in d:
            if d[i] >= 2:
                res = res + d[i]//2
        return res