[Puzzle of the week] Electrical grid

Hi,

I have created the code which gets the solution (at least for the test cases) but it saying my solution is not right.

In example number 2,  mi output is:

9 48
1 2 3
1 6 2
4 3 8
5 7 6
5 8 5
5 9 10
6 5 1
9 4 4
9 10 9

     So I am going from node 9 to node 4. But the solutions in the tests state that:

9 48
1 2 3
1 6 2
4 3 8
4 9 4
5 8 5
5 9 10
6 5 1
7 5 6
9 10 9

    So it says that we go real solution goes from 4 to 9. That is not possible, since 4 is only connected to 9 and 3, And 3 is not connected to anything else. So solutions should be from 9 to 4 and from 4 to 3. 

    Thus, I am guessing my solution is right but I cannot prove it. What should I do? I am new here and enjoying very much the experience!!! Sorry if this is not the right place to ask this questions.

Kind regards,

3 posts were merged into an existing topic: [Community Puzzle] Electrical Grid