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.
This comment is hidden because it contains spoiler information about the solution
You're getting NaN because your function doesn't work with the tests. The tests are going to call your function
stairsIn20(number)
and the tests are going to pass that function one argument: an array of arrays. Ultimately, what is happening is that you are trying to returnstairs
, which you have already defined, multiplied bynumber
, but in this case,number
is actually the array of arrays that the tests have passed to your function. An array * integer results inNaN
.I think you may want to read the description again, because based on your code, it seems to me that you think the tests will pass a number of years to your function which you then have to return as the x-year estimate based on the number of steps in the example. The goal is to always produce a 20-year estimate of the number of steps taken, and every individual test will pass a different amount of steps in the form of an array containing a different array for each day of the week as an argument to your function.