Search⌘ K

DIY: Rotate Image

Explore how to rotate an n by n image matrix clockwise by implementing a function in Scala. This lesson helps you understand 2D array manipulations and prepares you for common coding interview problems involving matrix transformations.

Problem statement

For this problem, you are given a matrix. You have to implement the function that will rotate the image pixels given in a matrix form clockwise.

Constraints

  • matrix.length == n
  • matrix[i].length == n
  • 1 <=
...