def sockMerchant(n, ar):
# Write your code here
d = dict()
for s in ar:
if d.get(s) is None:
d[s] = 1
else:
d[s] += 1
cnt = 0
for _, v in d.items():
cnt += v // 2
return cnt
'# 코딩 문제 관련 > 파이썬' 카테고리의 다른 글
[HackerRank-python] Counting Valleys (0) | 2022.07.10 |
---|---|
[HackerRank-python] Drawing Book (0) | 2022.07.07 |
[HackerRank-python] Bill Division (0) | 2022.07.03 |
[HackerRank-python] Day of the Programmer (0) | 2022.07.03 |
[HackerRank-python] Migratory Birds (0) | 2022.07.03 |