Pregunta de entrevista de BNY

Linkedlist reverse question in hackerrank need to submit