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.
Great point. So I would need to set a condition then
How about y = 0 ?
I feel silly now *facepalm *.
Thank you!
You're doing recursion wrong. You need to return the function call too.
This comment is hidden because it contains spoiler information about the solution
Post your code using markdown formatting and marking your post as having spoiler content so we can help you.
This comment is hidden because it contains spoiler information about the solution
Added random tests, how it works now :)
Do not use
Test.expect
, do provide random tests, and haven't I seen this before somewhere? ( Maybe not exactly this, but this concept is certainly not novel. )No, I didn't mixed expected and got. I'm 100% sure :( That's why I'm confused.
Another example:
Testing for 2608491
Log
(3)(19)(45763)
It should work for random inputs too - Expected: '(2)', instead got: '(3)(19)(45763)'
I am not the JS translator but for 195 the reference solution returns
(3)(5)(13)
; for 4238285 it returns(5)(847657)
. Both are correct. Print your input and your output to see what happens. Did you mix expected and got?True, but I don't really understand what happens or if I haven't understood something. For example, in these tests, the kata asks for the prime factors of 195. The prime factors of 195 are 3,5 and 13, not just 2 :(
As you could have seen at the top of the page, 996 guys passed the JS kata so there could be something wrong in your code. Cheers.
I have some trouble with this kata in JS. When passing the tests, I don't really understand what happens. I pass the sample test but some of the others seem to give wrong answers:
Testing for 4238285
It should work for random inputs too - Expected: '(1)', instead got: '(5)(847657)'
Testing for 195
It should work for random inputs too - Expected: '(2)', instead got: '(3)(5)(13)'
Am I doing something wrong?
Not a problem of the kata but could be a CW one.
Loading more items...