SIMPLE TWO-POINTER C++ COMMENTED
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:O(n*m)\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity:o(n*m)\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```\n\n#include <bits/stdc++.h>\n#define ll long long \n#define nl \'\\n\' \nclass Solution {\npublic:\n    vector<vector<char>> rotateTheBox(vector<vector<char>>& box){\n        int m = box.size();// rows of box \n        int n = box[0].size();// column of box \n        vector<vector<char>> rotated(n, vector<char>(m, \'.\'));\n     // Rotate the box 90 degrees clockwise\n        for(int i = 0; i < m; i++){\n            for(int j = 0; j < n; j++){\n                rotated[j][m - 1 - i] = box[i][j];\n            }\n        }\n    // Apply gravity to the rotated box\n        for(int col = 0; col < m; col++){ // Iterate over each column of the rotated matrix.\n            int bottom = n - 1;// Initialize \'bottom\' to the last row of the column, where stones will fall to.\n            for(int row = n - 1; row >= 0;row--){// Iterate from the bottom of the column upwards.\n                if(rotated[row][col] == \'*\'){// If an obstacle \'*\' is found\n                    bottom = row - 1;// reset \'bottom\' to the row just above the obstacle( grey color box is the new bottom)\n                }else if (rotated[row][col] == \'#\'){// If a stone \'#\' is found,\n                    rotated[row][col] = \'.\'; // clear the current position by setting it to \'.\'\n                    //(bcoz we are going to down due to gravity so current postion there is nothing )\n                    rotated[bottom][col] = \'#\'; // place the stone at the \'bottom\' position.\n                    bottom--; // Move the \'bottom\' up one row for the next stone.\n                }\n            }\n        }\n        return rotated;\n    }\n};\n```
['C++']