Amazon Interview Question

reversing a linked list from leetcode