import java.util.*;
public class Main {
static Scanner scn = new Scanner(System.in);
public static void main(String[] args) {
int row = scn.nextInt();
int col = scn.nextInt();
int[][] arr = new int[row][col];
for (int i = 0; i < row; i++) {
for (int j = 0; j < col; j++) {
arr[i][j] = scn.nextInt();
}
}
ROTATEIMAGE(arr);
}
public static void ROTATEIMAGE(int [][] arr) {
int left,right,top,bottom,count;
left=0;
top=0;
right=arr[top].length-1;
bottom=arr.length-1;
count=(bottom+1)*(right+1);
while (left<=right && top<=bottom) {
if (count>0) {
for(int i=right;i>=0;i--) {
for(int j=top;j<=bottom;j++) {
System.out.println(arr[j][right]+" ");
count--;
}
right--;
}
}
}
}
}
what is wrong in this code???
