This website works better with JavaScript.
Home
Explore
Help
Sign In
roderic
/
advent
Watch
1
Star
0
Fork
0
Code
Issues
0
Pull Requests
0
Releases
0
Wiki
Activity
Browse Source
anxiety
master
Roderic Day
3 years ago
parent
c688a8b228
commit
003a88e44c
1 changed files
with
10 additions
and
0 deletions
Unified View
Show Diff Stats
+10
-0
y2021/p06.py
+ 10
- 0
y2021/p06.py
View File
states = [[0, 0, 0, 0, 0, 0, 0, 0, 0]]
for n in text.split(','):
states[0][int(n)] += 1
for day in range(256):
states.append(states[-1][1:] + states[-1][:1])
states[-1][6] += states[-2][0]
ans1 = sum(states[80])
ans2 = sum(states[256])
Write
Preview
Loading…
Cancel
Save