parent
84d984eca1
commit
91441a6231
2 changed files with 16 additions and 0 deletions
@ -0,0 +1,15 @@ |
|||||||
|
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) |
Loading…
Reference in new issue