Tap here to switch tabs
Problem
Submissions

Problem: Maximum Area Rectangle With Point Constraints I

Maximum Area Rectangle With Point Constraints I asks you to use four given points as axis-aligned rectangle corners, with no other point inside or on its border, and return the largest area or negative one.

Statement

You are given an array of points, where points[i] have two values: [xi,yi][x_i, y_i], representing its position on a flat plane.

Your goal is to find the largest rectangle (having maximum area) that can be formed using any four points as the corners. The rectangle should meet the following conditions:

  • It has its borders parallel to the axes.

  • It should not contain any other points inside or along its border.

Return the area of the largest rectangle you can create. If no such rectangle can be formed, return −1-1.

Constraints:

  • 1≤1 \leq points.length ≤10\leq 10

  • points[i].length =2= 2

  • 0≤xi,yi≤1000 \leq x_i, y_i \leq 100

  • All the given points are unique.

⋮
Tap here to switch tabs
Problem
Submissions

Problem: Maximum Area Rectangle With Point Constraints I

Maximum Area Rectangle With Point Constraints I asks you to use four given points as axis-aligned rectangle corners, with no other point inside or on its border, and return the largest area or negative one.

Statement

You are given an array of points, where points[i] have two values: [xi,yi][x_i, y_i], representing its position on a flat plane.

Your goal is to find the largest rectangle (having maximum area) that can be formed using any four points as the corners. The rectangle should meet the following conditions:

  • It has its borders parallel to the axes.

  • It should not contain any other points inside or along its border.

Return the area of the largest rectangle you can create. If no such rectangle can be formed, return −1-1.

Constraints:

  • 1≤1 \leq points.length ≤10\leq 10

  • points[i].length =2= 2

  • 0≤xi,yi≤1000 \leq x_i, y_i \leq 100

  • All the given points are unique.