Loading problem…
Pick the best worst-case time and extra-space complexity.
function mergeSort(nums) { if (nums.length <= 1) return nums const mid = Math.floor(nums.length / 2) const left = mergeSort(nums.slice(0, mid)) const right = mergeSort(nums.slice(mid)) return merge(left, right) }