https://leetcode.com/problems/unique-paths/

来源:互联网 发布:淘宝网怎么卖闲置 编辑:程序博客网 时间:2024/06/15 08:56

https://leetcode.com/problems/unique-paths/

不知道说什么 

小学排列组合的奥术题 

一瞬间不知道怎么计算机解了 

不知道脑子里的排列组合应该算思考还是算作弊

import mathclass Solution:    # @param m, an integer    # @param n, an integer    # @return an integer    def uniquePaths(self, m, n):        a=math.factorial(m+n-2)        b=math.factorial(m-1)        c=math.factorial(n-1)        return a/(b*c)


0 0
原创粉丝点击