Crossover for Work interview question

The coding test included an algorithm debugging problem