ServiceNow Interview Question

Print a 2D matrix in spiral form