Given a set of points in the plane, find the maximum possible area of any triangle formed by choosing three points.
You are given a list of points on a 2D plane. Each point is represented by its integer coordinates. Choose any three distinct points and form a triangle.
Return the largest possible area among all such triangles.
The area may be a non-integer value.
[x, y].points, where points[i] = [x_i, y_i].3 <= points.lengthExample 1
Input
points = [[0,0],[0,1],[1,0],[0,2],[2,0]]
Output
2
Explanation
The largest triangle is formed by points [0,0], [0,2], and [2,0], which has area 2.
Example 2
Input
points = [[1,0],[0,0],[0,1]]
Output
0.5
Explanation
These three points form a right triangle with legs of length 1, so the area is 1/2.
Premium problem context
Premium adds guided hints, editorial links, similar variants, discussion resources, and concept maps so you can understand why a problem matters, not just solve it once.