观察矩阵外圈,宏观想像 import java.util.*; public class Solution { public int[][] rotateMatrix(int[][] mat, int n) { // write code here int x1 = 0, y1 = 0; int x2 = mat.length - 1, y2 = mat[0].length - 1; while (x1 <= x2 && y1 <= y2) { rotateEdge(mat, x1++, y1++, x2--, y2--); } return mat; } publ...