Skip to content

Commit 3a9b519

Browse files
authored
Update number-of-pairs-of-interchangeable-rectangles.cpp
1 parent 4b7e10d commit 3a9b519

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

C++/number-of-pairs-of-interchangeable-rectangles.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ class Solution {
66
long long interchangeableRectangles(vector<vector<int>>& rectangles) {
77
unordered_map<int, unordered_map<int, int>> lookup;
88
for (const auto& rect : rectangles) {
9-
const int g = gcd(rect[0], rect[1]); // Time: O((logx)^2) ~= O(1)
9+
const int g = gcd(rect[0], rect[1]); // Time: O(logx) ~= O(1)
1010
++lookup[rect[0] / g][rect[1] / g];
1111
}
1212
int64_t result = 0;

0 commit comments

Comments
 (0)