顺时针旋转矩阵:本来是左上读到右下,现在顺时针旋转90°后,应该从左下读到右上。 以下是代码实现:①定义一个二维数组②写出两个for循环,从左下角从下往上的顺序开始读取元素③注意:获取mat元素时i和j谁在行谁在列④将获取的元素放入二维数组中,return即可。public int[][] rotateMatrix(int[][] mat, int n) { // write code here int[][] res = new int[n][n]; for (int i = 0; i < n; i++) { for (i...