On April 12, we remember Yuri Gagarin's historic flight into space in 1961—a true demonstration of planning and precise sequencing. In the spirit of that achievement, your task is to implement the merge sort algorithm. Merge sort is an efficient, comparison-based, divide and conquer sorting algorithm.
Implement a merge sort algorithm that takes an array (or list) of integers and returns a new array with the integers sorted in ascending order.
Input: [38, 27, 43, 3, 9, 82, 10]
Output: [3, 9, 10, 27, 38, 43, 82]
Below is some language-agnostic starter code to help you begin. Choose the language of your preference from the provided options.