Skip to content
DeepForgeby svx
All problems
MediumComputer Visioncv-152

Scale Boxes

Problem

Scale boxes by independent x and y factors.

Multiply x coordinates by sx and y coordinates by sy, rounding each value to 4 decimal places.

Test cases

case 1
in: [[[1,2,3,4]],2,3]
expected: [[2,6,6,12]]
case 2
in: [[[0,0,4,4],[2,2,3,3]],0.5,0.5]
expected: [[0,0,2,2],[1,1,1.5,1.5]]
case 3
in: [[],2,2]
expected: []
Starter codePython
def scale_boxes(boxes, sx, sy):
    # Your code here
    pass

3 test cases · run your code against them in the editor