Skip to content

Commit 2027aea

Browse files
authored
Update number-of-pairs-of-interchangeable-rectangles.py
1 parent 3a9b519 commit 2027aea

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Python/number-of-pairs-of-interchangeable-rectangles.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,6 @@ def interchangeableRectangles(self, rectangles):
1313
"""
1414
count = collections.defaultdict(int)
1515
for w, h in rectangles:
16-
g = fractions.gcd(w, h) # Time: O((logx)^2) ~= O(1)
16+
g = fractions.gcd(w, h) # Time: O(logx) ~= O(1)
1717
count[(w//g, h//g)] += 1
1818
return sum(c*(c-1)//2 for c in count.itervalues())

0 commit comments

Comments
 (0)