Rotation of image

in this sir told about transpose method but this works only in odd symmetric matrix if matrix is even or not symmetric so what would be the approach?

u are 99% times asked for a square matrix

i i never encountered a situation where a rectangular matrix is asked to rotate
u will have to do it the brute force way then