Given an array of integers, return a new array with the same values sorted in non-decreasing order. Implement the sort using merge sort and be ready to explain its time complexity.
Constraints
1 <= nums.length <= 10^5
-10^9 <= nums[i] <= 10^9
Return a new sorted array
Target time complexity: O(n log n)
Interviewer
Your question is Implement Merge Sort. Start with the requirements in the Question tab.
Run and submit as often as you like. When you're ready, talk me through your approach or go straight to the code.