当前位置:网站首页>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)
边栏推荐
- [EI conference sharing] the Third International Conference on intelligent manufacturing and automation frontier in 2022 (cfima 2022)
- Folding and sinking sand -- weekly record of ETF
- KDD 2022 | 脑电AI助力癫痫疾病诊断
- Go learning --- structure to map[string]interface{}
- Search (DFS and BFS)
- KDD 2022 | EEG AI helps diagnose epilepsy
- notepad++正則錶達式替換字符串
- 免费的聊天机器人API
- Kotlin core programming - algebraic data types and pattern matching (3)
- Keepalive component cache does not take effect
猜你喜欢
Idea remotely submits spark tasks to the yarn cluster
如何制作自己的机器人
《强化学习周刊》第52期:Depth-CUPRL、DistSPECTRL & Double Deep Q-Network
Illustrated network: the principle behind TCP three-time handshake, why can't two-time handshake?
[groovy] XML serialization (use markupbuilder to generate XML data | set XML tag content | set XML tag attributes)
Room cannot create an SQLite connection to verify the queries
看抖音直播Beyond演唱会有感
Data analysis thinking analysis methods and business knowledge -- analysis methods (II)
常用API类及异常体系
Notepad++ regular expression replacement string
随机推荐
Spark SQL空值Null,NaN判断和处理
2022-02-13 work record -- PHP parsing rich text
curlpost-php
KDD 2022 | EEG AI helps diagnose epilepsy
notepad++正则表达式替换字符串
NLP text processing: lemma [English] [put the deformation of various types of words into one form] [wet- > go; are- > be]
curlpost-php
Beginner redis
新手入门深度学习 | 3-6:优化器optimizers
数据分析思维分析方法和业务知识——分析方法(二)
数据分析思维分析方法和业务知识——分析方法(三)
Why can't mathematics give machine consciousness
几百行代码实现一个 JSON 解析器
Browser reflow and redraw
Cf:c. the third problem
Idea remotely submits spark tasks to the yarn cluster
The value of applet containers
可恢复保险丝特性测试
Data analysis thinking analysis methods and business knowledge -- analysis methods (II)
Introduction of motor