OpenSense Labs interview question

Sort an array (in case of equality keep the relative ordering)