Pregunta de entrevista de Amazon

Question was a reversed linked list problem