Pregunta de entrevista de OANDA

Question about an algorithm for scrumble game