[algorithm] 배열 회전 Rotation of a Matrix
문제 2차원 N x N 배열을 시계 방향으로 90도 회전시킨 배열을 구한다. 입출력 예시 const matrix = [ [1, 2, 3, 4], [5, 6, 7, 8], [9, 10, 11, 12], [13, 14, 15, 16], ]; console.log(matrix[0][0]); // --> 1 console.log(matrix[3][2]); // --> 15 const rotatedMatrix = rotateMatrix(matrix); console.log(rotatedMatrix[0][0]); // --> 13 console.log(rotatedMatrix[3][2]); // --> 8 코드(JavaScript) const rotateMatrix = function (matrix, rotateN..
2022. 1. 12.