All problems
Horizontal Flip
Problem
Flip a 2D image horizontally (mirror left-to-right).
Each row is reversed while the order of the rows stays the same.
Test cases
case 1
in: [[[1,2,3],[4,5,6]]]
expected: [[3,2,1],[6,5,4]]
case 2
in: [[[7]]]
expected: [[7]]
case 3
in: [[[1,2],[3,4]]]
expected: [[2,1],[4,3]]
Starter codePython
def flip_horizontal(image):
# Your code here
pass3 test cases · run your code against them in the editor