Sprinklr interview question

Given a matrix, print its spiral version.