diff options
-rw-r--r-- | 2.py | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -2,6 +2,7 @@ from sys import stdin from dataclasses import dataclass from functools import reduce from typing import TypeAlias +from operator import mul CubeSet: TypeAlias = dict[str, int] @@ -28,5 +29,5 @@ limits = {"red": 12, "green": 13, "blue": 14} # fmt: off print(sum(g.id for g in games if all(s[k] <= limits[k] for s in g.subsets for k in limits.keys() if k in s))) -print(sum(reduce(int.__mul__, (max(s[k] for s in g.subsets if k in s) for k in limits.keys())) for g in games)) +print(sum(reduce(mul, (max(s[k] for s in g.subsets if k in s) for k in limits.keys())) for g in games)) # fmt: on |