Domanda di colloquio di Meta

It was a typical coding question. Nothing too complicated