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.
Pick one :/
I just solved it myself and it's working fine, except that assertion messages are horrible. Not working code != kata issue.
Please refer to https://github.com/codewars/codewars.com/wiki/Troubleshooting-your-solution for some tips.
The error is coming from your code, not the tests... And if not, you'll have to prove it.
What's the error??? And why is that a kata issue? (I haven't solved it, so I can't see your fiddle)
If you're gonna raise an issue, please BE SPECIFIC.
No, your solution isn't "much more efficient". Only one iteration is needed. You still iterate two or three times.
You don't even need to filter the whole array, just the first 3 numbers.
your solution must be top one
Thank you.
The second condition covers n = 0 as 0 % 2 === 0 resolves to true, so n < 0 is OK. It could be n < 1 if you want to make your code a bit "faster".