spiral-matrix

Given a matrix of M x N elements , where M is the number of rows and N is the number of columns. write a program to return all elements of the matrix in spiral order