Sponsored
Use these hints if you're stuck. Try solving on your own first.
Store the rectangle height and width ratio in a hashmap.
Traverse the ratios, and for each ratio, use the frequency of the ratio to add to the total pair count.
Solve with full IDE support and test cases