Add 2022 extras and rm input/samples

This commit is contained in:
Julia Lange 2023-12-12 12:16:55 -08:00
parent 7809a82ce7
commit 1d2098a708
Signed by: Julia
SSH key fingerprint: SHA256:KI8YxpkPRbnDRkXPgCuQCVz181++Vy7NAvmQj8alOhM
30 changed files with 402 additions and 6471 deletions

23
Python/2022/15/main.py Normal file
View file

@ -0,0 +1,23 @@
input = open("input", 'r')
# input = open("sample", 'r')
data = {}
total = 0
validLocations = []
for line in input:
line = line.strip()
valve, to = line.split("; ")
name, rate = valve.split(" has")
name = name[-2:]
rate = int(rate.split("=")[1])
tonames = to.split("valve")[1].split(", ")
tonames[0] = tonames[0][-2:]
if rate > 0:
validLocations.append(name)
data[name] = [rate, tonames, False]
# Part 1