def flatten(intervals):
    """ Turns `intervals` [[0,5], [8,10]] to [0, 1, 2, 3, 4, 5, 8, 9, 10].
    
    Note that it is inclusive of the second value.
    """
    out = []
    for i in intervals:
        out += list(range(i[0], i[1] + 1))
    return out