Reverse Linked List

Easy

📝 Description

Reverse a singly linked list

Input Format

Linked list head node

Output Format

Reversed linked list head

Constraints

0 ≤ nodes ≤ 5000

🔍 Sample Input

1->2->3->4->5->NULL
            

✅ Sample Output

5->4->3->2->1->NULL
            

Code Editor

Please login to run and submit code.

Shortcuts: Ctrl+Enter to submit, Ctrl+Shift+R to run