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.
When Kayleigh said
gmpy
is too slow, they meant thatgmpy2.next_prime
is too slow.You just presented the same sieving algorithm, using a different module.
If your vision for the kata is to generate primes "on the fly", then
gmpy2.next_prime
is the definition of fast JIT primes, if that doesn't pass, then there isn't much the user can do.Python fork.
It's a bit jank and it uses some hardcoding on my part. It's still possible for the user to hardcode it, but it would be considerably harder.
If you implement a code length check, then it should be very safe, but you'd have to mess with the description. To be honest, that would probably be a good idea.
The Python version is all about knowing
numpy
, you don't need to deal with bitmasks or any proper optimizations. It would at least be good to warn users that try to do it properly.I haven't seen any Python katas that stright up requires you to use
numpy
, at least not without telling you. I just don't think "know you libraries" fits CodeWars, but that's just personal preference."The others are just as bad" isn't an excuse. The kata as a whole has issues, it would be good to fix those before approving more translations.
Also, exploiting bad specs isn't cheating, if you don't want people to exploit the tests, then write better tests.
The Python translation has serious problems. Not only does it not have a description, it doesn't have random tests, such that this passes.
Also, I really don't think Python is an appropriate language for this task, like, seriously. Honestly, I feel like C is the best language for this and it isn't even here. I guess it's too late now.
Well it's not cheating in the sense that it does nothing agains TOS. But, indeed, it ins't a solution that I really like.
I thought about adding a code length constraint, but there is only a single "bad" solution, so I don't think it's too necessary. I don't want to scare people with the restriction, as I myself tend to write very verbose code.
Wow, that's the most beautiful comment I've ever had here. Congrats on solving; most would just give up on your situation. I'm really happy that someone would put such effort into something I created.
Personally, I've also been struggling for time due to college; I'm looking forward to reaching
1dan
, but my time here is inversely proportional to the time spent studying for tests, and this semester hasn't been kind to me.I hope you keep up with your training too; it's nice to have someone to race against in the leaderboards. I kind of don't want to pass you just yet, lol. Well, anyways, good luck with your tests and codewars, if you have time for it, that is.
There is no
\0
at the end of the input. I know this isn't necessary, as the input is always3
chars long, but it would be good to conform to most other katas.Also, this shouldn't cause any katas to be invalidated, so I see no reason not to include it.
It would be good to have in the description the boundaries for the input. For instance, knowing whether the maximum number of bytes ever exceeds
255
would change my approach to the problem.Also, I personally believe that "Mention, don't care about" isn't very clear. I'm not sure whether those cases are present in the input and I have to disconsider them or if they aren't present at all.
Well, that just invalidated all solutions, but yeah, I agree it confused me a lot
Yay, new purple kata! You don't see that every day, especially me being the author. Thanks a lot @dfhwze, you're the best!
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
.
Hey, I've published a fork for this kata. It's changes are mostly regarding the description in order to make it more language agnostic.
Please take a look at it, I can revert back any changes you disagree with.
Loading more items...