Simple Solution using Stack & Queue Combination
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:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\nO(n*m)\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\nO(n*m)\n\n# Code\n```cpp []\nclass Solution {\npublic:\n    void populate(stack<pair<int,int> > &space, queue<pair<int,int>> &stone, vector<vector<char>>&arr) {\n        while(!space.empty() && !stone.empty()) {\n            pair<int, int> sp = space.top();\n            pair<int, int> st = stone.front();\n            if(space.top().first<stone.front().first) {\n               break;\n            }\n            arr[st.first][st.second] = \'.\';\n            arr[sp.first][sp.second] = \'#\';\n            space.pop();\n            stone.pop();\n            \n        }\n        \n        while(!space.empty()) space.pop();\n        while(!stone.empty()) stone.pop();\n    }\n    vector<vector<char>> rotateTheBox(vector<vector<char>>& box) {\n        vector<vector<char>> newArr(box[0].size(), vector<char>(box.size()));\n        for(int i=0;i<box[0].size();i++) {\n            for(int j=0;j<box.size();j++) {\n                newArr[i][j] = box[j][i];\n            }\n        }\n        for(int i=0;i<newArr.size();i++) {\n            reverse(newArr[i].begin(), newArr[i].end());\n        }\n        for(int j=0;j<newArr[0].size();j++) {\n            stack< pair<int, int> > space;\n            queue< pair<int, int> > stone;\n            for(int i=0;i<newArr.size();i++) {\n                if(newArr[i][j]==\'#\') {\n                    stone.push({i,j});\n                }\n                else if(newArr[i][j]==\'.\') {\n                    space.push({i,j});\n                }\n                else {\n                    populate(space, stone, newArr);\n                }\n            }\n            populate(space, stone, newArr);\n        }\n        \n        return newArr;\n    }\n};\n\n/*\n    1 2 3\n    4 5 6\n    7 8 9\n\n    1\n\n\n    4 1\n    5 2\n    6 3\n*/\n```
['Stack', 'Queue', 'C++']