|
3 | 3 | importjava.util.HashMap; |
4 | 4 | importjava.util.Map; |
5 | 5 |
|
6 | | -/** |
7 | | - * 1128. Number of Equivalent Domino Pairs |
8 | | - * |
9 | | - * Given a list of dominoes, dominoes[i] = [a, b] is equivalent to dominoes[j] = [c, d] if and only if either (a==c and b==d), or (a==d and b==c) - that is, one domino can be rotated to be equal to another domino. |
10 | | - * Return the number of pairs (i, j) for which 0 <= i < j < dominoes.length, and dominoes[i] is equivalent to dominoes[j]. |
11 | | - * |
12 | | - * Example 1: |
13 | | - * |
14 | | - * Input: dominoes = [[1,2],[2,1],[3,4],[5,6]] |
15 | | - * Output: 1 |
16 | | - * |
17 | | - * Constraints: |
18 | | - * 1 <= dominoes.length <= 40000 |
19 | | - * 1 <= dominoes[i][j] <= 9 |
20 | | - * */ |
21 | 6 | publicclass_1128 { |
22 | 7 | publicstaticclassSolution1 { |
23 | 8 | publicintnumEquivDominoPairs(int[][]dominoes) { |
|