1459. Rectangles Area
https://leetcode.com/problems/rectangles-area
Description
Table: Points
Write an SQL query to report all possible axis-aligned rectangles with non-zero area that can be formed by any two points in the Points
table.
Each row in the result should contain three columns (p1, p2, area)
where:
p1
andp2
are theid
's of the two points that determine the opposite corners of a rectangle.area
is the area of the rectangle and must be non-zero.
Report the query in descending order by area
first, then in ascending order by p1
's id
if there is a tie, then in ascending order by p2
's id
if there is another tie.
The query result format is in the following table:
ac
Previous1458. Max Dot Product of Two SubsequencesNext1460. Make Two Arrays Equal by Reversing Sub-arrays
Last updated