def merge(left, right):
    """
    Takes two sorted sub lists and merges them in to a single sorted sub list
    and returns it.

    :param left: A list of sorted integers
    :param right: A list of sorted integers
    :rtype: A list of sorted integers
    """
    result = []
    n, m = 0, 0
    while n < len(left) and m < len(right):
        if left[n] <= right[m]:
            result.append(left[n])
            n += 1
        else:
            result.append(right[m])
            m += 1

    result += left[n:]
    result += right[m:]
    return result