题解 | #求路径#4行代码

求路径

http://www.nowcoder.com/practice/166eaff8439d4cd898e3ba933fbc6358

class Solution {
public:
    /**
     * 
     * @param m int整型 
     * @param n int整型 
     * @return int整型
     */
    int uniquePaths(int m, int n) {
        // write code her
        int out;
       // vector<vector<int>> res;
        if(m==1||n==1) return 1;
        out=uniquePaths(m-1,n)+uniquePaths(m,n-1);

        return out;
    }
};
全部评论

相关推荐

码农索隆:单休一个月少休息4天,一年就是48天,平时节假日,别人3天假期,单休的两天
点赞 评论 收藏
分享
05-23 20:31
已编辑
武汉大学 Java
内向的柠檬精在研究求...:注意把武大标粗标大 本地你俩不是乱杀
实习进度记录
点赞 评论 收藏
分享
不愿透露姓名的神秘牛友
07-04 15:36
点赞 评论 收藏
分享
评论
1
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务