Your Dashboard
Interview Coaching
Learn
System Design
ML System Design
Code
Behavioral
Salary Negotiation
Interview Guides
Search
⌘K
Get Premium
Leetcode 2001. Number of Pairs of Interchangeable Rectangles
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).
Question Timeline
See when this question was last asked and where, including any notes left by other candidates.
All Regions
Comments
Hello Interview Premium
Your account is free and you can post anonymously if you choose.