Problem
Submissions

Problem: Merge Two Sorted Lists

Statement

Given the heads of two sorted linked lists, list1 and list2, merge these lists into a single sorted list. This involves integrating all the nodes from both lists while ensuring that their sorted order is preserved. Return the head of the merged linked list as the output.

Constraints:

  • 00 ≤\leq Number of nodes in both lists ≤50\leq 50

  • −100≤-100 \leq Node.data ≤100\leq 100

  • Both lists are sorted in a non-decreasing order.

Problem
Submissions

Problem: Merge Two Sorted Lists

Statement

Given the heads of two sorted linked lists, list1 and list2, merge these lists into a single sorted list. This involves integrating all the nodes from both lists while ensuring that their sorted order is preserved. Return the head of the merged linked list as the output.

Constraints:

  • 00 ≤\leq Number of nodes in both lists ≤50\leq 50

  • −100≤-100 \leq Node.data ≤100\leq 100

  • Both lists are sorted in a non-decreasing order.