Agoda interview question

Find a mistake in a given algorithm