Problem 3623 · Medium

Count Number of Trapezoids I

Group points by height; every pair of points on one horizontal line pairs with a pair on another, and those pairs form trapezoids.

Open the interactive visualisation