aoc23/02/part2.py

5 lines
215 B
Python
Raw Normal View History

2023-12-03 03:12:13 -06:00
import math, re, sys
print(sum(math.prod(max(int(n) for n in re.findall(f"[0-9]+(?= {color})", line))
for color in ("red", "green", "blue"))
for line in open("input.txt", "rt").readlines()))