Your question is Merge and Sort Two Arrays. Start with the requirements on the right.
Run and submit as often as you like. When you're ready, talk me through your approach or go straight to the code.
Leidos mission software may receive integer readings from two unsynchronized sources. Implement a function that combines two unsorted arrays and returns every value in nondecreasing order.
You should sort each input array, then merge the sorted results with two pointers. Return a new array and do not modify either input array. Duplicate values must be preserved.
Given two arrays arr1 and arr2 of integers, return a new array containing all elements from both arrays in ascending order. The function must support empty arrays and negative values.
def merge_and_sort(arr1, arr2):