[leetcode] 59. Spiral Matrix II @ python

原题 Given a positive integer n, generate a square matrix filled with elements from 1 to n2 in spiral order.python Example:web Input: 3 Output: [ [ 1, 2, 3 ], [ 8, 9, 4 ], [ 7, 6, 5 ] ]svg 解法 首先初始化n*n的0
相关文章
相关标签/搜索