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

16 lines
258 B
Python

#!/usr/bin/env python3
import aoc
rawinput = aoc.read_input(1)
rawinput = rawinput + rawinput[0]
digitsum = 0
for idx in range(1, len(rawinput)):
if rawinput[idx-1] == rawinput[idx]:
digitsum = digitsum + int(rawinput[idx])
print(digitsum)