[SOLVED] Tests OK but Submit fail "Cryptorithme by Bob"


#1

Hello everyone!

I am trying to complete the “Cryptorithme” puzzle, i wrote my solution and all my tests are success.
But when i try to submit and validate the solution, something goes wrong with the last case.

I don’t understand why it does not work.
However the test cases are exactly the same in the IDE tests and in the final validation, they are 4 tests.

Thank you for helping


#2

Please help !
Can’t reach 100% on this puzzle:


#3

can’t find an obvious issue in your code (my php level is close to 0), so I give you the test in MP.
It’s the same as IDE test, only letters differ.


#4

Hi _CG_Thibaud,
thank you for your help.

my result for this test is the right one in PHP:
Input: Output:
2 A 1
AS L 0
US S 5
ALL U 8

My problem is:

  • when testing: all tests are OK including this one which is “test04”
  • but when I submit: I have 75% success and the “test04” is colored in red

I expected that if a test case is working in the IDE, this same test case should work in the final submit…yet it’s not the most greedy in memory.


#5

I gave you the validator test in private message. You can do a custom test in the test case panel to investigate the issue in your code. Let me know if you manage.

IDE tests and validator tests are different to prevent hardcoding. However, most of the times, test work as couples and here the “validator 4” tests the same thing as “test 4”.


#6

Sorry Thibaud and thank for your efforts.

And there is my problem: the validator and the test are the same… I successfully passed the test but not the validator which are exactly the same (Not the same as yours, maybe there is a version for each language… but it doesn’t matter).

So for the same case: TEST => OK
VALIDATOR => NOK

And that is why it’s making me crazy. incomprehensible

Thank you again for your time Thibaud


#7

You’re mistaking something somewhere.
No validator is the same as the tests so when you claim validators and tests are the same, you’re not talking about the same thing as Thibaud.


#8

Hello Kirbiby,

Maybe I didn’t understand the meaning of what Thibaud was talking about. My english is not so good but I still try.
But what I mean is that I can see that the test case in the test panel is exactly the same as the case in the final validator. And I think Thibaud was saying the same thing specially for this puzzle.

So because of my bad english maybe i m not clear :
This is the test panel with IDE:

This is what he expects:

And this is my results:

I don’t find any solution to reach 100%.

Thanks again to Kirbiby and Thibaud


#9

Hello @SabriM
I’m sorry, my explanation wasn’t detailed enough.

The two tests (ide test and validator) test the same thing indeed (85+15=100) but with different letters.

To investigate the validator test, I sent you by private message (I believe on Monday) the input and expected output of the validator so you can test it yourself. To do so, you must activate “expert mode”. I though you had it activated but it seems you don’t. In the settings panel, you have “mode”, choose “expert”. Now you can test a “custom test case”.

Don’t hesitate to ping me on Discord or on the chat here if you don’t manage. Hope it helps.


#10

Sorry guys, I didn’t actually have any knowledge about the expert mode and the custom test cases.

Thank you so much for your help Thibaud. After comparing the input/output you sent me in the great custom test cases tool, I saw that my solution had some bugs in some cases.

my function should have return an array with each letter and its value… but in this case it returns the array with an additional unexpected value with index “” (empty string) . So after some debugging I managed to find the solution and reached the so coveted 100%.

Thank you again Thibaud. and thanks to Kirbiby too.


#11

A last question… How can I set this topic as resolved/solved?
Sorry I am really new in the forum and topics world, I am not a great user. Usually I look for the solution by myself or read the existing topics but for this one I really needed your help guys and it was very useful.


#12

I guess you can change the title of threads you post. I’ll do it and also close the topic


#13