initial commit

This commit is contained in:
s-prechtl 2022-12-09 08:29:06 +01:00
commit 27fe77bbe1
134 changed files with 21939 additions and 0 deletions

1000
2020/Day2/input.txt Normal file

File diff suppressed because it is too large Load diff

15
2020/Day2/main.py Normal file
View file

@ -0,0 +1,15 @@
if __name__ == '__main__':
with open("input.txt") as f:
inputs = f.readlines()
result = 0
entered = 0
for i in inputs:
rng, let, text = i.split(" ")
for x in range(0, len(text)):
letequal = text[x] == let[0]
if (letequal and x == int(rng.split("-")[0])-1) ^ (letequal and x == int(rng.split("-")[1])-1):
entered += 1
if entered == 1:
result += 1
entered = 0
print(result)