def merge_sort(array):
    '''
    >>> merge_sort([3 ,5, 1, 2, 10, 6])
    [1, 2, 3, 5, 6, 10]
    '''
    if len(array) < 2:
        return array

    mid = len(array)//2
    left = merge_sort(array[:mid])
    right = merge_sort(array[mid:])

    res = []
    i, j = 0, 0
    while i < len(left) and j < len(right):
        if left[i] <= right[j]:
            res.append(left[i])
            i += 1
        else:
            res.append(right[j])
            j += 1

    if left[i:]:
       res.extend(left[i:])
    if right[j:]:
        res.extend(right[j:])
    return res
dataset/ETHPy150Open bt3gl/Python-and-Algorithms-and-Data-Structures/src/searching_and_sorting/sorting/merge_sort.py/merge_sort/original