<jupyter_start><jupyter_text>Day 9<jupyter_code>xmas_data = []
with open('input.txt', 'r') as fd: 
    for line in fd: 
        xmas_data.append(int(line.strip()))
preamble = 25

for pointer, element in enumerate(xmas_data[preamble:], preamble): 
    subset = xmas_data[pointer-preamble:pointer]
    possible_outputs = set()
    for i in subset: 
        for j in subset: 
            if i != j: 
                possible_outputs.add(i + j)
    if element not in possible_outputs: 
        print(element)
        break
xmas_data = []
with open('input.txt', 'r') as fd: 
    for line in fd: 
        xmas_data.append(int(line.strip()))
incorrect_number = 32321523
for length in range(2, 20): 
    for pointer in range(0, len(xmas_data) - length + 1): 
        subset = xmas_data[pointer:pointer+length]
        if sum(subset) == incorrect_number: 
            print('Solution: ', max(subset) + min(subset))
            break<jupyter_output>Solution:  4794981
{'fraction_non_alphanumeric': 0.11912225705329153, 'fraction_numerical': 0.024033437826541274, 'mean_word_length': 2.7716535433070866, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 4, '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': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '388704', 'license': 'MIT', 'n_tokens_mistral': 350, 'n_tokens_neox': 317, 'n_words': 79, 'path': '2020/claudia/2020_12_09/code.ipynb', 'repo_name': 'bbglab/adventofcode', 'size': '957'}