Given an array of integers, return the values in ascending order.
Implement merge sort instead of using a built-in sorting function.
Inputnums = [5, 2, 3, 1]
Output[1, 2, 3, 5]
Reading the values from smallest to largest gives 1, 2, 3, and 5.
Inputnums = [5, 1, 1, 2, 0, 0]
Output[0, 0, 1, 1, 2, 5]
Both 0s come first, then both 1s, followed by 2 and 5.
1 ≤ nums.length ≤ 50,000-50,000 ≤ nums[i] ≤ 50,000