You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
15 lines
384 B
15 lines
384 B
10 months ago
|
lines = [i for i in open("input.txt", 'r').read().splitlines()]
|
||
|
|
||
|
letters = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"
|
||
|
sum = 0
|
||
|
|
||
|
for l in lines:
|
||
|
found = False
|
||
|
for c in l[:int(len(l)/2)]:
|
||
|
for d in l[int(len(l)/2):]:
|
||
|
if c == d:
|
||
|
if not found:
|
||
|
sum += letters.index(c)+1
|
||
|
found = True
|
||
|
|
||
|
print(sum)
|