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.
You have to multiply two numbers to get to the target product, but you're only adding one of them to your list ;-)
I don't get it, which part do you mean?
Every time you find a divisor you're throwing away the other part of the information ;-)
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
Okay, thanks a lot :)
You're using a global var there, it holds the previous value when your function is called several times in a row.
Why
result
belongs to the class? The next time your function is called it'll have the previous value, that's why you getexpected: 0 but was: 3
. Not a kata issue, it's your code that should be fixed. Try calling your function several times in eclipse too, it'll also fail there.This comment is hidden because it contains spoiler information about the solution
The assertion with 39 is this one:
assertEquals(3, Persist.persistence(39));
and it's ok. I've solved it in java and it worked fine for me.I've got a problem in Java. With 39 it says: "expected: 0 but was: 3", while 3 is the correct answer not 0...But it doesn't pass the other tests either.
I'm trying it with recursion as well.
I calculate the value of the multiples and re-passing if it's not the expected. But, somehow it's not returning values after the recursion.