Given a positive integer n, generate a square matrix filled with elements from 1 to n^2 in spiral order.
Example
Input: 3
Output:
1 | [ |
Code
1 | private int number = 0; |
写BUG的程序猿
Given a positive integer n, generate a square matrix filled with elements from 1 to n^2 in spiral order.
Input: 3
Output:
1 | [ |
1 | private int number = 0; |