Easiest Approach
Intuition\nDry Run few examples on paper and u will find the origional approach \n\n# Approach\n# first  of all pick each row and modify it according to the que
# Intuition\nDry Run few examples on paper and u will find the origional approach \n\n# Approach\n# first  of all pick each row and modify it according to the question conditions\n\n# Secondly, replace origional row with modified row\n# Thirdly, Take transpose of matrix by using zip() function\n# Fourth, reverse each row\n# then return matrix\n\n\n\n# Code\n```python3 []\nclass Solution:\n    def rotateTheBox(self, box: List[List[str]]) -> List[List[str]]:\n        i=0\n        for row in box:\n            inverted=self.Align(row)\n            box[i]=inverted\n            i+=1\n        transposed=[list(row) for row in zip(*box)]\n        rotated=[row[::-1] for row in transposed]\n        return rotated\n    def Align(self,row):\n        n=len(row)\n        for i in range(n-1,-1,-1):\n            if row[i]==\'#\':\n                while i+1<n and row[i+1]!="*" and row[i+1]!="#":\n                    row[i+1]=row[i]\n                    row[i]="."\n                    i+=1\n        return row\n\n        \n```
['Python3']