Available question text
Count how many index pairs of rectangles share the same width:height ratio. Normalize each (w,h) to its reduced form (e.g., divide by gcd) and use a hash map to tally frequencies, then sum frequency choose 2 (n up to 1e5 so avoid O(n^2) or floating-point comparisons).
Related questions
Continue with questions that share topics or the same question type.
Sources · 1 reference
These records explain where the question appears. A company tag or candidate report does not guarantee a future interview question.
Hello Interview · 1 record
No company association
Leetcode 2001. Number of Pairs of Interchangeable Rectangles
Reported date not specified · 0 source reports
Source snapshot: Nov 12, 2026
View source