Monday, August 13, 2018

Sock Merchant : Algorithms - Implementation

#The solution in Python3 is as follows:


n=int(input())
a=list(map(int,input().split()))
b=set(a)
c=0
for i in b:
    if a.count(i)//2>=1:
        c+=(a.count(i)//2)
print(c)

#Keep visiting for more solutions of HackerRank problems in Python 3.Thank you!!!