• + 0 comments

    1 line Python solution, 100%

    return sum(i*(i-1) for _,i in Counter(a).items())