rotate a matrix

two steps. first swap matrix[i][j] and matrix[j][i], then swap
matrix[i][j] and matrix[i][matrix.length-1-j]