Epic interview question

See Spiral matrix on LC