Given an array of integers, how would you sort it? Implement sort_integers(nums) to return a new array containing the same integers in nondecreasing order, without modifying nums. Use an algorithm with O(n log n) worst-case time complexity and explain the time and space trade-offs. For example, [5, 2, 9, 1] becomes [1, 2, 5, 9], while an empty array remains empty.
def sort_integers(nums):