Ad
  • Custom User Avatar

    From your link:

    A prime number (or prime) is a natural number greater than 1 that has no positive divisors other than 1 and itself.

    -7 is neither natural nor greater than 1, so, no, it's not a prime number.

  • Custom User Avatar

    I can see no -7 (i.e. "negative seven") on the list?

  • Custom User Avatar
  • Custom User Avatar

    Are you sure? Can you point to a resource which presents -7 as a prime number?

  • Custom User Avatar

    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)

  • Custom User Avatar

    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:

    Looping all the way up to n, or n/2, will be too slow.

    Pointing out where you should focus to make your code faster.

  • Custom User Avatar

    6 kyu is considered OK for challenges with trivial optimisations. Yellow kata are not beginner level anymore.

  • Custom User Avatar

    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.

  • Custom User Avatar

    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.

  • Custom User Avatar

    This "too slow" condition is stupid as hell for 6 kyu. If the code works, it should be accepted.

  • Custom User Avatar

    Если не является простым, то как раз и должно быть False, ещё раз почитайте условие задания

  • Custom User Avatar

    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.

  • Custom User Avatar

    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!!!!

  • Custom User Avatar

    I like it too

  • Custom User Avatar

    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...