
Sort an integer array in ascending order by implementing merge sort. Return a new sorted array, handle duplicates and negative values, and do not rely on Python's built-in sorting functions.
nums = [5, 2, 3, 1]Output[1, 2, 3, 5]WhyThe values are reordered from smallest to largest.nums = [5, 1, 1, 2, 0, 0]Output[0, 0, 1, 1, 2, 5]WhyDuplicate values remain in the result and are sorted correctly.`1 <= len(nums) <= 10^5``-10^9 <= nums[i] <= 10^9`Must handle duplicate and negative values