Resize Rectangles While Preserving Vertical Gaps (Using y and height)

Part 2: Include y-coordinates; preserve relative vertical gaps after resizing

Each rectangle i has a height h[i] and a vertical position y[i] representing the bottom y-coordinate. Its ve...

Example

Unlock to view complete problem details

and practice with sample input/output

Was this article helpful?

View Test Cases & Run Code requires membership

Standard Input
Execution Result: