LeetCode
Spiral Matrix II
Click
here
for an explanation.