python 刷题记录 Sock Merchant def sockMerchant(n, ar): A=set(ar) pairs=0 for element in A: #集合没有重复字符串 pairs += ar.count(element) // 2 return pairs