Back to DSA sheet

Reverse a Linked List

EasyLinked List
Open on LeetCodeAmazonGoogleMeta

Reverse a singly linked list and return the new head.

Constraints
  • 0 <= list length <= 5000
  • -5000 <= Node.val <= 5000
Sheets
Blind 75Grind 75NeetCode 150
reverse-a-linked-list.cpp
Loading editor
Custom input (stdin)
Output

Run your code to see its output.