you give n x n 2D matrix represent image rotate image 90 degree clockwiseYou rotate image inplace mean modify input 2D matrix directly do not allocate 2d matrix rotation example 1input matrix 123456789output 741852963example 2input matrix 51911248101336715141216output 15132514341126891671011 Constraintsn matrixlength matrixilength1 n 201000 matrixij 1000