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.
Works now, thanks
I just tried it in Python. After I threw all recursive variants away and used an iterative one, it worked fine. However, I'm not sure whether the integral type in Python over-/underflows in this case, but according to the Python IDLE it changes to
...L
automatically. There shouldn't be any "precision" issues in Python.Whoops, sorry. Seems like I accidentially forgot to change
Integer -> Integer
toInt -> Integer
in the initial solution. Should be fixed. Just change the type of your function toInt -> Integer
and you should be fine.JS now certainly works, but I think a similar issue is on other languages too; consider I was using the Decimal class with 50 decimal digits in Python and got this:
9479398183114544640861314325734704178452902509291400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000L should equal 9479398183114544640861314325734704178452902509146734338936275702483155470586109600468782416434303102723062665537736846418815435968207663011L
Even if there is some version of it, fine tuning the right amount of digital precision, it seems to me that this version is harder than the JS version. And I think the same could go for Ruby.
Finally it works!
Thank you for your feedback and for your kata.
I think my problem where with big integers!
Ok!
Now I pass the -1 to -50 but I fail on the random.
Thank you I am going to see why!
I've changed the tests a bit try now.
Using Haskell I can get the tests running, but when submitting, I'm getting the following error:
Ok bkaes!
I think I am no stuck, I want to know if the value that gives as a solution -45537549124 is -51, like this test:
NaMe613, I pass 57 tests before the first fail.
The test that fails says:
Thank you for your feedback.
My apologies for not having replied yet,could you please clarify how many tests you pass before the error occurs.
Please use three backticks to mark code:
Otherwise it's kind of hard to read your comments. That being said, the JavaScript tests have been changed lately. Did you try again? Also, if you're completely stuck, you can add your current solution as a spoiler in a comment.
Thanks for your answer.
The test that says failed is this one: Test.assertEquals(lucasnum(-51), -45537549124) ?
-50 to -1
Expected: -45537549124, instead got: 28143753123
Which other number can bring me the -45537549124 if is not the -51 ?
I try with my own test:
Test.assertEquals(lucasnum(-51), -45537549124)
And works...
Thank you for your feedback
Thanks for the quick resolve and special thanks for this kata :-)
The test cases in the javascript translation can be above 1000 so recursion is to slow.
You're right it works fine.
Loading more items...