He has a 1D array that contains a 2D image and he wants to rotate that image 90 degrees, and he doesn't care if it gets rotated clockwise, counterclockwise, or one of those at random.
How would you do it in a 2D array? If you can do that, you can translate that to a 1D array, as a 2D array is really just a 1D array being represented to you differently. Here's a 2D array, being represented with 1D indices.
012
345
678
Each 3 indices starts a new "row" of the array. This is really all 2D arrays are. If you access element [1][0] here, the back end is just saying "Ok, let's access element [3(1) + 0]."
Can you see what happened there? It took the final column and made it the first row, second to last column because the second row, third to last column because third row, etc...