from functools import cache from utils import open_day @cache def count_fish(life): if life <= 0: return 1 return count_fish(life - 7) + count_fish(life - 9) fish = list(map(int, open_day(6).read().split(','))) print(sum(count_fish(80 - f) for f in fish)) print(sum(count_fish(256 - f) for f in fish))