Given a positive integer n, generate an n x n matrix filled with elements from 1 to n^2 in spiral order.
Word Count: 0