Doubt with rotatae function

Hello i have written the same code as discussed in the video but i am still getting errors and that is only with the “ROTATE” function

can you please tell me my mistake?

you have to transpose the matrix only after reversing all the columns means after the loop
NOT inside loop

i have modified your code see below

Modified code