Can't get 100% even tho all the tests were passed successfully

Hi everyone! A newbie here.
I’m starting to learn how the platform works and following the steps suggested in the Quest Map. Now trying some Loop puzzles.

I’ve been working on this one:
https://www.codingame.com/training/easy/pirates-treasure

I managed to solve it successfully, passing all the tests, but after submitting it I get the following message and the completion score only goes to 80%:

The following validators differ from the puzzle test cases to prevent hard coded solutions. This is why you can have some fails here even if all of the tests provided in the IDE have been successfully passed.

Can you help me understand what the system might be interpreting as a hard coded solution??

Thanks for you help!

A hard coded solutions means something like this:

if input == 'testcase1': print('answer1')
if input == 'testcase2': print('answer2')
...

80% correct doesn’t sound like you are doing this. But testcases in IDE and on submit differ and you probably miss some corner case that’s not covered in the IDE.
The “Edge” testcase hides the treasure at the top, the submit validator places it on the right. Apart from that I can’t see anything remotely tricky where you could possibly fail.

2 Likes

Hi, thanks for the response.

The validator that is triggering this is the “Smallest Island”, the simplest one.
So I’m not sure what I can be doing wrong.

Here is my code, in case anyone wants to check it out:
edit @eulerscheZahl: snip

Thanks again for your help!

NameError: name 'treasure' is not defined
at Answer.py. in <module> on line 36

You should make sure that the variable is declared, even if there is no 0 in the first line at all.

I’ll remove your code as it can be a spoiler for others.

Thank you very much! It worked!