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.
No,
14! == 87178291200
there are two trailing zeros there.I believe for scala
should be assert(Solution.zeros(14) == 1) not assert(Solution.zeros(14) == 2)
Okay, that was indeed overflow issue. My buffer was initialized as Int. Thanks for quick response!
@sitetester
: I already gave you an answer. Ask yourself, why are you returning a negative number? (what makes it happen and how can you avoid it?)There's 276 scala completions, so it's not an issue with kata itself.
Same issue
-1961650628 did not equal 2333316668 for scala
ooh well I had fixed that a while back.. :)
That's not the input, that's your output. So it's you who generated a negative number out of positive numbers ;-)
(Also, as you know, you can always see the input by printing it out.)
Negative integers aren't natural numbers by the generally-accepted mathematical definition.
My mistake I thought negative integers were not natural numbers
Well the kata didnt say negative natural numbers ?
Not an issue. You should figure out why yourself ;-)
-1961650628 did not equal 2333316668 for scala
Translated kata to scala
I have added random tests to approve same.
This comment is hidden because it contains spoiler information about the solution
Loading more items...