CodeOath
← All problems

Reverse Linked List

Easy
linked-list

Reverse a singly linked list and return the new head.

Lists in this problem are given and returned as a plain array of values, in order.

Example:

Input: head = [1,2,3,4,5]
Output: [5,4,3,2,1]