This commit is contained in:
Felix Pankratz 2022-12-03 15:36:56 +01:00
parent ece611baf6
commit 98aeaac704
3 changed files with 348 additions and 0 deletions

22
2022/03/01.py Executable file
View File

@ -0,0 +1,22 @@
#!/usr/bin/env python3
INPUT_FILE = 'input'
def main():
content = map(str.strip, open(INPUT_FILE, 'r').readlines())
score = 0
for line in content:
c1 = line[:len(line)//2]
c2 = line[len(line)//2:]
for char in c1:
if char in c2:
print(char)
if char.islower():
score += ord(char) - 96
else:
score += ord(char) - 38
break
print(score)
if __name__ == '__main__':
main()

26
2022/03/02.py Executable file
View File

@ -0,0 +1,26 @@
#!/usr/bin/env python3
INPUT_FILE = 'input'
def grouper(n, iterable, fill=None):
args = [iter(iterable)] * n
#return izip_longest(fillvalue=fillvalue, *args)
return zip(*args)
def main():
content = map(str.strip, open(INPUT_FILE, 'r').readlines())
score = 0
gen = grouper(3, content)
for r1,r2,r3 in gen:
for char in r1:
if char in r2 and char in r3:
print(char)
if char.islower():
score += ord(char) - 96
else:
score += ord(char) - 38
break
print(score)
if __name__ == '__main__':
main()

300
2022/03/input Executable file
View File

@ -0,0 +1,300 @@
DsPhSBQQQhqmBDhPDsFwjwsLjlRjlttvjvvtRb
rNJMNNbrHrtjHLHjvwtg
fNbNzZdrZnMnMPnQShFPDmnqFm
QWVCFfQffgQCVZzVVpHsHJBqtpspJFRHqq
mwDbmnnGNlNcwNDDNRbnNDlJTpBJBtJGtPTLsBGqTqqsqp
MlSdnScRnnmmDjSdNSdCzvggWzrgzjvfvrgVzW
gsMljbrjlZlWcWMJrWwTwbmwQbmmLDQQLhwL
CdgpzdgpgnfThHfFRwhfRf
SptgpSpnCNpVSGNPvPGSddcMWjMrjqBsJcWqMcBWcVlZ
JcJLQQFWhQJPJpWcwjHvMQvnnlMvzBHd
tCtGZrmVRmVGTVTtCfRTCHHNNvdNzmdMvMlNzvwdvw
CTGGRftfSGtGTGDLbFchSgSWWWcM
QcMFQrvrQbvtczbVbjbMzZzRpqmDDmqqnNzCDCD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