give list domino dominoesi b equivalent dominoesj c d c b d d b c domino rotate equal dominoreturn number pair j 0 j dominoeslength dominoesi equivalent dominoesj Example 1input dominoe 12213456output 1example 2input dominoe 1212111222output 3 Constraints1 dominoeslength 4 104dominoesilength 21 dominoesij 9