当前位置:网站首页>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)

边栏推荐
- Set data real-time update during MDK debug
- MySQL存储引擎
- [groovy] compile time meta programming (compile time method interception | method interception in myasttransformation visit method)
- 面试必刷算法TOP101之回溯篇 TOP34
- Promise
- esxi的安装和使用
- logstash清除sincedb_path上传记录,重传日志数据
- 如何制作自己的機器人
- [groovy] XML serialization (use markupbuilder to generate XML data | create sub tags under tag closures | use markupbuilderhelper to add XML comments)
- 从 1.5 开始搭建一个微服务框架——调用链追踪 traceId
猜你喜欢
![[groovy] JSON serialization (convert class objects to JSON strings | convert using jsonbuilder | convert using jsonoutput | format JSON strings for output)](/img/52/021931181ad3f4bef271b4e98105c2.jpg)
[groovy] JSON serialization (convert class objects to JSON strings | convert using jsonbuilder | convert using jsonoutput | format JSON strings for output)

数据分析思维分析方法和业务知识——分析方法(二)

FFmpeg抓取RTSP图像进行图像分析

For a deadline, the IT fellow graduated from Tsinghua suddenly died on the toilet

The relationship between FPGA internal hardware structure and code

notepad++正则表达式替换字符串

Illustrated network: the principle behind TCP three-time handshake, why can't two-time handshake?

uniapp开发,打包成H5部署到服务器

KDD 2022 | 脑电AI助力癫痫疾病诊断

Uniapp development, packaged as H5 and deployed to the server
随机推荐
[groovy] XML serialization (use markupbuilder to generate XML data | set XML tag content | set XML tag attributes)
Leetcode Fibonacci sequence
curlpost-php
curlpost-php
[groovy] compile time metaprogramming (compile time method interception | find the method to be intercepted in the myasttransformation visit method)
esxi的安装和使用
View class diagram in idea
数据分析思维分析方法和业务知识——分析方法(二)
Spark AQE
Cloud guide DNS, knowledge popularization and classroom notes
[EI conference sharing] the Third International Conference on intelligent manufacturing and automation frontier in 2022 (cfima 2022)
STM32按键消抖——入门状态机思维
【线上小工具】开发过程中会用到的线上小工具合集
[groovy] JSON string deserialization (use jsonslurper to deserialize JSON strings | construct related classes according to the map set)
免费的聊天机器人API
Analysis of the combination of small program technology advantages and industrial Internet
DD's command
Data analysis thinking analysis methods and business knowledge -- analysis methods (II)
Intranet Security Learning (V) -- domain horizontal: SPN & RDP & Cobalt strike
Cf:c. the third problem