#3623
Count Number of Trapezoids I
specialist · 910 · lc medium +31 · 48% accepted · 395 likes · top 33%
Description
An array points[i] = [xi, yi] gives coordinates of points on a Cartesian plane.
A horizontal trapezoid is a convex quadrilateral with at least one pair of sides parallel to the x-axis.
Count the distinct horizontal trapezoids formed from any four points and return the answer modulo 109 + 7.
Code
1
2
3