Given a list of dominoes, where each domino is represented by two numbers [a, b],
two dominoes are equivalent if one can be rotated to match the other —
that is, (a == c and b == d) or (a == d and b == c).
Return the number of pairs (i, j) such that:
0 <= i < j < len(dominoes)
and dominoes[i] is equivalent to dominoes[j]
Input: dominoes = [[1,2],[2,1],[3,4],[5,6]]
Output: 1
Input: dominoes = [[1,2],[1,2],[1,1],[1,2],[2,2]]
Output: 3
Accepted:
Submission: