Search⌘ K

DIY: Minimum Area Rectangle

Explore how to determine the minimum area rectangle formed from a set of points in a 2D plane, with sides parallel to the X and Y axes. This lesson helps you implement a function in Go to solve this geometric problem efficiently, preparing you for related coding interview questions.

Problem statement

Given an array of points in the X-Y plane points, where points[i] = [xi, yi], you have to return the minimum area of a rectangle formed from these points, with sides parallel to the X and Y axes. If there is no such rectangle that can be formed, you ...