Implement the Merge Sort algorithm to sort an array of integers in ascending order. Merge sort is a divide-and-conquer algorithm that works by recursively breaking down a problem into two or more sub-problems until these become simple enough to be solved directly.
- An unsorted integer array
nums.
Input: nums = [5, 2, 3, 1]
Output: [1, 2, 3, 5]