Wabtec Interview Question

Bubble short , swap, puzzle,oops