CodeMentor
.
Ask AI
Problems
Learn
C++
TCS
Core CS
HR
Progress
Search
Ctrl
K
0
Lv 1
Problems
Linked List
Reverse Linked List
Easy
LeetCode
1/3
00:00
Hint
Run
Ctrl
↵
Submit
Description
Lesson
Code walk
Solution
Easy
Linked List
LeetCode #206
Reverse Linked List
Three pointers: prev, cur, next. Classic interview.
Examples
Example 1
Input
5 1 2 3 4 5
Output
5 4 3 2 1
Example 2
Input
2 1 2
Output
2 1
Stuck? Take a nudge
Reveal hint 1 of 3
C++17
Autosaves
Reset
Console
Run your code to see results