LeetCode48
作者:互联网
https://leetcode.cn/problems/rotate-image/
class Solution {
public void rotate(int[][] matrix) {
int len=matrix.length;
int[][] newMat=new int[len][len];
for(int i=0;i<len;i++){
for(int j=0;j<len;j++){
newMat[j][len-1-i]=matrix[i][j];
}
}
for(int i=0;i<len;i++){
for(int j=0;j<len;j++){
matrix[i][j]=newMat[i][j];
}
}
}
}
标签:rotate,cn,int,image,len,LeetCode48,matrix 来源: https://www.cnblogs.com/sherryyuan/p/16527269.html