• + 0 comments

    Python 1-liner

    def sockMerchant(n, ar):
        pairs = sum([ar.count(i) // 2 for i in set(ar)])
        return pairs