Given an image represented by an N x N matrix, where each pixel in the image is 4 bytes, write a method to rotate the image by 90 degrees. Can you do this in place?
Example 1:
Given matrix = [ [1,2,3], [4,5,6], [7,8,9] ],
Rotate the matrix in place. It becomes: [ [7,4,1], [8,5,2], [9,6,3] ] Example 2: