Pergunta de entrevista da empresa Bending Spoons

Coding task with apples and pears