Rotate by 90 degree | Matrix | Love Babbar DSA Sheet | Amazon | Microsoft | Kick The Problem🔥🔥

Опубликовано: 18 Июнь 2026
на канале: Kick The Problem
257
5

My Playlists...

Array playlist :    • Array Problems  

Linked list playlist :    • Linked list Problems  

String playlist :    • String  

Tree playlist :    • Tree  

Graph Playlist :    • Graph  

Searching and Sorting :    • Searching and Sorting  
-------------------------------------------------------------------------------------------------------------
Question link : https://practice.geeksforgeeks.org/pr...
-------------------------------------------------------------------------------------------------------------
Given a square matrix[][] of size N x N. The task is to rotate it by 90 degrees in an anti-clockwise direction without using any extra space.

Example 1:

Input:
N = 3
matrix[][] = [[1 2 3],
[4 5 6],
[7 8 9]]
Output:
3 6 9
2 5 8
1 4 7
Your Task:
You only need to implement the given function rotate(). Do not read input, instead use the arguments given in the function.

Expected Time Complexity: O(N*N)
Expected Auxiliary Space: O(1)
-------------------------------------------------
-- #KTP​​ --
-- #Shivam_Kasaudhan --
-- #Kick_The_Problem --
-- #Coding --
-- #GeeksforGeeks --
-- #CodeForces --
-- #Codechef --
-- #Hackerrrank --
-- #Love_Babbar_DSA_Sheet --
-- #Rotate_by_90_degree --

Follow us on Telegram for updates : https://t.me/kicktheproblem
Follow our Page on Facebook for updates :   / kick-the-problem-110392081196215  

--------------------------------------------------------------------
Please Like, Share and Subscribe..
For more these kinds of videos ,stay tuned..
If you have doubts , put in comments box ....
---------------------------------------------------------------------------------------------
#Coding #Competitive_Programming #Matrix