NeetCode #117LC-2001MediumArrays & Hashing
← Back to All Problems#117 · #2001 · Number of Pairs of Interchangeable Rectangles(可互换矩形的组数)
📌 Problem Statement & Constraints
You are given
n rectangles, each [width_i, height_i]. Two rectangles are interchangeable if their width-to-height ratios are equal. Count the number of pairs (i, j) with i < j that are interchangeable. Constraints: 1 <= n <= 10^5, 1 <= width_i, height_i <= 10^5.🔒
Sign In to Unlock Full Solutions for All 973 Problems
Sign in to access step-by-step logic, benchmark Python3 code, complexity breakdown, and offline export!