C3 AI Interview Question

Write a function that reverses a linked list.