menu
techminis

A naukri.com initiative

google-web-stories
Home

>

Data Science News

>

1861. Rota...
source image

Dev

1M

read

422

img
dot

Image Credit: Dev

1861. Rotating the Box

  • You are given an m x n matrix of characters box representing a side-view of a box.
  • The box is rotated 90 degrees clockwise, causing some of the stones to fall due to gravity.
  • Return an n x m matrix representing the box after the rotation described above.
  • 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.

Read Full Article

like

25 Likes

For uninterrupted reading, download the app