Two Pointer Approach
\nclass Solution {\npublic:\n    vector<vector<char>> rotateTheBox(vector<vector<char>>& box) {\n        int m = box.size();\n        int n = box[0].size();\n  
```\nclass Solution {\npublic:\n    vector<vector<char>> rotateTheBox(vector<vector<char>>& box) {\n        int m = box.size();\n        int n = box[0].size();\n        \n        vector<vector<char>> ans(n,vector<char>(m,\'.\'));\n        \n        for(int i=0;i<m;++i){\n            int k = n; //Stores last obstacle or occupied position\n            for(int j=n-1;j>=0;--j)\n            {\n                if(box[i][j] == \'#\')\n                {\n                    ans[--k][i] = \'#\';\n                }\n                else if(box[i][j] == \'*\')\n                {\n                     k = j;\n                     ans[j][i] = \'*\';\n                }   \n            }\n        }\n        for(int i=0;i<n;++i){\n            reverse(ans[i].begin(), ans[i].end());\n        }\n        return ans;\n    }\n};\n```
['Two Pointers', 'C']