crate with m rows and n columns. Each cell holds one of:
- '#': a stone;
- '*': a shelf fixed firmly inside the crate;
- '.': empty space.
The crate is tipped onto its right side, i.e. turned 90° clockwise. After the turn, gravity pulls the stones down until each one rests on a shelf, on another stone or on the floor of the crate. Shelves stay where they are, and stones fall straight down without drifting sideways.
Return the picture of the crate after the turn and the fall: a grid with n rows and m columns.crate=[["#", "#", ".", "*", "#", "."]] → [['.'], ['#'], ['#'], ['*'], ['.'], ['#']]
After the turn the row becomes a column whose bottom is its old right end. The two left stones slide down onto the shelf *, the right stone drops to the floor.
crate=[[".", "#"], ["#", "."]] → [['.', '.'], ['#', '#']]
The bottom row of the crate becomes the left column and the top row becomes the right one. In both columns the stone ends up on the floor.
crate have the same length ncrate[i][j] is one of '#', '*', '.'crate=[["#", "#", ".", "*", "#", "."]]
[['.'], ['#'], ['#'], ['*'], ['.'], ['#']]
Run checks the first 3 tests in your browser. Submit checks all 115 tests on the server, hidden ones included.