18 lines
392 B
Python
18 lines
392 B
Python
#/usr/bin/env python
|
|
|
|
|
|
total_prio = 0
|
|
with open("input.txt", "r") as f:
|
|
for line in f:
|
|
l2 = int(len(line.strip())/2)
|
|
c1 = set(line[:l2])
|
|
c2 = set(line[l2:])
|
|
c = c1.intersection(c2)
|
|
|
|
c = ord(list(c)[0])
|
|
if c >= 97:
|
|
total_prio += c - 96
|
|
else:
|
|
total_prio += c - 38
|
|
|
|
print(total_prio) |