Problem · Array
Coordinate Bounding Box
Learn this problemProblem statement
Given a list of two-dimensional points (x, y), return [minX, minY, width, height], where width = maxX - minX and height = maxY - minY.
Function
boundingBox(points: int[][]) → int[]Examples
Example 1
points = [[2,5],[-1,3],[4,9]]return = [-1,3,5,6]The minimum corner is (-1,3). The width is 4 - (-1) = 5, and the height is 9 - 3 = 6.
More Upstart problems
- Increase Exclamations and Convert PeriodsOA · Seen Jul 2026
- Interleave Equal-Length Strings by ColumnOA · Seen Jul 2026
- Scale Ingredient QuantitiesOA · Seen Jul 2026
- Bounding Box from CoordinatesOA · Seen May 2026
- Filter by Threshold and Return Name with Max ScoreOA · Seen May 2026
- Filter Odds and Reverse EvensOA · Seen May 2026
- Find the Wrong Digit Index in a SumOA · Seen May 2026