当前位置:网站首页>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)
边栏推荐
- Pointer - character pointer
- Novice entry depth learning | 3-6: optimizer optimizers
- Synchronized and reentrantlock
- Yolov5、Pycharm、Anaconda环境安装
- Natural language processing (NLP) - third party Library (Toolkit):allenlp [library for building various NLP models; based on pytorch]
- anconda下载+添加清华+tensorflow 安装+No module named ‘tensorflow‘+KernelRestarter: restart failed,内核重启失败
- Data analysis thinking analysis methods and business knowledge -- analysis methods (II)
- 看抖音直播Beyond演唱会有感
- Data analysis thinking analysis methods and business knowledge - analysis methods (III)
- Folding and sinking sand -- weekly record of ETF
猜你喜欢
notepad++正則錶達式替換字符串
建立时间和保持时间的模型分析
Cf:d. insert a progression [about the insert in the array + the nature of absolute value + greedy top-down]
The third season of ape table school is about to launch, opening a new vision for developers under the wave of going to sea
FPGA内部硬件结构与代码的关系
Leetcode:20220213 week race (less bugs, top 10% 555)
I'm interested in watching Tiktok live beyond concert
小程序技术优势与产业互联网相结合的分析
Arduino六足机器人
毕设-基于SSM高校学生社团管理系统
随机推荐
MySQL存储引擎
Spark DF adds a column
Spark获取DataFrame中列的方式--col,$,column,apply
Common API classes and exception systems
Multithreading and high concurrency (8) -- summarize AQS shared lock from countdownlatch (punch in for the third anniversary)
Idea远程提交spark任务到yarn集群
The third season of ape table school is about to launch, opening a new vision for developers under the wave of going to sea
Power query data format conversion, Split Merge extraction, delete duplicates, delete errors, transpose and reverse, perspective and reverse perspective
[groovy] compile time metaprogramming (compile time method injection | method injection using buildfromspec, buildfromstring, buildfromcode)
STM32 key chattering elimination - entry state machine thinking
[groovy] XML serialization (use markupbuilder to generate XML data | create sub tags under tag closures | use markupbuilderhelper to add XML comments)
Classical concurrency problem: the dining problem of philosophers
KDD 2022 | EEG AI helps diagnose epilepsy
Spark SQL UDF function
如何利用Flutter框架开发运行小程序
Novice entry depth learning | 3-6: optimizer optimizers
Cloud guide DNS, knowledge popularization and classroom notes
Power Query数据格式的转换、拆分合并提取、删除重复项、删除错误、转置与反转、透视和逆透视
uniapp开发,打包成H5部署到服务器
Cve-2017-11882 reappearance