#3625
Count Number of Trapezoids II
master · 1730 · lc hard +32 · 40.1% accepted · 259 likes · top 19%
Description
An array points[i] = [xi, yi] gives coordinates of points on a Cartesian plane.
A trapezoid is a convex quadrilateral with at least one pair of parallel sides.
Count and return the distinct trapezoids that can be formed by choosing any four distinct points.
Code
1
2
3