Search⌘ K
AI Features

DIY: Rotate Image

Understand how to rotate an image represented by a 2D array clockwise by implementing the autoRotate function. This exercise helps strengthen your skills in array manipulation and prepares you for matrix-based coding interview questions.

Problem statement

For this problem, you are given a 2D array. 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 <= n
...