Sponsored
Sponsored
Use these hints if you're stuck. Try solving on your own first.
Rotate the box using the relation rotatedBox[i][j] = box[m - 1 - j][i].
Start iterating from the bottom of the box and for each empty cell check if there is any stone above it with no obstacles between them.