2023年4月22日
摘要: 爬楼梯 【题目描述】 假设一段楼梯共n(n>1)个台阶,小朋友一步最多能上3个台阶,那么小朋友上这段楼梯一共有多少种方法。 def climbStairs(n): foot3 = {1: 1, 2: 2, 3: 4} # 前三阶的三种情况 if n in foot3.keys(): return f 阅读全文
posted @ 2023-04-22 22:05 夜的第七章i 阅读(6) 评论(0) 推荐(0) 编辑