0ms 100% event stack
first we create a rotated matrix with all cell set to dot.Then for each row:
create a vector composed of events (obstacle/stone).
fill from bottom the rotated m

first we create a rotated matrix with all cell set to dot.

Then for each row:
    create a vector composed of events (obstacle/stone).
    fill from bottom the rotated matrix while events are left:
       obstacle are written as such and update the current rotated row so a stone will fall just above (c - 1);
       similar happen to stone (another stone would fall just above)


# Code
```cpp []
class Solution {
public:
    vector<vector<char>> rotateTheBox(const vector<vector<char>>& boxGrid) {
        const int box_R = boxGrid.size();
        const int box_C = boxGrid[0].size();
        vector<vector<char>> rotated(box_C, vector<char>(box_R, '.'));
        vector<char> events;
        events.reserve(boxGrid[0].size());

        for (int r = 0; r != box_R; ++r) {

            for (const char& c : boxGrid[r]) {
                if (c != '.') {
                    events.push_back(c);
                }
            }

            int rot_r = box_C - 1;
            int c = box_C - 1;

            while (!events.empty()) {

                if (events.back() == '#') { // stone
                    rotated[rot_r][box_R - r - 1] = events.back();
                    events.pop_back();
                    --rot_r;
                } else if (boxGrid[r][c] == '*') { // obstable

                    rotated[c][box_R - r - 1] = events.back();
                    events.pop_back();
                    rot_r = c - 1;
                }

                --c;
            }
            events.clear();
        }

        return rotated;
    }
};
```
['C++']