Rotate the array clockwise
Execution time limit is 1 second
Runtime memory usage limit is 64 megabytes
Given a square two-dimensional array of size n x n, your task is to return its elements in a clockwise spiral order.
Input
The first line of the input contains a single integer n, representing the size of the array.
The following n lines each contain n integers, which are the elements of the array.
Output
Print the elements of the array in a clockwise spiral order.
Examples
Input #1
Answer #1
Submissions 2K
Acceptance rate 60%