Rotate by 90 Degree
Problem Statement
Given a square matrix of size N x N. The task is to rotate it by 90 degrees in anti-clockwise direction without using any extra space.
Example 1
Example 2
Task
You dont need to read input or print anything. Complete the function rotateby90() which takes the matrix as input parameter and rotates it by 90 degrees in anti-clockwise direction without using any extra space. You have to modify the input matrix in-place.
Expected Time Complexity : O(N2)
Expected Auxiliary Space : O(1)
Constraints :
1 <= N <= 100
1 <= matrix[][] <= 1000
0 Comments