54. Spiral Matrix
Description: Given an m x n matrix, return all elements of the matrix in spiral order. ''' [1] four-pointer) idea:: top,bottom,left,right, direction code:: (below) -T/C: O(m*n) -S/C: O(1) # except for output list ''' class Solution: def spiralOrder(self, matrix: List[List[int]]) -> List[int]: output=[] top,bottom,left,right=0,len(matrix)-1,0,len(matrix[0])-1 dir=0 while top
2021.11.03