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.
From your link:
-7 is neither natural nor greater than 1, so, no, it's not a prime number.
I can see no -7 (i.e. "negative seven") on the list?
https://en.wikipedia.org/wiki/List_of_prime_numbers
Are you sure? Can you point to a resource which presents -7 as a prime number?
In "C++"
While pushing "Attempt" -7 or -6 turns "false" in test, but it is "true" for -7 (it is a prime number) and "false" for -6 (not prime)
You have to start working with optimizations at some point, and as hobovsky said, it's a very trivial one, in fact, if you read that part of the description again, you'll see this:
Pointing out where you should focus to make your code faster.
6 kyu is considered OK for challenges with trivial optimisations. Yellow kata are not beginner level anymore.
The rank is the only thing I'm mad about. I mean, 6 kyu is right next after "fundamentals" (which is 7-8), it's not fair to demand optimizations on this level.
But it doesn't, does it? Because it's too slow. There is a performance requirement, if your code isn't fast enough, it'll only work for a certain range. It's written in the kata's description. You can complain about the rank, that's fine, but you can't say that your code works when it doesn't.
This "too slow" condition is stupid as hell for 6 kyu. If the code works, it should be accepted.
Если не является простым, то как раз и должно быть
False
, ещё раз почитайте условие заданияI cannot speak to your two previous experiences, but in this case your code does not work for this kata, yet. Notice that your code passes the Sample Tests? That's because it is basically correct. Meanwhile, it times out for the Final Tests because it is not optimized enough to solve all the tests in sufficient time. This then speaks to the fact that your outside environment is not set up identically to test your code with adaquate coverage. It is then most likely also, in your two previous experiences, that your outside environment was caught lacking in a similar fashion. Often, it is as simple as the fact that there are certain edge cases / specific tests which are not present in the outside environment.
That is now the 3rd KATA, where my Code works in VS, but in CW some tests fail. My code is in c#. With the same numbers, I get differents results in VS and CW!!!!
I like it too
Thank you for the kata 🙏. Not sure if I like it very much though. It checks whether you know particular optimal methods for solving the challenge; solving the challenge is not enough :) Anyway, thanks!
Loading more items...