Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
This comment is hidden because it contains spoiler information about the solution
If the outlier is first in the list of integers or if it is second and preceded by a number of different parity then your code will not return anything causing the code to hit the time limit.
I agree that it's optimal to stop searching immediately when the outlier is found rather than processing the entire list.
I wasn't saying there's a point to doing it that way. And I agree that the tests are fine. Was just offering the possibility that maybe random tests were the reason why the OP was seeing different results upon submitting the same code more than once. I just joined codewars within the past few days, so wasn't aware of this, but if you are correct when you mentioned 'Random tests are not optional,' then random testing, as I also mentioned, is likely to be the reason.
I noticed that as well. But it doesn't necessarily mean it's incorrect. I'm not sure if codewars works this way but it might be that kata can optionally have random test cases rather than a fixed set of test cases. Or maybe a fixed set in random order.
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
You're probably over thinking it. This challenge is primarily very basic math along with output formatting. Nothing complicated. You can pretty much just ignore the term 'integral' in the problem statement and just follow the steps.
In the problem description one of the requirements is that the result will always be an integer. So probably wanted only integers submitted in the solutions. 1.0 is equivalent to 1 but in this problem we are also seeing that there is a difference in how we get those two values, / versus //