Agoda Interview Question

Find a mistake in a given algorithm