Boundary Rectangle of a Set of Points

Asked at Aurora · Coding Questions · Difficulty: Easy · Last asked Jul 15, 2026

Given a set of points on a 2D plane, determine the smallest boundary rectangle that can enclose all the given points. **Input**: An integer array points of size n×2 where point[i] = [x, y] represents a point on the plane. **Output**: Return the coordinates of the bottom-left and top-right corners of the boundary rectangle. **Example Input**: `[[0, 0], [1, 1], [1, 0], [0, 1]]` **Example Output**: `[[0, 0], [1, 1]]` **Constraints**: 1 <= n <= 10^5, -10^4 <= x, y <= 10^4.

Loading the problem…