S&P Global Interview Question

invert the linked list