Advertisement
EXTREMEXPLOIT

Sock Merchant

Dec 29th, 2019
301
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.27 KB | None | 0 0
  1. import math
  2.  
  3. def sockMerchant(n, ar):
  4.     Socks = ar.split(" ")
  5.     Checked_Socks = []
  6.     Counter = 0
  7.     for Sock in Socks:
  8.         if Sock not in Checked_Socks:
  9.             N = Socks.count(Sock)
  10.             if N > 1:
  11.                 Counter += int(math.trunc(N/2))
  12.             Checked_Socks.append(Sock)
  13.     return Counter
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement