Microsoft interview question

Spiral matrix classic leetcode question