✅ One Line Solution
(Disclaimer: this is not an example to follow in a real project - it is written for fun and training mostly)\n\n# Code #1.1\nTime complexity: O(mnlog(n)). Space
(Disclaimer: this is not an example to follow in a real project - it is written for fun and training mostly)\n\n# Code #1.1\nTime complexity: $$O(m*n*log(n))$$. Space complexity: $$O(m*n)$$.\n```python3\nclass Solution:\n    def rotateTheBox(self, g: List[List[str]]) -> List[List[str]]:\n        return zip(*[re.sub(\'[.#]+\',lambda m:\'\'.join(sorted(m[0])[::-1]),\'\'.join(r)) for r in g][::-1])\n```\n\n# Code #1.2\nTime complexity: $$O(m*n)$$. Space complexity: $$O(m*n)$$.\n```python3\nclass Solution:\n    def rotateTheBox(self, g: List[List[str]]) -> List[List[str]]:\n        return zip(*[re.sub(\'[.#]+\',lambda m:\'.\'*m[0].count(\'.\')+\'#\'*m[0].count(\'#\'),\'\'.join(r)) for r in g][::-1])\n```\n\n# Code #2\nTime complexity: $$O(m*n*log(n))$$. Space complexity: $$O(m*n)$$.\n```python3\nclass Solution:\n    def rotateTheBox(self, g: List[List[str]]) -> List[List[str]]:\n        return zip(*[\'*\'.join(\'\'.join(sorted(s)[::-1]) for s in \'\'.join(r).split(\'*\')) for r in g][::-1])\n```\n[Ref](https://leetcode.com/problems/rotating-the-box/solutions/1246483/python-3-one-line)\n\n(Disclaimer 2: code above is just a product of fantasy packed into one line, it is not claimed to be \'true\' oneliners - please, remind about drawbacks only if you know how to make it better)
['Array', 'String', 'Matrix', 'Python', 'Python3']