当前位置:网站首页>LeetCode 剑指offer 10-I.斐波那契数列(简单)
LeetCode 剑指offer 10-I.斐波那契数列(简单)
2022-08-10 05:32:00 【生信研究猿】
python
class Solution:
def fib(self, n: int) -> int:
if(n==0 ):
return 0
if(n==1 ):
return 1
a = 0
b = 1
i = 2
while (i<=n):
c = b
b = a+b
a = c
i +=1
b = int(b%(1e9+7))
# print(b)
return b
边栏推荐
- Linux数据库Oracle客户端安装,用于shell脚本用sqlplus连接数据库
- Ten years of sharpening a sword!The digital collection market software, Link Reading APP is officially open for internal testing!
- Canal 报错 Could not find first log file name in binary log index file
- 网络安全之防火墙
- Collection工具类
- A timeout error is reported when connecting to Nacos
- Common class BigDecimal
- 栈和队列
- IDEA连接MySQL数据库并执行SQL查询操作
- 小程序wx.request简单Promise封装
猜你喜欢
随机推荐
链读好文:热加密存储与冷加密存储有什么区别?
符号表
常用类 BigDecimal
小程序wx.request简单Promise封装
sqlplus 显示上一条命令及可用退格键
Collection工具类
第六次实验
cesium listens to map zoom or zoom to control whether the content added on the map is displayed
The latest and most complete digital collection sales calendar-07.26
国内数字藏品投资价值分析
Knowledge Distillation Thesis Learning
Link reading good article: What is the difference between hot encrypted storage and cold encrypted storage?
堆的原理与实现以及排序
The submenu of the el-cascader cascade selector is double-clicked to display the selected content
链读 | 最新最全的数字藏品发售日历-07.28
学生管理系统以及其简单功能的实现
Bifrost 同步数据库实现微服务跨库数据同步
毫米波雷达数据集Scorp使用
2021-06-22
力扣——情侣牵手









