diff --git "a/leetcode3/\354\230\244\354\235\200\355\230\201/1861. Rotating the Box" "b/leetcode3/\354\230\244\354\235\200\355\230\201/1861. Rotating the Box" new file mode 100644 index 00000000..bd99fc3e --- /dev/null +++ "b/leetcode3/\354\230\244\354\235\200\355\230\201/1861. Rotating the Box" @@ -0,0 +1,11 @@ +class Solution: + def rotateTheBox(self, grid: list[list[str]]) -> list[list[str]]: + + + for y in range(len(grid)) + board=[[] for _ in range(len(grid[0]))] + for y in grid: + for i in range(len(y)): + board[i].append(y[i]) + + diff --git "a/leetcode3/\354\230\244\354\235\200\355\230\201/1914. Cyclically Rotating a Grid" "b/leetcode3/\354\230\244\354\235\200\355\230\201/1914. Cyclically Rotating a Grid" new file mode 100644 index 00000000..22c6a60d --- /dev/null +++ "b/leetcode3/\354\230\244\354\235\200\355\230\201/1914. Cyclically Rotating a Grid" @@ -0,0 +1,46 @@ +from collections import deque +class Solution: + def rotate(self,grid,x,y,xn,yn,k): + dq=deque([]) + cur_x=x + cur_y=y + while cur_x=x: + dq.append((cur_y,cur_x)) + cur_x-=1 + cur_x+=1 + cur_y-=1 + while cur_y>y: + dq.append((cur_y,cur_x)) + cur_y-=1 + return dq + temp=yn*xn-(yn-2)*(xn-2) + k=k%temp + + if k=yn and k List[List[int]]: + return self.rotate(grid,0,0,len(grid[0]),len(grid),k) diff --git "a/leetcode3/\354\230\244\354\235\200\355\230\201/copy" "b/leetcode3/\354\230\244\354\235\200\355\230\201/copy" new file mode 100644 index 00000000..917c84d4 --- /dev/null +++ "b/leetcode3/\354\230\244\354\235\200\355\230\201/copy" @@ -0,0 +1,13 @@ +# + +''' +1. 아이디어 : + + +2. 시간복잡도 : + O() + +3. 자료구조/알고리즘 : + + +'''