Easy to understand solution
Intuition\n Describe your first thoughts on how to solve this problem. \n\n# Approach\n Describe your approach to solving the problem. \n\n# Complexity\n- Time 
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\n\n# Complexity\n- Time complexity:\nO(N*M)\n\n- Space complexity:\nO(N*M)\n\n# Code\n```cpp []\nclass Solution {\npublic:\n    vector<vector<char>> rotateTheBox(vector<vector<char>>& box) {\n        int n = box.size();\n        int m = box[0].size();\n\n        vector<vector<char>> temp(m, vector<char>(n));\n\n        for(int i=0;i<m;i++){\n            for(int j=0;j<n;j++){\n                temp[i][j] = box[j][i];\n            }\n        }\n        for(int i=0;i<m;i++){\n            reverse(temp[i].begin(), temp[i].end());\n        }\n        for(int i=0;i<n;i++){\n            int k=0, j=0;\n            while(j<m){\n                if(temp[j][i] == \'*\' || j==m-1){\n                    int l=j;\n                    while(k<l){\n                        if(temp[k][i] != \'#\'){\n                            k++;\n                        }\n                        else if(temp[l][i] != \'.\'){\n                            l--;\n                        }\n                        else{\n                            swap(temp[k][i], temp[l][i]);\n                            k++;\n                            l--;\n                        }\n                    }\n                    k=j+1;\n                }\n                \n                j++;\n            }\n            j--;\n\n            \n        }\n        return temp;\n    }\n};\n```
['C++']