Given a matrix, return it in spiral order.
Implement spiral_order(matrix), returning a one-dimensional list of elements visited clockwise from the top-left corner. The matrix may be square or rectangular, and each row has the same length. Return an empty list for an empty matrix.
def spiral_order(matrix):