All challenges
mediumarrays 10 XP per passing test

Merge Two Sorted Arrays

Problem

Given two sorted arrays, merge them into a single sorted array. The input arrays are 0-indexed and non-empty, with each element being a non-negative integer. The first line of input contains two space-separated integers representing the sizes of the two input arrays. The next two lines contain the elements of the two arrays, space-separated. The output should be a single line with the merged array, space-separated.
(run your code to see output)
Advertisement
Sponsored