[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
相關文章
相關標籤/搜索