You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We can add the Spiral Matrix II in other section.
Problem Statement - Given a positive integer n, generate an n x n matrix filled with elements from 1 to n^2 in spiral order.
Example:
Input: n=3
Output: [[1,2,3],[8,9,4],[7,6,5]]
Explanation:
Issue details
The algorithm will fill the matrix in spiral order and store the answer in an array of array and hence, return the same array.