Leetcode 3623. Count Number of Trapezoids I
Count the number of distinct convex quadrilaterals (trapezoids) that can be formed from given points such that at least one pair of opposite sides is horizontal. The challenge is to efficiently count these combinations for up to 1e5 points by grouping points by y-coordinate and using combinatorial counting over pairs of horizontal lines and matching x-values, returning the result modulo 1e9+7.
Question Timeline
See when this question was last asked and where, including any notes left by other candidates.
Your account is free and you can post anonymously if you choose.