Skip to content

Commit 0f64a6f

Browse files
committed
refactoring
1 parent 293b27d commit 0f64a6f

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

2023/day02.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,7 @@ def possible_games(games: str) -> int:
3333

3434

3535
def fewest_number_of_cubes_of_each_color(cubes: List[Dict[str, int]]) -> Dict[str, int]:
36-
minimal = {}
37-
for color in COLORS:
38-
minimal[color] = max(cube.get(color, 0) for cube in cubes)
39-
return minimal
36+
return {color: max(cube.get(color, 0) for cube in cubes) for color in COLORS}
4037

4138

4239
def power(cubes: List[Dict[str, int]]) -> int:

0 commit comments

Comments
 (0)