MCPcopy Create free account
hub / github.com/AxlLind/AdventOfCode / count_left

Function count_left

2018/src/15.py:47–51  ·  view source on GitHub ↗
(m: list[list[tuple[str,int]]])

Source from the content-addressed store, hash-verified

45 m[rt][ct] = ('.',0)
46
47def count_left(m: list[list[tuple[str,int]]]) -> tuple[int,int]:
48 counts = defaultdict[str,int](int)
49 for r,c in product(range(len(m)),range(len(m[0]))):
50 counts[m[r][c][0]] += 1
51 return counts['E'],counts['G']
52
53def simulate(dmg: dict[str,int], m: list[list[tuple[str,int]]], nelves: int | None = None) -> tuple[str,int]:
54 m, rounds = deepcopy(m), 0

Callers 2

simulateFunction · 0.85
mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected