Domanda di colloquio di Indigo

There was a live coding exercise for a relatively simple problem