Skip to content

Commit cd5883a

Browse files
author
lucifer
committed
fix: typo
1 parent 3efa91a commit cd5883a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

problems/1128.number-of-equivalent-domino-pairs.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,13 +127,13 @@ Python3 Code:
127127

128128
```python
129129

130+
130131
class Solution:
131132
def numEquivDominoPairs(self, dominoes: List[List[int]]) -> int:
132133
counts = [0] * 9 * 9
133134
ans = 0
134135
for a, b in dominoes:
135-
if a >= b: v = a * 9 + b
136-
else: v = b * 9 + a
136+
v = min((a - 1) * 9 + (b - 1), (b - 1) * 9 + (a - 1))
137137
ans += counts[v]
138138
counts[v] += 1
139139
return ans

0 commit comments

Comments
 (0)