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.
Can someone tell me if my logic is wrong or there is a bug?
Description says: generate(1,3) should create 3 sets of numbers (for number 1, 2 and 3)
So logicly generate(1,2) should generate 2 sets of numbers (for 1 and 2)
but tests in PHP for generate(1,2) wants only 1 set of numbers.
For me it works, if you run print(-3%2) it will return 1 still
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.
Now works perfectly! yay, Thank You ;)
Should be fixed. Please check and re-raise if the problem still persists.
I replaced the faulty reference solution with mine and I think it works now. Can you try?
I asked someone to show me D Lang translation Solution.
I think the line c = 1 << c; should be c = 1UL << c;
Wihout this it goes over int and wrap around.
I'm new to this but I'm sure my code is correct and translation is incorrect.
This comment is hidden because it contains spoiler information about the solution
I had a chance to use foreach_reverse. yay ;)
Good day to practice std.algorithm ;)
Today I learned how to convert decimal number to binary. yay ;)
Every time I do simple kata a learn new think from std.math. Thanks ;)
I feel like I'm learning ;)
Loading more items...