You are viewing a single comment's thread. Return to all comments →
Python Solution
def sockMerchant(n, ar): n_pairs = 0 pair_dict = Counter(ar) for value in pair_dict.values(): n_pairs += (value//2) return n_pairs
I think you need to sort input array first
Seems like cookies are disabled on this browser, please enable them to open this website
I agree to HackerRank's Terms of Service and Privacy Policy.
Sales by Match
You are viewing a single comment's thread. Return to all comments →
Python Solution
I think you need to sort input array first