Pergunta de entrevista da empresa Asana

Write a function that given a 2d array traverses it in a spiral way, from the top left corner to the center.