I rotate the image 90 degrees from outer loop all the way to the inner loop. no flipping.

'''

public class Solution {

public void rotate(int[][] matrix) {

int len = matrix.length;

```
for(int i = 0; i< len/2; i++){
for(int j = 0; j<len-1-2*i; j++){
int temp = matrix[i][i+j];
matrix[i][i+j] = matrix[len-1-i-j][i];
matrix[len-1-i-j][i] = matrix[len-1-i][len-1-i-j];
matrix[len-1-i][len-1-i-j] = matrix[i+j][len-1-i];
matrix[i+j][len-1-i] = temp;
}
}
}
```

}

'''