Domanda di colloquio di Rattle

Solve data structure question. Had to use linked list