Transpose of reversed 2d array

why to add conditions
if(i<j) in transposing
we can still get tranpose without this condition

Hey @khushiujjawal
Assume after reversing rows we have

a b
c d

Now if we dont add that condition then we swap
1)a with a

a b
c d

2)b with c

a c
b d

3)again b with c

a b
c d

4)d with d

a b
c d

See we are back to original matrix
Hence that condition is necessary