Skip to main content

Merge Two Sorted Arrays

JUNIOR
GoogleFacebook

Given two sorted arrays nums1 and nums2, merge them into a single sorted array.

Example:

Input: nums1 = [1, 3, 5], nums2 = [2, 4, 6]
Output: [1, 2, 3, 4, 5, 6]

Examples:

Input 1:{"nums1":[1,3,5],"nums2":[2,4,6]}
Output 1:[1,2,3,4,5,6]
Input 2:{"nums1":[1,2,3],"nums2":[4,5,6]}
Output 2:[1,2,3,4,5,6]

Loading editor...

Run your code to see results

Click the Run button above