Trik
This commit is contained in:
12
trik.py
Normal file
12
trik.py
Normal file
@@ -0,0 +1,12 @@
|
||||
moves = input().strip()
|
||||
cups = [True, False, False]
|
||||
|
||||
for move in moves:
|
||||
if move == "A":
|
||||
cups[0], cups[1] = cups[1], cups[0]
|
||||
elif move == "B":
|
||||
cups[1], cups[2] = cups[2], cups[1]
|
||||
elif move == "C":
|
||||
cups[0], cups[2] = cups[2], cups[0]
|
||||
|
||||
print(cups.index(True) + 1)
|
||||
Reference in New Issue
Block a user