static void rotateCW90InPlace(int[][] m, int n)
	{
	    int i, j;
	// first mirror the matrix along the diagnal line.
	    for (i = 0; i < n; i++)
	    {
	        for (j = i + 1; j < n; j++)
	        {
	            int tmp = m[i][j];
	            m[i][j] = m[j][i];
	            m[j][i] = tmp;
	        }
	    }

	// mirror the matrix horizontally.
	    for (i = 0; i < n / 2; i++)
	    {
	        for (j = 0; j < n; j++)
	        {
	            int tmp = m[j][i];
	            m[j][i] = m[j][n - i - 1];
	            m[j][n - i - 1] = tmp;
	        }
	    }
	}