[Community Puzzle] Plight Of The Fellowship Of The Ring

Coding Games and Programming Challenges to Code Better

Send your feedback or ask for help here!

I passed all the 5 tests, but when I submit the code, ā€˜5ā€™ test is failed.
Can someone explain me and give me any clue why it is happening?

I know that it was design to prevent hard coded solutions, but it useful, not informal.
It might be a bug in the puzzle.

I have the same thing but for test ā€˜1ā€™ā€¦ Itā€™s more likely that thereā€™s some edge case in our code that our solution doesnā€™t handle, rather than a bug in the puzzle - but thereā€™s no way to know what that edge case isā€¦

I also had a problem with Validator 1.
It checks if you consider that you canā€™t reach a spot if number of moves is greater or equal to distance from the starting point of an orc to that spot.

For below input, your solution should answer with ā€œIMPOSSIBLEā€:

2
1
1
1 0
2 0
2 1
0 1
0
1

Thatā€™s awesome! Fixing that one broke a few of my regular case, but it was nothing a little spaghetti code (for the edge cases) couldnā€™t fix. Thanks!

Is the problem fixed, or do you want me to look into it?

eulerscheZahl really helped me and gave me a clue to ā€œlook backwards for some routesā€

You should keep in mind that you should always visit closes indexes in the beginning, in my case the order of indexes were mixed in linkedList so I was visiting not the closest index.

1 Like