Skip to content

Practice Maximum Area of Longest Diagonal Rectangle

Read the task, work through the examples, and check your approach against the constraints. Use the original LeetCode task for coding and submissions.

Easy#3000
LeetCode Problem

Maximum Area of Longest Diagonal Rectangle

Problem Statement

You are given a 2D 0-indexed integer array dimensions. For all indices i, 0 <= i < dimensions.length, dimensions[i][0] represents the length and dimensions[i][1] represents the width of the rectangle i. Return the area of the rectangle having the longest diagonal. If there are multiple rectangles with the longest diagonal, return the area of the rectangle having the maximum area.

Source: Maximum Area of Longest Diagonal Rectangle on LeetCode. Use the original task for its coding environment and submissions.

Examples

# Example 1

Input
dimensions = [[9,3],[8,6]]
Output
48

# Example 2

Input
dimensions = [[3,4],[4,3]]
Output
12

Constraints

1 <= dimensions.length <= 100
dimensions[i].length == 2
1 <= dimensions[i][0], dimensions[i][1] <= 100

Related LeetCode Problems

Practice more problems similar to Maximum Area of Longest Diagonal Rectangle.

Review your practice with PhantomCodeAI

After trying the problem yourself, use the app to discuss your approach, complexity, and edge cases.