Problems/

Merge Two Sorted Lists

EASY
+10 XP Reward

Merge Two Sorted Lists

Solved
DSA
•62% Acceptance Rate•10,234 Submissions
You are given the heads of two sorted linked lists list1 and list2. Merge the two lists into one sorted list. The list should be made by splicing together the nodes of the first two lists. Return the head of the merged linked list.

Constraints:

The number of nodes in both lists is in the range [0, 50].

Related Topics:

Linked List
Recursion
Console Output
Click "Run Test Cases" to test with public inputs or "Submit Solution" to run full evaluation suite.