Exercises/#21 Reverse Linked List
#21

Reverse Linked List

EasyπŸ”— Linked Lists
50 XP

Problem

Given the head of a singly linked list, reverse the list and return the reversed list.

Examples

Input: 1 β†’ 2 β†’ 3 β†’ 4 β†’ 5
Output: 5 β†’ 4 β†’ 3 β†’ 2 β†’ 1

Input: 1 β†’ 2
Output: 2 β†’ 1
linked-listtwo-pointerrecursion
AI Assistantβ€” powered by AI

Unlock hints progressively β€” start gentle, go deeper only if needed.

πŸ’‘

Level 1: Gentle Nudge

A subtle direction

πŸ—ΊοΈ

Level 2: Approach

The algorithm to use

πŸ”

Level 3: Detailed

Step-by-step guidance

21 / 150

Your Solution

⚑ JavaScript

to save progress and use AI features