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.
python new test framework is required. updated in this fork
Good kata but input should be tested upto 10^6 to make it a little bit more challenging ..
Ruby 3.0 should be enabled, read this to learn how to do it
Please organize the structure of test fixture as following (although it has been mentioned in the attached link, I'm repeated here again)
I say keep it. People can train in beta if they'd like, plus it's good experience for publishing katas.
I really don't know why (googled with no effect), but in some test cases (1-5 in 100 random tests) this solution didn't work. Also, sometimes it gave inconsistent results while running same tests as a "Sample Test" (answer was correct) and in "Attempt" basic tests (incorrect answer in that case). I'm new to programming, but my guess is that it somehow linked to interpreted language nature of Python.
Maybe someone can explain it to me?
Should I kill it?
There're already too many trivial "primality test" katas.
Not really an issue, rather a suggestion, so I'm closing it.
Thanks for the help, approved!
Good point, added
Ruby translation kumited, including some edge case tests. Please check and approve :-)
Add a fixed test to enforce the criteria that you set: the solutions should only count primes that are below the given
n
. For example the input23
should return4
, because there are only 4 such numbers below 23: 2, 3, 5, 11. My current solution would incorrectly return 5, because it counts 23 as well...Idea: finding all/the longest chain of Sophie Germain primes (a so-called Cunningham chain) in a given range could be a bit more interesting topic :-)
e.g.
2, 5, 11, 23, 47
Don't get me wrong, I find primes a broad and interesting topic in maths (I even made 2 kata remakes on primes: 1, 2), but programming-wise these katas are not very different or challenging after you completed a few of them.
Cheers
Yeah, kinda noticed the frequency of the "prime" katas, just wanted to try submitting katas myself for the first time and practice a little in that
That's a clever way to solve it! Thanks!
Loading more items...