> For the complete documentation index, see [llms.txt](https://851958789.gitbook.io/notes/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://851958789.gitbook.io/notes/1128_number_of_equivalent_domino_pairs/slt.md).

# slt

直接double for loop会超时

## 思路1 排序 + hash

两个多米诺骨牌是equal => 两个骨牌相同，或其中一个反转后相同。

我们只需要把每个骨牌都按增序反转，然后用hash来计数即可

最后用的是组合数的公式

假设某一类等价对象的总数是N，从N个中任取两个的组合数，就是满足d\[i]和d\[j]等价的骨牌对的数量。
