Python Solution beats 97% (in-place)
\n# Code\npython []\nclass Solution:\n    def rotateTheBox(self, box: List[List[str]]) -> List[List[str]]:\n        cols = len(box[0])\n        for row in box:\
\n# Code\n```python []\nclass Solution:\n    def rotateTheBox(self, box: List[List[str]]) -> List[List[str]]:\n        cols = len(box[0])\n        for row in box:\n            available = cols - 1\n            for i in reversed(range(cols)):\n                if row[i] == \'#\':\n                    if available > i:\n                        row[i], row[available] = row[available], row[i]\n                    available -= 1\n                if row[i] == \'*\':\n                    available = i - 1\n        return zip(*reversed(box))\n        \n```\n![image.png](https://assets.leetcode.com/users/images/81e37734-9b13-4976-8fbc-8a46534bddc2_1732377529.152014.png)\n
['Python3']