Rotate image (n * n array)

sir is this the correct way to approach this problem

and sir what are the mistakes

@qudsiya correct approach is -
first step- reverse all the rows
second step - take the transpose of matrix
example
2
1 2
3 4
step 1
2 1
4 3
step 2
2 4
1 3