Please help find me the eror
Why do we have to start from i
if we start from 0 then we will get same array…
just try to print ur array and see what u r getting
We have to rotate one triangle as in the video
yeah upper half with lower half.
basically u first need to rotate rowwise and then u have to take its transpose.
the issue was with ur transpose(becuase u are swapping in the same array, each element will be swapped twice as result ur array will remain same).
each element will reverse twice because .
first u will swap (i,j) with (j,i) when outer loop will be at i and inner loop will be at j.
second u will swap (i,j) with (j,i) when outer loop will be at j and inner loop will be at i.
I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.
On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.