Image rotation problem

How to solve this? Someone explain with a solution

Please share the question link

It’s in course content. A image is of 2d array form and we have to rotate it by 90 degree

You can simply print all the array elements column wise, starting from the last column and moving towards first column. For every column, print every element from top row to bottom row, separated with space.