a
and b
that are sorted in non-decreasing order. Merge a
and b
into merged
sorted in non-decreasing order and return merged
.
merged.length === a.length + b.length
but merged
is written as an empty array in the sample tests below for simplicity.
merge([-1, 2, 2, 3],[0, 4], []]) → [-1, 0, 2, 2, 3, 4]
merge([8, 12], [6, 10, 14], []) → [6, 8, 10, 12, 14]
merge([1], [], []) → [1]
😳 TIME LEFT: seconds 😳
function merge(a, b, merged) {
}
⏰ TOTAL TIME: seconds ⏰