1
0
Fork 0
adventofcode/2017/5/cpu.py

12 lines
237 B
Python
Executable File

#!/usr/bin/python3
import sys
data = [int(l.rstrip()) for l in sys.stdin.readlines()]
pos, steps = 0, 0
while pos >= 0 and pos < len(data):
data[pos] = data[pos] + 1
pos = pos + data[pos] - 1
steps = steps + 1
print(steps)