Diagonal traversal of a matrix
Return the elements of a matrix diagonal by diagonal. In one version the direction alternates (up-right, then down-left); in another every diagonal is read in the same direction and the rows may have different lengths. Be ready for both.
No answer yet. Write the first one; the best answer gets endorsed.
