Input : arr[] = [2, 3, 8, -1, 7, 10]
Output : [-1, 2, 3, 7, 8, 10]
Explanation : First and last three sorted elements are [2, 3, 8] and [-1, 7, 10], after merging both halves we get a final sorted array.
Input : arr[] = [-4, 6, 9, -1, 3]
Output : [-4, -1, 3, 6, 9]
Explanation : First three and last two sorted elements are [-4, 6, 9] and [-1, 3], after merging both halves we get a final sorted array.