Problem
Ask
Submissions

Problem: Maximum Area Rectangle With Point Constraints I

Medium
30 min
Explore how to identify the largest rectangle on a plane using given points, ensuring the shape's borders align with axes and contain no other points inside or on the edges. Learn to solve this geometric problem by analyzing point coordinates and applying constraints to find the maximum area or determine if none exist.

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:

  • 11 \leq points.length 10\leq 10

  • points[i].length =2= 2

  • 0xi,yi1000 \leq x_i, y_i \leq 100

  • All the given points are unique.

Problem
Ask
Submissions

Problem: Maximum Area Rectangle With Point Constraints I

Medium
30 min
Explore how to identify the largest rectangle on a plane using given points, ensuring the shape's borders align with axes and contain no other points inside or on the edges. Learn to solve this geometric problem by analyzing point coordinates and applying constraints to find the maximum area or determine if none exist.

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:

  • 11 \leq points.length 10\leq 10

  • points[i].length =2= 2

  • 0xi,yi1000 \leq x_i, y_i \leq 100

  • All the given points are unique.