Merge Two Sorted Lists

Easy
Linked Lists Linked List Recursion

Given two sorted linked lists (as space-separated values), merge them into one sorted list.

Constraints

0 ≤ nodes ≤ 50

Examples

Example 1:
Input: 1 2 4 1 3 4
Output: 1 1 2 3 4 4
Example 2:
Input:
Output:
▲ Console

Install Talent Arabia

Get instant access to jobs and career tools on your device.