Google interview question

Spiral matrix III, Leetcode Question