day 6
Signed-off-by: Jack Bond-Preston <jackbondpreston@outlook.com>
This commit is contained in:
parent
d1a9c7516b
commit
8d22f83bf5
19
6/6.py
Normal file
19
6/6.py
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
day_fish = [0] * 9
|
||||||
|
|
||||||
|
with open("input.txt") as f:
|
||||||
|
contents = f.read()
|
||||||
|
for fish in contents.split(","):
|
||||||
|
fish = int(fish)
|
||||||
|
day_fish[fish] += 1
|
||||||
|
|
||||||
|
print(day_fish)
|
||||||
|
|
||||||
|
days = 256
|
||||||
|
for i in range(0, days):
|
||||||
|
zeros = day_fish[0]
|
||||||
|
day_fish = day_fish[1:] + [0]
|
||||||
|
|
||||||
|
day_fish[6] += zeros
|
||||||
|
day_fish[8] += zeros
|
||||||
|
|
||||||
|
print(sum(day_fish))
|
Loading…
Reference in New Issue
Block a user