1class Solution:2def rotateTheBox(self, box: List[List[str]]) -> List[List[str]]:3# move stones to right, row by row4for i in range(len(box)):5stone = 06for j in range(len(box[0])):7if box[i][j] == "#": # if a stone8stone += 19box[i][j] = "."10elif box[i][j] == "*": # if a obstacle11for m in range(stone):12box[i][j - m - 1] = "#"13stone = 014# if reaches the end of j, but still have stone15if stone != 0:16for m in range(stone):17box[i][j - m] = "#"1819# rotate box, same as leetcode #4820box[:] = zip(*box[::-1])2122return box