15. Merge Two Sorted Lists
EasyLinked lists
Merge two sorted linked lists into one sorted list and return its head.
A linked list is passed as ListNode objects with val and next. The tests write lists as arrays.
Example 1
Input: a = [1, 2, 4], b = [1, 3, 4] Output: [1, 1, 2, 3, 4, 4]
Constraints
0 ≤ nodes in each list ≤ 50