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.
Op solved it, closing
This comment is hidden because it contains spoiler information about the solution
You see how
m
is defined as along
in the arguments instead ofint
?.It's because
int
is too small for some of the bigger factorials.Your
fac
variable overflows and gives incorrect results in those cases. Make it along
and your solution works.This comment is hidden because it contains spoiler information about the solution
@CrazyMerlyn: thanks for your help!
@jamesjohnson92: maybe you could avoid the use of factorial.
It is failing because you keep appending to the same factoial list.
When you check your code separately, you probably just use the function once.
But when you use the function again(like repeated tests), it appends two more 1s in the list for each call.
This ruins your list, and by extension, your code.
If you plan on calling the generatelist again and again, it should create a new list and return it.
On the other hand, if you want a global list you should either fill it only once, or make sure you don't make repetitions.
I tried with all the test case given in Test case section ,and i cross checked with the expected results too . i have no idea why it is failing.
This comment is hidden because it contains spoiler information about the solution
Based on that Test, I assume you are using Python or Ruby.
I tried both and it seems to be working for me.
Could you post your solution(mark it as spoiler)?
"-1 should equal 3"
What does the above statement mean ?
For the test case Test.assert_equals(checkchoose(35, 7), 3) I get result 3 when i run the function checkchoose(35, 7) in my pc . I dono what result it is returning in this!!. ?