<jupyter_start><jupyter_text>Challenge 20  Challenge 20.1<jupyter_code>myinput = '/home/fmuinos/projects/adventofcode/2016/ferran/inputs/input20.txt'
def min_func(myinput):
    mylist = []
    with open(myinput, 'rt') as f:
        for line in f:
            mylist.append([int(i) for i in line.rstrip().split('-')])
    return sorted(mylist, key=lambda x: x[0])

def min_func(l):
    c = 0
    for i in range(len(l)):
        a, b = l.pop(0)
        if a <= c <= b:
            c = b + 1    
    return c<jupyter_output><empty_output><jupyter_text>Result<jupyter_code>l = parse(myinput)
print(min_func(l))<jupyter_output>23923783<jupyter_text>Challenge 20.2<jupyter_code>upper_limit = 4294967295
def allowed(l):
    c = -1
    white = upper_limit + 1
    for i in range(len(l)):
        a, b = l.pop(0)
        if a <= c <= b:
            white -= b - c
            c = b
        elif c < a:
            white -= b - a + 1
            c = b
    return white
l = parse(myinput)
print(allowed(l))<jupyter_output>125
{'fraction_non_alphanumeric': 0.1390532544378698, 'fraction_numerical': 0.04240631163708087, 'mean_word_length': 2.3609271523178808, 'pattern_counts': {'":': 0, '<': 16, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '3', 'dir': 'jupyter-structured-clean-dedup', 'id': '511985', 'license': 'MIT', 'n_tokens_mistral': 424, 'n_tokens_neox': 397, 'n_words': 88, 'path': '2016/ferran/day20.ipynb', 'repo_name': 'bbglab/adventofcode', 'size': '1014'}