Given a positive integer n, generate an n x n matrix filled with elements from 1 to n2 in spiral order.
c++
1 | class Solution { |