Given two sorted arrays of integers, merge them into one sorted array containing all numbers
Example:
Input: first =[1, 4, 8],
second = [1, 3, 4, 17]
Output: [1, 1, 3, 4, 4, 8, 17]
Note:
Your algorithm should run in O(n + m) time and use O(n + m) extra space.
Walkthroughs of the solution. Try the steps first, then watch to compare approaches.
Free plan: 30 tutor messages. Premium is unlimited.
Saved
Ctrl + Enter to check