OYO interview question

The coding question was based on sorting algo for array