Walmart interview question

Print the matrix in zigzag form.