You are given a list of dominoes, where dominoes[i] = [a, b]. Two dominoes [a, b] and [c, d] are equivalent if one can be rotated to equal the other: either a == c and b == d, or a == d and b == c.
Return the number of index pairs (i, j) with 0 <= i < j < dominoes.length such that dominoes[i] is equivalent to dominoes[j].