less than 1 minute read

Given two lists of integers a and b sorted in ascending order, merge them into one large sorted list.

Constraints

  • 0 ≤ n ≤ 200,000 where n is the length of a
  • 0 ≤ m ≤ 200,000 where m is the length of b

https://binarysearch.com/problems/Merging-Two-Sorted-Lists

Examples

Example 1

Input

  • a = [5, 10, 15]
  • b = [3, 8, 9]

Output

  • answer = [3, 5, 8, 9, 10, 15]

Solution

Leave a comment