Question d’entretien chez Bending Spoons

Coding task with apples and pears