public static void main(String[] args) {
        RotateImage r = new RotateImage();
        int[][] arr = {{1, 2, 3}, {4, 5, 6}, {7, 8, 9}};
        r.reverse(arr);
        for (int[] arr1 : arr) {
            for (int i : arr1)
                System.out.print(i + " ");
            System.out.println();
        }
    }