Search
⌘K

Leetcode 3588. Find Maximum Area of a Triangle

Given n points, return twice the maximum area of any triangle whose at least one side is axis-parallel (or -1 if none); this reduces to maximizing base*height where the base is the distance between two points sharing x or y and the height is the perpendicular distance to a third point. Key idea: consider pairs of points with equal x or equal y and combine with a third point at a different coordinate to maximize base*height (n up to 1e5 so group/scan efficiently).


Question Timeline

See when this question was last asked and where, including any notes left by other candidates.

Comments

Your account is free and you can post anonymously if you choose.