That’s indeed a good start (one could also start by clearing the cache, or monitoring the network request when clicking on “play” to make sure the code you send is indeed the one you see in the IDE).
I wrote a Code in C#. It works for all the tests and the validations 1-4 but the validation 5 does not work. Can someone provide the input data for the 5.validation test so that I can check where my code has the failure.
Thanks for your help.
Hello to All !
Thanks to @CGTeam and @TwoSteps : Groovy seems to build again !
Unfortunately, all my Tests pass in Groovy, but none of the Validators …
→ Is there a mistake somewhere in my code ?
Thanks to anyone who can help me !
Just for linkage between near topics : as i said in this topic (Groovy gets timeouts in every clash now - #17 by Jp82), Groovy works now for me in both IDE and Validators …
=> so, i think you may have solved the issue
Thanks a lot to anyone involved !
while (conditionA OR conditionB) {
repeat the process, which will update the input for the 2 conditions,
so that every time you will have new conditions to test
}
But your while () does not have the two conditions tested. You test it after the while loop and it does not affect the 2 conditions.
So what you’re saying is in my while loop, I need to test both conditions. Thank you for helping me understand the problem. I’m thinking of doing something like this:
while(num > 0 && (sum != 1 || sum != 4)){
remainder = num % 10;
sum += remainder * remainder;
num /= 10;
}
I just changed the variables I declared as integers in my code to long and now the third testcase works. But the other two don’t. Anybody have an idea on how to resolve this issue?
The puzzle has warned you, your data type cannot handle the very long and big numbers.
Do not transform the super big number into your super big type.
Check the Example test case, input is 23.
Do you really need using 23 in your calculation?
I don’t think so. You start calculating with 2 and 3, and then deal with some other small numbers only.