1
0
www.mikescher.com/www/statics/aoc/2017/01_solution-2.py

15 lines
256 B
Python
Raw Permalink Normal View History

2020-01-13 12:57:50 +01:00
#!/usr/bin/env python3
import aoc
rawinput = aoc.read_input(1)
inlen = len(rawinput)
digitsum = 0
for idx in range(0, inlen):
if rawinput[idx] == rawinput[(idx + inlen//2) % inlen]:
digitsum = digitsum + int(rawinput[idx])
print(digitsum)