21 lines
456 B
Python
21 lines
456 B
Python
# TODO: Get the inout.
|
|
|
|
counter = 50
|
|
code = 0
|
|
for move in moves:
|
|
direction, number = move[0], int(move[1:])
|
|
|
|
assert direction in ['L', 'R'], f"Direction should be left (L) or right (R), not '{direction}'"
|
|
assert number > 0, f"Number should be positive, not '{number}'"
|
|
|
|
if direction == 'L':
|
|
counter -= number
|
|
else:
|
|
counter += number
|
|
|
|
# If we get zero, let's store that.
|
|
if counter % 100 == 0:
|
|
code += 1
|
|
|
|
print("The actual password is:", code)
|