rotate image 1 [LeetCode] 자바 48. Rotate Image 문제는 '정렬을 시계방향으로 90도 회전하라' 입니다 첫번째. class Solution { public void rotate(int[][] matrix) { int swap = 0; int size = matrix.length; int[][] swapMartix = deepCopy(matrix, matrix.length); for (int i = 0; i < size; i++) { for (int j = 0; j < size; j++) { matrix[j][size - 1 - i] = swapMartix[i][j]; } } } public static int[][] deepCopy(int[][] original, int n) { if (original == null) { return null; } in.. 2020. 8. 12. 이전 1 다음