Appian Interview Question

Print a n-by-n array in a spiral