59. Spiral Matrix II
Difficulty: Medium
Given a positive integer n, generate a square matrix filled with elements from 1 to n2 in spiral order.
Example:
1 | Input: 3 |
Solution
Language: Java
1 | class Solution { |
Difficulty: Medium
Given a positive integer n, generate a square matrix filled with elements from 1 to n2 in spiral order.
Example:
1 | Input: 3 |
Language: Java
1 | class Solution { |