Domanda di colloquio di Accenture

Codiing question from codility and leat code