First Republic's mobile banking experience may need to combine two unsorted collections of numeric activity values before presenting them in order. Given two arrays of integers, return a new array containing every value from both arrays in nondecreasing order.
You must not modify either input array. Duplicate values must be preserved, including duplicates that appear in the same array or in both arrays.
Implement combine_sorted_arrays(arr1, arr2), where arr1 and arr2 are arrays of integers. Return an array containing exactly len(arr1) + len(arr2) integers, sorted from smallest to largest. Either input may be empty.
A strong solution should sort each input independently and then merge the sorted arrays with two pointers. Explain why this is preferable to repeatedly selecting the minimum remaining value.
def combine_sorted_arrays(arr1, arr2):