Medium
,Array
,Sorting
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(nlog(n))
time complexity and with the smallest space complexity possible.
Example 1:
Example 2:
Constraints:
nums.length
<= 5 * 104nums[i]
<= 5 * 104寫個merge sort好了比較簡單。
MarsgoatMar 1, 2023
Ron ChenThu, Mar 2, 2023