Skip to content

Instantly share code, notes, and snippets.

@k1xme
Created June 17, 2014 18:01
Show Gist options
  • Save k1xme/e883ef163777cbaa3ba6 to your computer and use it in GitHub Desktop.
Save k1xme/e883ef163777cbaa3ba6 to your computer and use it in GitHub Desktop.
class Solution{
public static int[][] rotate(int[][] image){
int n = image[0].length;
int layer = 0;
int temp;
for(;layer< n/2; layer++){
for(int i = layer; i< n - layer - 1; i++){
temp = image[layer][i];
image[layer][i] = image[n-layer-1][i];
image[n-layer-1][i] = image[n-layer-1][]
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment