Complete the code to split the array into two halves.
let mid = arr.len() [1] 2;
We divide the length by 2 to find the middle index for splitting.
Complete the code to recursively call merge_sort on the left half.
let left = merge_sort(&arr[0..[1]]);
We pass the slice from 0 to mid (exclusive) to sort the left half.
Fix the error in the merge function to compare elements correctly.
if left[i] [1] right[j] {
We compare if left element is less than right to merge in sorted order.
Fill both blanks to complete the merge loop conditions.
while i < [1] && j < [2] {
We loop while indices are within the lengths of left and right slices.
Fill both blanks to complete the merge function's final steps.
result.extend_from_slice(&left[[1]..]); result.extend_from_slice(&right[[2]..]); return result;
We add remaining elements from left starting at i, from right starting at j, then return result.
