using modulo to go to the firs column after the last column
ans [ i ] [ j ] = arr [ j ] [ ( i + j ) % n ] ; } } return ans ; } public static void show ( int [ ] [ ] arr , int n ) { int [ ] [ ] res = solve ( arr , n ) ; for ( int i = 0 ; i < n ; i ++ ) { for ( int j = 0 ; j < n ; j ++ ) { System . out . print ( res [ i ] [ j ] + " ▁ " ) ; } System . out . println ( ) ; } }