• + 3 comments

    if ar= 10 20 20 10 10 30 50 10 20 , then Counter will make a dictionary -> Counter({10: 4, 20: 3, 30: 1, 50: 1}).

    Then u need to find the no of pairs in those values that is add the values divided by 2 so that only the paired ones get counted and thats it !!