<jupyter_start><jupyter_text>[Day 6](https://adventofcode.com/2020/day/6): Custom Customs<jupyter_code>import re

with open("../data/06.txt", "r") as f:
    groups = f.read().split("\n\n")
    groups = [g.strip().split("\n") for g in groups]
    groups = [list(map(set, g)) for g in groups]<jupyter_output><empty_output><jupyter_text>Part 1<jupyter_code>def yeses(setop):
    return sum(len(setop(*ans)) for ans in groups)

assert 6161 == yeses(set.union)<jupyter_output><empty_output><jupyter_text>Part 2<jupyter_code>assert 2971 == yeses(set.intersection)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.1737649063032368, 'fraction_numerical': 0.030664395229982964, 'mean_word_length': 6.170731707317073, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 13, 'https://': 1, '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': '559589', 'license': 'MIT', 'n_tokens_mistral': 247, 'n_tokens_neox': 229, 'n_words': 39, 'path': 'solutions/06.ipynb', 'repo_name': 'egnha/AoC-2020', 'size': '587'}