Sponsored
Sponsored
Use these hints if you're stuck. Try solving on your own first.
For each domino j, find the number of dominoes you've already seen (dominoes i with i < j) that are equivalent.
You can keep track of what you've seen using a hashmap.