PythiloMedium · 25 min · Task 67 of 100 · progress kept in this browser

Read a matrix in a spiral

Return the values of a rectangular matrix in clockwise spiral order starting at the top-left. Empty input returns [].

matrix = [[1, 2, 3], [4, 5, 6]]
top, left, right = 0, 0, 2
print(matrix[top][left:right+1])
Your task

Return the values of a rectangular matrix in clockwise spiral order starting at the top-left. Empty input returns [].