def get_intervals_overlap(a, b):
    """
    >>> get_intervals_overlap([0,  5], [10, 20])
    -5
    >>> get_intervals_overlap([0,  9], [10, 20])
    -1
    >>> get_intervals_overlap([0,  10], [10, 20])
    0
    >>> get_intervals_overlap([0,  15], [10, 20])
    5
    >>> get_intervals_overlap([10,  15], [10, 20])
    5
    >>> get_intervals_overlap([10,  20], [10, 20])
    10
    >>> get_intervals_overlap([15,  20], [10, 20])
    5
    >>> get_intervals_overlap([15,  15], [10, 20])
    0
    >>> get_intervals_overlap([20, 20], [10, 20])
    0
    >>> get_intervals_overlap([20, 20], [10, 20])
    0
    >>> get_intervals_overlap([30, 40], [10, 20])
    -10
    """
    return min(a[1], b[1]) - max(a[0], b[0])
