Given an array of integers nums, sort the array in ascending order and return it.
You must solve the problem without using any built-in functions in O(n log n) time complexity and with the smallest space complexity possible.
1 <= nums.length <= 5 * 10^4-5 * 10^4 <= nums[i] <= 5 * 10^4nums = [5,2,3,1][1,2,3,5]nums = [5,1,1,2,0,0][0,0,1,1,2,5]