[LeetCode] Number of Pairs of Interchangeable Rectangles

1 · · Aug. 12, 2022, 10:32 a.m.
2001. Number of Pairs of Interchangeable Rectangles You are given n rectangles represented by a 0-indexed 2D integer array rectangles, where rectangles[i] = [widthi, heighti] denotes the width and height of the ith rectangle. Two rectangles i and j (i < j) are considered interchangeable if they have the same width-to-height ratio. More formally, two rectangles are interchangeable if widthi/heighti == widthj/heightj (using decimal division, not integer division). Return the number of pairs of in...