Another Java code.


  • 0
    M

    public class Solution {
    public int climbStairs(int n) {
    if(n <= 3){
    return n;
    }
    else{
    return climbStairs(n/2)*climbStairs(n-n/2)+climbStairs(n/2-1)*climbStairs(n-n/2-1);
    }
    }
    }


Log in to reply
 

Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.