当前位置:网站首页>Fibonacci number
Fibonacci number
2022-07-06 00:47:00 【々 orange if ℃ №】
Learning goals :
A daily topic - Fibonacci number
Learning content :
Fibonacci number ( Usually use F(n) Express ) The sequence formed is called Fibonacci sequence . The sequence is composed of 0 and 1 Start , Each of the following numbers is the sum of the first two numbers . That is to say :
solution :
class Solution:
def fib(self, n: int) -> int:
if n == 0:
return 0
if n == 1:
return 1
return self.fib(n-1)+self.fib(n-2)
边栏推荐
- Spark SQL UDF function
- Room cannot create an SQLite connection to verify the queries
- Model analysis of establishment time and holding time
- MCU realizes OTA online upgrade process through UART
- [EI conference sharing] the Third International Conference on intelligent manufacturing and automation frontier in 2022 (cfima 2022)
- Problems and solutions of converting date into specified string in date class
- 时间戳的拓展及应用实例
- 看抖音直播Beyond演唱会有感
- Spark SQL空值Null,NaN判断和处理
- 猿桌派第三季开播在即,打开出海浪潮下的开发者新视野
猜你喜欢
Comment faire votre propre robot
Cve-2017-11882 reappearance
Location based mobile terminal network video exploration app system documents + foreign language translation and original text + guidance records (8 weeks) + PPT + review + project source code
Common API classes and exception systems
Calculate sha256 value of data or file based on crypto++
Starting from 1.5, build a micro Service Framework - call chain tracking traceid
[groovy] JSON string deserialization (use jsonslurper to deserialize JSON strings | construct related classes according to the map set)
看抖音直播Beyond演唱会有感
cf:D. Insert a Progression【关于数组中的插入 + 绝对值的性质 + 贪心一头一尾最值】
Extension and application of timestamp
随机推荐
Pointer pointer array, array pointer
【文件IO的简单实现】
How to use the flutter framework to develop and run small programs
Go learning - dependency injection
可恢复保险丝特性测试
Analysis of the combination of small program technology advantages and industrial Internet
Spark DF adds a column
Model analysis of establishment time and holding time
OpenCV经典100题
95后CV工程师晒出工资单,狠补了这个,真香...
电机的简介
The relationship between FPGA internal hardware structure and code
DD's command
【线上小工具】开发过程中会用到的线上小工具合集
After Luke zettlemoyer, head of meta AI Seattle research | trillion parameters, will the large model continue to grow?
[Online gadgets] a collection of online gadgets that will be used in the development process
Meta AI西雅图研究负责人Luke Zettlemoyer | 万亿参数后,大模型会持续增长吗?
Leetcode Fibonacci sequence
STM32按键消抖——入门状态机思维
常用API类及异常体系