Algorithm · Amazon · Medium
Requirements You receive two ascending arrays, arr1 and arr2. Array arr1 includes sufficient unused slots at its end to fit every value from arr2, as in the standard LC 88 setup. Combine the arrays without allocating another array, leaving arr1 in ascending order. Follow-up 1: solve the equivalent task when both inputs are ordered from largest to smallest. Follow-up 2: explain how you would handle arrays that arrive unsorted, including the resulting complexity. Examples The…
Checking your access…