Java Solution O(mn) | Beats 92%
\nclass Solution {\n    public char[][] rotateTheBox(char[][] box) {\n        for (int i = 0; i < box.length; i++){\n            int lastObs = box[0].length;\n 
```\nclass Solution {\n    public char[][] rotateTheBox(char[][] box) {\n        for (int i = 0; i < box.length; i++){\n            int lastObs = box[0].length;\n            for (int j = box[0].length - 1; j >= 0; j--){\n                if (box[i][j] == \'*\'){\n                    lastObs = j;\n                }\n                else if (box[i][j] == \'#\'){\n                    box[i][j] = \'.\';\n                    box[i][lastObs - 1] = \'#\';\n                    lastObs--;\n                }\n            }\n        }\n        \n        char[][] rotate = new char[box[0].length][box.length];\n        for (int i = 0, k = box.length - 1; i < box.length && k >= 0; i++, k--){\n            for (int j = 0, l = 0; j < box[0].length && l < box[0].length; j++, l++){\n                rotate[l][k] = box[i][j];\n            }\n        }\n        return rotate;\n    }\n}\n```
[]