You are given an n x n 2D matrix representing an image. Rotate the image by 90 degrees clockwise in-place, meaning you have to modify the input 2D matrix directly without allocating another 2D matrix for the rotation.
Click Run to execute sample tests.