2021 Dev-Matching: 웹 백엔드(상반기)1 [프로그래머스] 행렬 테두리 회전하기 - 자바(Java), 구현, 2021 Dev-Matching: 웹 백엔드(상반기) 문제 https://programmers.co.kr/learn/courses/30/lessons/77485 풀이 코드 - 구현 풀이 과정 좌측 상단 테두리 (x1, y1) 위치의 값을 저장해 놓는다. 행렬의 좌측 테두리 -> 하단 테두리 -> 우측 테두리 -> 상단 테두리 순으로 시계 방향으로 행렬의 값을 한칸씩 이동시킨다. 저장해 두었던 좌측 상단 테두리 값을 (x1, y1+1) 위치에 저장한다. class Solution { public int[] solution(int rows, int columns, int[][] queries) { int[] answer = new int[queries.length]; int[][] board = new int[rows+1][columns+1]; int num .. 2021. 10. 21. 이전 1 다음