2017 progress.
This commit is contained in:
17
2017/d5.py
Normal file
17
2017/d5.py
Normal file
@@ -0,0 +1,17 @@
|
||||
insts = list(map(int, open(0).read().strip().splitlines()))
|
||||
part_2 = True
|
||||
c = 0
|
||||
i = 0
|
||||
while i < len(insts):
|
||||
ci = i
|
||||
i += insts[i]
|
||||
if part_2:
|
||||
if insts[ci] >= 3:
|
||||
insts[ci] -= 1
|
||||
else:
|
||||
insts[ci] += 1
|
||||
else:
|
||||
insts[ci] += 1
|
||||
c += 1
|
||||
print(c)
|
||||
|
||||
Reference in New Issue
Block a user