当前位置:网站首页>Dynamic planning for stair climbing
Dynamic planning for stair climbing
2022-07-26 04:05:00 【AI Zeng Xiaojian】
class Solution:
@lru_cache(None)
def climbStairs(self, n: int) -> int:
if n == 0:
return 0
elif n == 1:
return 1
elif n == 2:
return 2
return self.climbStairs(n - 1) + self.climbStairs(n - 2)class Solution:
@lru_cache(None)
def climbStairs(self,n:int) -> int:
if n == 0:
return 0
elif n ==1:
return 1
elif n ==2:
return 2
return self.climbStairs(n-1) +self.climbStairs(n-2)边栏推荐
- Opencv learning notes - edge detection and Canny operator, Sobel operator, lapiacian operator, ScHARR filter
- 苹果在其产品中拿掉了最后一颗Intel芯片
- 《opencv学习笔记》-- 重映射
- 测试用例设计方法之——招式组合,因果判定
- Luoda development - audio stream processing - AAC / loopbacktest as an example
- 深度学习之DAT
- 软考 系统架构设计师 简明教程 | 案例分析解题技巧
- JS Base64 encoding and decoding
- STM32 state machine programming example - full automatic washing machine (Part 2)
- 【云原生之kubernetes】kubernetes集群下ConfigMap使用方法
猜你喜欢

Advanced content of MySQL -- three MySQL logs that must be understood binlog, redo log and undo log

E-commerce operator Xiaobai, how to get started quickly and learn data analysis?
![[cloud native] talk about the understanding of the old message middleware ActiveMQ](/img/70/fe2ef0bea10d8275c0fe4c8139b027.png)
[cloud native] talk about the understanding of the old message middleware ActiveMQ

PHP method to find the location of session storage file

Constructing verb sources for relation extraction

Sentinel fusing and current limiting

Communication protocol and message format between microservices

One stop monitoring of the software and hardware infrastructure of the whole university, and Suzhou University replaces PostgreSQL with time series database

《opencv学习笔记》-- 重映射

php 查找 session 存储文件位置的方法
随机推荐
Experimental reproduction of image classification (reasoning only) based on caffe resnet-50 network
In PHP, you can use the abs() function to turn negative numbers into positive numbers
测试用例设计方法之:入门试招,等价边界初探
Go Plus Security:一款Build Web3不可或缺的安全生态基础设施
Oracle 11g "password delayed verification" feature
Introduction to UFS CLK gate
基于移位寄存器的同步FIFO
微信小程序实现音乐播放器(5)
JS Base64 encoding and decoding
PHP 对象转换数组
laravel8 实现接口鉴权封装使用JWT
工程师如何对待开源 --- 一个老工程师的肺腑之言
动态规划 爬楼梯
Working ideas of stability and high availability guarantee
Overview of wavelet packet transform methods
(翻译)网站流程图和用户流程图的使用时机
【二叉树】二叉树中的最长交错路径
If you want to do a good job in software testing, you can first understand ast, SCA and penetration testing
规则引擎Drools的使用
Acwing game 61 [End]