aoc-2021-day6
unknown
python
3 years ago
365 B
180
Indexable
def population(init_state, time): state_count = [init_state.count(i) for i in range(0, 9)] for _ in range(0, time): state_count = state_count[1:] + state_count[:1] state_count[6] += state_count[8] return sum(state_count) def part1(data): return population(data, 80) def part2(data): return population(data, 256)
Editor is loading...