Hello ladies and gentlemen,
I have managed to pass all 11 test cases, but I am dead stuck with multiple loops. Could you tell me if there are flaws in my logic:
Basically, whenever Bender moves, I record his new position, states and direction in a separate Array. Before each move is recorded to this Array, I cross-check current position, state and direction of a Bender with the Array of previously visited places(position, state, direction). If there is a match, I take it for a loop. It works fine for a single loop, but it fails in multiple loops test. Can you share you thoughts, where is the flaw in my logic?