#3380

Maximum Area Rectangle With Point Constraints I

specialist · 865 · lc medium +31 · 51.4% accepted · 77 likes · top 40%

Description

You are given an array points where points[i] = [xi, yi] represents coordinates on an infinite plane.

Find the maximum area of an axis-aligned rectangle that:

- Uses exactly four of the given points as corners.

- Contains no other given point inside or on its border.

Return the maximum area, or -1 if no such rectangle exists.

Code

1
2
3