Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import math
- def sockMerchant(n, ar):
- Socks = ar.split(" ")
- Checked_Socks = []
- Counter = 0
- for Sock in Socks:
- if Sock not in Checked_Socks:
- N = Socks.count(Sock)
- if N > 1:
- Counter += int(math.trunc(N/2))
- Checked_Socks.append(Sock)
- return Counter
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement