[Community Puzzle] Simple fraction to mixed number

I’m at 100% IDE and stuck at the last validation case “many random cases”. I haven’t seen the pre-approved puzzle so no idea what’s in that test case. Any idea what I might have missed?

SOLVED: I forgot to check for the case where x / x = 1, that should be added to the test cases.

I have added that case to the tests, along with several other cases that have tripped up others in the past. Thanks for the suggestion.

  • danBhentschel
1 Like

Thank you for updating this puzzle, player_one. I did not know that now published puzzles are editable!

Only by gold members.

I am stuck at this question, I wrote 2 applications of a method I use (one is faster and the other is more careful about memory) and both of them fails the first test in validation. the faster one also fails the 3rd test . I am quite sure that overflow should not be an issue ( I don’t even make any sums) , I do handle signs and everything I can think of.

Thanks for the update to the puzzle. I saw the problem instantly once I got the output from that new test case. I completely forgot to add a test for signs on non-mixed numbers with both negative numerator and denominator. Quick and easy fix.

Hi, I have passed in the IDE but stuck in the first test case of submission.
I have passed all test cases in this thread also.
Any hint?
Thanks a lot!

1 Like

I passed also all IDE testc ases but i got stuck at the last validator. Has this validator anything that is new? or is my code just too slow?

1 Like

It doesn’t seem to have something new.

Hi there. I have almost completed the problem, but I am stacked when submitting the problem. I have passed all test cases of the problem (open ones, not submitted ones), but on Submission, I can not pass the firs one (Both integer and fractional parts).

I guess I am overlooking something, does any one have a clue on what could be happening?

Thanks!

same for me!

My code passed all the tests too but not the last validator, any idea ?

=> my code was too slow

The “Many random cases” validator when the solution is submitted fails.
The test cases do not cover time execution issues. If your algorithms are not efficient they will not pass the validators. The test cases must add a long execution test case that will fail for not optimal algorithms.
The solution passed the provided test cases and also some customized test cases with very big prime numbers (to exclude this as a reason as was not covered in the test cases). The solution is general, so, I had no idea what case is not covered. Part of creating a puzzle is to be sure that the test cases are well selected and validators are double checked against correct answers and corresponding test cases. Not offering any indication why a validators fail makes the code difficult to debug. I guess the efficiency was an isssue and improved the speed, which worked.