[Community Puzzle] Ancestors & Descendants

Coding Games and Programming Challenges to Code Better

Send your feedback or ask for help here!

Working on this puzzle and all the test cases pass except test 3.
Partial input is for test 3 is:

According to my interpretation of the puzzle rules it should output
a > a1 > a11
a > a1 > a12 > a121
a > a1 > a13 > a131 > a1311 > a13111 > a131111

which my solution does. But I get an error of
Found: “a > a1 > a11”
Expected: “a > a1 > a13”

This makes no sense because the a13 answer should have many more descendants.

Did the input or test cases change on this puzzle?

“Expected:” solution stop to the first wrong char.

So it’s expecting a > a1 > a13 > to be output before a > a1 > a11 ?
That’s not how all the other test cases are working.

You can see the expected output by clicking the “drawers” icon in the upper-right of the Test cases window. Expected output for test 3 is:

a > a1 > a11
a > a1 > a12 > a121
a > a1 > a13 > a131 > a1311 > a13111 > a131111
a > a1 > a13 > a132
a > a1 > a14
a > a1 > a15
a > a2
a > a3
a > a4
b > b1
b > b2
c > c1 > c11 > c111 > c1111
c > c1 > c12 > c121 > c1211
c > c1 > c12 > c122

Double-check your program. You must have misinterpreted something?? If you continue to have problems, feel free to PM me.

  • danBhentschel

OK, found the error in my code so all the IDE tests are passing, but test 3 on the submit tests is failing.

found I wasn’t clearing all the old ancestors when I went up a level. Fixed this and all the submit tests passed :slight_smile:

There is something wrong with the validators for this puzzle.

I have 100% on the tests, didn’t hardcoded anything, and yet i only have 33% on submit.

I get that the validator should be different from the test but when there is that much difference something is wrong.

So since i can’t see what’s the problem in the validators and all my test are successful, how am i suppose to find the possible bugs ?

EDIT: Only validator 1 and 5 are successful

Maybe your algorithm is too simple.
Mine is not that complicated.

This doesn’t answer my question at all…
How could i find what’s wrong if the only debuggable “things” are the test and all test are ok ?

And my code is of course simple since the problem is simple, so i don’t really see why making it complicated would solve anything.

Maybe you don’t manage correctly stairs that goes up and down.