diff --git "a/leetcode3/\354\240\225\354\247\204\354\230\201/1861. Rotating the Box" "b/leetcode3/\354\240\225\354\247\204\354\230\201/1861. Rotating the Box" new file mode 100644 index 00000000..1b53b346 --- /dev/null +++ "b/leetcode3/\354\240\225\354\247\204\354\230\201/1861. Rotating the Box" @@ -0,0 +1,20 @@ +/** + * @param {character[][]} boxGrid + * @return {character[][]} + */ +var rotateTheBox = function(boxGrid) { + // 1. 돌 먼저 오른쪽으로 + // 1-1. * 이면 stop, # 이동 + // 2. 90도 회전 + + const m = boxGrid.length; // 1x3 + const n = boxGrid[0].length; + + let ans = Array.from( + {length : n}, + () => Array(m).fill('.')); // 3x1 + + for (let i = 0; i