CodeMentor
.
Ask AI
Problems
Learn
C++
TCS
Core CS
HR
Progress
Search
Ctrl
K
0
Lv 1
Problems
Linked List
Merge Two Sorted Lists
Easy
LeetCode
2/3
00:00
Hint
Run
Ctrl
↵
Submit
Description
Lesson
Code walk
Solution
Easy
Linked List
LeetCode #21
Merge Two Sorted Lists
Dummy head + stitch smaller node each time.
Examples
Example 1
Input
3 1 2 4 3 1 3 4
Output
1 1 2 3 4 4
Example 2
Input
0 0
Output
Stuck? Take a nudge
Reveal hint 1 of 3
C++17
Autosaves
Reset
Console
Run your code to see results