Domanda di colloquio di Amazon

Question was a reversed linked list problem