Problem 1861. Rotating the box. Perhaps stupid solution xd
Code\njavascript []\n/**\n * @param {character[][]} box\n * @return {character[][]}\n */\nvar rotateTheBox = function(box) {\n    let countStones;\n    for(let 
# Code\n```javascript []\n/**\n * @param {character[][]} box\n * @return {character[][]}\n */\nvar rotateTheBox = function(box) {\n    let countStones;\n    for(let i = 0; i<box.length; i++){\n        countStones = 0;\n        for(let j = 0; j<box[i].length; j++){\n            switch(box[i][j]){\n                case \'#\':\n                    countStones++;\n                    box[i][j] = "."\n                break;\n                case \'*\':\n                    while(countStones!==0){\n                        box[i][j-countStones] = "#";\n                        countStones--;\n                    }\n                break;\n            }\n        }\n        while(countStones!==0){\n            box[i][box[i].length-countStones] = "#";\n            countStones--; \n        }\n    }\n    return rotateMatrix90(box);\n};\n\nfunction rotateMatrix90(matrix) {\n    const transposed = matrix[0].map((_, colIndex) => matrix.map(row => row[colIndex]));\n    return transposed.map(row => row.reverse());\n}\n```
['JavaScript']