Pergunta de entrevista da empresa Microsoft

Algorithm and code to print the elements of a matrix spirally