Dsa
Linked List
Warm-up
Reverse Linked List
You are given a linked list. Write a function to reverse the linked list. The input will be a linked list defined by a string of integers separated by spaces. Output should be the reversed linked list as a space-separated string. Example input: '1 2 3 4 5' should give the output '5 4 3 2 1'.
Key concepts
linked_listreversal
Practise this out loud — free
Start a mock interview on THIS exact question — a voice AI interviewer opens with it, pushes back like a real onsite, then hands you an instant scorecard.
🎙 Practise this question now