Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

How many options are there to climb a ladder with N

function fib(n)
{
if (n <= 1)
    return n;
return fib(n - 1) +
       fib(n - 2);
}
 
// Returns number of
// ways to reach s'th stair
function countWays(s)
{
    return fib(s + 1);
}
 
PREVIOUS NEXT
Tagged: #How #options #climb #ladder #N
ADD COMMENT
Topic
Name
9+9 =