You are viewing a single comment's thread. Return to all comments →
def sockMerchant(n, ar): pair = 0
set1 = list(set(ar)) for i in set1: if ar.count(i) % 2 == 0: pair = pair + ar.count(i)/2 elif ar.count(i)%2 == 1: pair = pair+((ar.count(i)-1)/2) return int(pair)
Seems like cookies are disabled on this browser, please enable them to open this website
An unexpected error occurred. Please try reloading the page. If problem persists, please contact support@hackerrank.com
Sales by Match
You are viewing a single comment's thread. Return to all comments →
def sockMerchant(n, ar): pair = 0