/** * * @param matrix int整型二维数组 * @return int整型一维数组 */ function spiralOrder( matrix ) { let result = []; if (matrix.length == 0) return result; let m = matrix.length, n = matrix[0].length; const dir = [[0, 1],[1, 0],[0, -1],[ -1, 0]]; let x = 0,y=0; let d = 0; for (...