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

16 lines
258 B
Python
Raw Normal View History

2020-01-13 12:57:50 +01:00
#!/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)