• + 0 comments
    def sockMerchant(n, ar):
        result = 0
        for item in set(ar.copy()):
            item_count = 0
            while item in ar:
                ar.remove(item)
                item_count += 1
            
            result += item_count // 2
        
        return result