Question d’entretien chez Bending Spoons

Logical reasoning test, programming exercise.