You are viewing a single comment's thread. Return to all comments →
python code:
`
def sockMerchant(n, ar): # Write your code here di={} ct=0 for i in ar: if i in di.keys(): di[i]+=1 else : di[i]=1 for i in di: ct+=di[i]//2 return ct
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 code:
`
def sockMerchant(n, ar): # Write your code here di={} ct=0 for i in ar: if i in di.keys(): di[i]+=1 else : di[i]=1
for i in di: ct+=di[i]//2
return ct