• + 0 comments

    Ruby:

    def sockMerchant(n, ar)
        ar.tally.values.inject(0) { |result, num| result + num/2 }
    end