27 lines
653 B
Python
Executable File
27 lines
653 B
Python
Executable File
#!/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()
|