Send Feedback

Rotate Image

Total Accepted: 5505 Total Submissions: 18156 My Submissions

You are given an n x n 2D matrix representing an image.

Rotate the image by 90 degrees (clockwise).

Follow up:
Could you do this in-place?

Discuss


You have not signed in, cannot submit your code.
Submit failed, try again please.
You have attempted to resubmit too soon. Please resubmit in a moment.

Send Feedback