Write spiral(matrix) returning the elements of a rectangular matrix in clockwise spiral order.
spiral([[1, 2, 3], [4, 5, 6], [7, 8, 9]]) → [1, 2, 3, 6, 9, 8, 7, 4, 5]
spiral([]) → []
Submit runs 5 tests, including hidden edge cases.
Run your code to see the output here.