public class Solution {
/**
* @param n: An integer
* @return: An integer
*/
public int climbStairs(int n) {
// write your code here
if(n==1)
return 1;
else if(n==2)
return 2;
else return fun(n-1)+fun(n-2);
}
posted on 2017-03-14 18:08 TYYD 阅读(133) 评论(0) 编辑 收藏 举报
Powered by: 博客园 Copyright © 2024 TYYD Powered by .NET 9.0 on Kubernetes