Pregunta de entrevista de Jumia

it was a codility task