Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

Climbing Stairs

var climbStairs = function(n) {
    
  const m =[1,1,2];
    for(let i=3; i<=n;i++){
        m[i] = m[i-1]+m[i-2]
    }
    return m[n]
    
};
Source by leetcode.com #
 
PREVIOUS NEXT
Tagged: #Climbing #Stairs
ADD COMMENT
Topic
Name
5+6 =