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.
good idea!
i don't get it. isn't the last one already accepting only one argument?
thanks :)
thanks, glad you liked it.
Nice kata.
Well, you're definitely making the most of the test framework and the platform! This could especially be useful when there are lots of test cases with long output.
What's with this '...it doesnt mean your code will pass my tests' warning?
I'm lost at test case 17. It fails with this message:
Message of previous test is "We have a problem"
Any hints?
Doesn't actally have anything to do with
Math.random
. You just need to fix syntax errors.There is an extra step to pass the tests which has nothing to do with syntax, and is not mentioned anywhere. We just have to discover it from failed test result.
approved.
Your solution is not taking invalid values of
n
into account.That's initial value. if you provide it, in the first call, your
a
will be equal to it andb
will be equal to first value in the array.If you don't provide it,
a
will be the first value andb
will be the second value in the array.It doesn't make much difference in this example, but imagine you wanted to add the numbers as a string rather than sum them. You could provide the initial value as an empty string and get something like
1234567
as a result.You're right. There was a problem with the second example test case, i fixed it.
haha, i was doing this on a bus with a chromebook. guess i got distracted on the way :)
Loading more items...