You are viewing a single comment's thread. Return to all comments →
Python
def count_elements(n, arr): pairs = 0 count = 0 for x in arr: if n == x: count += 1 if count == 2: pairs += 1 count = 0 return pairs def sockMerchant(n, ar): count = 0 numbers = set() [numbers.add(x) for x in ar] for x in numbers: count += count_elements(x, ar) return count
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 →
Python