summaryrefslogtreecommitdiffstats
path: root/20
diff options
context:
space:
mode:
Diffstat (limited to '20')
-rw-r--r--20/py/d21.py10
1 files changed, 9 insertions, 1 deletions
diff --git a/20/py/d21.py b/20/py/d21.py
index 9f08b8c..82f5b00 100644
--- a/20/py/d21.py
+++ b/20/py/d21.py
@@ -27,7 +27,15 @@ def pt1(_in):
def pt2(_in):
- pass
+ all_ingredients = []
+ for line in _in:
+ all_ingredients.extend(ingredients(line))
+
+ might_be = defaultdict(lambda: set(all_ingredients))
+ for line in _in:
+ for alg in allergens(line):
+ might_be[alg] &= set(ingredients(line))
+ print(might_be)
if __name__ == "__main__":