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.
The additional error messages are useless, and for prime numbers they are plain wrong.
No random tests.
Different output types is a bad practice.
Prime factorization is a duplicate of many katas.
This kata seems good to go to me.
Typo in description
pFactors(7); //should return "13 is a prime number."
It should be pFactors(13) or //should return "7 is a prime number."
Returning inconsistent datatypes is not a best practice. What's wrong with returning an array of length
1
anyway?Also, hardly original. I haven't searched, but I could probably find a dozen of these kata.
Oops, I have removed that test altogether. I think dealing with int < 1, is beyond the scope of what I was asking with this kata, as well as mathmatically incorrect.
Thanks for letting me know!
There is a bad test. If integer is equal to 1 the result is
1 is a prime number