Coordinate Bounding Box
Updated
Problem 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 Online Assessment questions
- Buffet Day GainsOA · Seen Sep 2026
- Case-Insensitive Anagram CheckOA · Seen Sep 2026
- Filter Duplicates While Preserving OrderOA · Seen Sep 2026
- Scale Ingredient QuantitiesOA · Seen Sep 2026
- ABO Parent Genotype CombinationsOA · Seen Aug 2026
- Chunked Byte Stream ChecksumsOA · Seen Aug 2026
- Cluster Size on DiskOA · Seen Aug 2026
- Double Substitution DecryptionOA · Seen Aug 2026
- Add Drama to Text GroupsOA · Seen Jul 2026
- Lexicographic Word FrequenciesOA · Seen Jul 2026
Similar questions at other companies
- Count Colliding Object PairsZipRecruiter · OAZipRecruiter interview questions
- Count Distinct Tags in a Fixed-Radius Circle (Practice Reconstruction)Marshall Wace · OAMarshall Wace interview questions
- Count Pairs of Overlapping SquaresCapital One · OACapital One interview questions
- Count Overlapping Square PairsRamp · OARamp interview questions
- Starlink Beam PlannerSpaceX · OA · PHONE SCREENSpaceX interview questions
- Maximum Points in a Perimeter-Bounded RectangleAmerican Express · OAAmerican Express interview questions
- Best Meeting PointWalmart · OAWalmart interview questions
- HTTP Request RedirectionAmazon · OA
- Minimum Euclidean Distance Between PointsLuma AI · OALuma AI interview questions
- Closest Point to a LineAdobe · OAAdobe interview questions