Pregunta de entrevista de Bending Spoons

Coding task with apples and pears