JAVA_LeetCode 48_Rotate Image 풀이 class Solution { public void rotate(int[][] matrix) { int len = matrix.length, len2 = matrix[0].length, temp = 0; /** 1 2 3 4 5 6 7 8 9 */ // 행 / 열을 바꿔준다. for (int i = 0; i < len; i++) { for (int j = i; j < len2; j++) { // 동일하지 않은경우 변경 if (i != j) { temp = matrix[i][j]; matrix[i][j] = matrix[j][i]; matrix[j][i] = temp; } } } /** 1 4 7 2 5 8 3 6 9 */ // 행의 좌우 반전 for (int i = 0; i < len; i++) { for (int j = 0; j < len2 / 2 ; j++) { temp = matrix[i][j]; matrix[i][j]...
원문 링크 : JAVA_LeetCode 48_Rotate Image