You are viewing a single comment's thread. Return to all comments →
The pythonic way: (not the best solution but it works)
def sockMerchant(n,ar): count = {num:ar.count(num) for num in ar} pairs = [int((val/2)) for num,val in count.items()] return sum(pairs)
Seems like cookies are disabled on this browser, please enable them to open this website
Sales by Match
You are viewing a single comment's thread. Return to all comments →
The pythonic way: (not the best solution but it works)