Amazon interview question

Flip a AxB array based on users input.