be careful about indexes
\nclass Solution {\npublic:\n    vector<vector<char>> rotateTheBox(vector<vector<char>>& a) {\n        int n = a.size();\n        int m  = a[0].size();\n       
```\nclass Solution {\npublic:\n    vector<vector<char>> rotateTheBox(vector<vector<char>>& a) {\n        int n = a.size();\n        int m  = a[0].size();\n        vector<vector<char>> res(m,vector<char>(n));\n        \n        for(int i=0;i<n;i++)\n        {\n            for(int j=0;j<m;j++)\n            {\n                res[j][i] = a[i][j];\n            }\n        }\n        \n        for(auto &i:res)\n        {\n            reverse(i.begin(),i.end());\n        }\n        \n        \n        for(int i=0;i<n;i++)\n        {\n            for(int j=m-1;j>=0;j--)\n            {\n                if(res[j][i] == \'.\')\n                {\n                    int st = -1;\n                    for(int k = j-1;k>=0;k--)\n                    {\n                        if(res[k][i] == \'*\')\n                            break;\n                        if(res[k][i] == \'#\')\n                        {\n                            st = k;\n                            break;\n                        }\n                            \n                    }\n                    \n                    if(st !=-1)\n                    {\n                        res[j][i] = \'#\';\n                        res[st][i] = \'.\';\n                    }\n                }\n            }\n        }\n        return res;\n    }\n};\n```
['C']