Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def sockMerchant(n, ar):
- count = 0
- dict = {}
- for i in range(len(ar)):
- if ar[i] in dict:
- dict[ar[i]] += 1
- else:
- dict[ar[i]] = 1
- if dict[ar[i]] % 2 == 0:
- count += 1
- return count
Advertisement
Add Comment
Please, Sign In to add comment