The hardcoding validation checks for the submission tests are pretty damn ruthless.
I used this puzzle as a means to improve on my OOP in C++. I created a Node and Arena Matrix class and mapped all the available nodes and their connections into objects. The code is probably a lot more complicated then it needed to be but it was an exercise in a method I wanted to experiment with more then anything.
I passed all the tests in the IDE but failed on the last two within the submission tests - for hardcoding ??? I can tell ya, nothing was hardcoded. All given parameters were stored in variables and all the node ids were stored in their relevant node objects with their child link maps. There are enough iterators and pointers in that code to make Bill Gates head spin.
Watching the replay, I saw that my code failed by performing steps which from what I understood about my code to be logically impossible. It was at that point I realised the checks were actually modifying my code at some point. It was the only explanation.
It took me a while to realise that the code being modified was in fact the ids for the nodes. They had to be stored so I could reference them as necessary and remove their links as they are broken but the validation checks were changing them or something and causing the code to fail.
In my mind, this validation test is BS. If you screw with a volatile logic system you can't blame it for failing. No wonder it started making weird choices in those last two tests.
My solution was simple. Don't store the node ids as you receive them. I stored their value as a power of and just sqrt it when I needed to use cout to break their links. That fact that even worked just shows how flawed the validation system is.
I understand the need to check for hardcoding and other means of cheating the validation checks, but when you start breaking valid code mechanisms in the process their is something seriously wrong. I can only imagine how many people gave up on this test or completely rewrote their code because of the over-zealous and intrusive validation checks.