Skip to content
DeepForgeby svx
All problems
EasyComputer Visioncv-007

Vertical Flip

Problem

Flip a 2D image vertically (mirror top-to-bottom).

The order of the rows is reversed while every row keeps its original order.

Test cases

case 1
in: [[[1,2,3],[4,5,6]]]
expected: [[4,5,6],[1,2,3]]
case 2
in: [[[7]]]
expected: [[7]]
case 3
in: [[[1,2],[3,4]]]
expected: [[3,4],[1,2]]
Starter codePython
def flip_vertical(image):
    # Your code here
    pass

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