Doubt in Matrix rotaion while finding transpose

At 9:31 why did we put that if statement (i<j)?

and also why we ran both loop till n?

@akash_281 if i=0 and j=1 you swap and then when j=0,i=1 if you again swap then matrix will become like original transpose will not happen thats why
hope its clear if yes dont forget to hit like and mark resolved :smiley:

1 Like