Skip to content

Commit 1d3c6df

Browse files
authored
Add rotateTheBox function for grid rotation
Implement initial structure for rotating the box grid.
1 parent 3f78f05 commit 1d3c6df

1 file changed

Lines changed: 20 additions & 0 deletions

File tree

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
/**
2+
* @param {character[][]} boxGrid
3+
* @return {character[][]}
4+
*/
5+
var rotateTheBox = function(boxGrid) {
6+
// 1. 돌 먼저 오른쪽으로
7+
// 1-1. * 이면 stop, # 이동
8+
// 2. 90도 회전
9+
10+
const m = boxGrid.length; // 1x3
11+
const n = boxGrid[0].length;
12+
13+
let ans = Array.from(
14+
{length : n},
15+
() => Array(m).fill('.')); // 3x1
16+
17+
for (let i = 0; i<m; i++){
18+
19+
}
20+
};

0 commit comments

Comments
 (0)