Skip to content
DeepForgeby svx
All problems
EasyComputer Visioncv-172

Patch Flatten

Problem

Flatten a 2D patch into a 1D vector.

Values are emitted in row-major order. An empty patch returns [].

Test cases

case 1
in: [[[1,2],[3,4]]]
expected: [1,2,3,4]
case 2
in: [[[5]]]
expected: [5]
case 3
in: [[[1,2,3]]]
expected: [1,2,3]
Starter codePython
def patch_flatten(patch):
    # Your code here
    pass

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