Texas Instruments interview question

Asked About Spiral Matrix DSA problem