leetle

Daily challenge for 2025-01-20

20. Reverse Linked List

Write a function that, given the head of a singly linked list, reverses the list. Return the root node of the reversed list.

Example:
Input: 1 -> 2 -> 3 -> 4 -> 5
Output: 5 -> 4 -> 3 -> 2 -> 1

Run this challenge interactively in Python or JavaScript when the app loads.