[Python/2018] Move solutions into .py files

This commit is contained in:
Felix Bargfeldt 2023-10-29 17:04:13 +01:00
parent edb04277c6
commit 40e767096e
Signed by: Defelo
GPG key ID: 2A05272471204DD3
60 changed files with 1518 additions and 3541 deletions

23
Python/2018/01.py Normal file
View file

@ -0,0 +1,23 @@
from lib import *
input = read_input(2018, 1)
out = 0
for line in input.splitlines():
out += int(line)
print(out)
lines = input.splitlines()
freq = 0
seen = {0}
while True:
for line in lines:
freq += int(line)
if freq in seen:
print(freq)
break
else:
seen.add(freq)
else:
continue
break