Microsoft Interview Question

write a algorithm to print a nXn matrix in spiral form.