Merge Two Sorted Arrays

Easy
Arrays Array Two Pointers Sorting

Given two sorted integer arrays, merge them into one sorted array. Print space-separated.

Constraints

0 ≤ length ≤ 10^4

Examples

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

Install Talent Arabia

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