Completed day 10. Not wildly happy with my runtime

This commit is contained in:
Connor Johnstone
2023-12-11 00:39:11 -07:00
parent b60591ea38
commit 8b270c236b
13 changed files with 1392 additions and 7 deletions

12
day_09/cheating.py Normal file
View File

@@ -0,0 +1,12 @@
l = [[int(i) for i in s.split()] for s in open('input.txt').read().split('\n') if s.strip()]
def n(l):
if sum(i != 0 for i in l) == 0:
return 0
m = []
for i in range(len(l)-1):
m.append(l[i+1]-l[i])
return l[-1] + n(m)
print([n(i) for i in l])
print(sum(n(i[::-1]) for i in l))