2
public boolean findRotation(int[][] mat, int[][] target) {3
if (mat == target) return true;5
int[] res[] = new int[n][n];6
for (int i = 0; i < n; i++) { // clockwise 907
for (int j = 0; j < n; j++) {8
res[i][j] = mat[n - 1 - j][i];12
int[] res2[] = new int[n][n];13
for (int i = 0; i < n; i++) { // clockwise 18014
for (int j = 0; j < n; j++) {15
res2[i][j] = res[n - 1 - j][i];19
int[] res3[] = new int[n][n];20
for (int i = 0; i < n; i++) { // clockwise 27021
for (int j = 0; j < n; j++) {22
res3[i][j] = res2[n - 1 - j][i];26
// compare to 90,180,270 and itself27
if (Arrays.deepEquals(target, res)28
|| Arrays.deepEquals(target, res2)29
|| Arrays.deepEquals(target, res3)30
|| Arrays.deepEquals(target, mat)) {37
// Arrays.deepEquals() use for matrix