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.
Java && Python && Ruby:
Missing following fixed tests, causing Incorrect Java solution && incorrect Python solution && incorreect Ruby solution to bypass
Acually it does "Your task is to create a function that..." implies to calculate the solution no "find" a trick to pass the tests (Even sample tests suggests I have to perform calculations). And I get it, I'm new here and assumed ever challenge requires you to write a code, not return one word/number because there is a trick to the challenge. I guess I learned that if challenge is too hard for its rank there may be a trick to it. ( But still author should not be lazy and write a real solution for 536! so I can learn something ;P ) Cheers
No, the challenge does not ask you to do any of this. The method you use to solve is irrelevant (as long as it's not cheating). If you want to solve it by calculating 536! then go ahead, but this challenge can be solved without calculating 536!, in a way which can be deemed 8 kyu.
So this challenge asks you to understand Wilson prime, write Factorial function because your language doesn't have it (D lang) and optimase the function to handle numbers like 536! and it's 8kyu? My last 8kyu asked me to convert int to string.
I would counter this with "the main issue of this task is users going the hard way and jumping right into coding instead of doing 5 minutes worth of research" :)
The main issue of this task is number overflow. Factorial of given n would easily overflow that variable type can hold. The trick I used is limiting any calculated results within variable range: input type (RUST) is u32 and we have to do n^2, so we need to make sure any temp results within u64 (Whatever type we chose, factorial will exceed). Here is exact reason why modulo was introduced. When a temp number is about to overflow, MOD(n^2).
This is definitely not an 8 kyu, I got frustrated with endless overflow errors when I tried, and lol when I see "known Wilson Primes" way.
Man I'm always up for googling that's most of what we do but this is not an 8 kyu.
need a better explanation or higher level(in c++ 563 is gives a buffer overflow)
1 is not a prime number Edit: sorry, new to Codewars and haven't seen the 'Expand replies' feature
Fixed.
The wiki actualy says 1 is a wilson prime though its not
done there
I think that it is not possible to change the level.
This comment is hidden because it contains spoiler information about the solution
please consider adding a bit help to your description here:
Your task is to create a function that returns true if the given number is a "known Wilson prime" and false otherwise.
Loading more items...