当前位置:网站首页>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
边栏推荐
猜你喜欢

One step ahead, don't miss it again, the chain reading APP will be launched soon!

先人一步,不再错过,链读APP即将上线!

tinymce富文本编辑器

Link reading good article: What is the difference between hot encrypted storage and cold encrypted storage?

Chained Picks: Starbucks looks at digital collectibles and better engages customers

棋类游戏-五子棋小游戏

Multi-table query Notes

树结构——二叉查找树原理与实现

Set Sources Resources and other folders in the IDEA project

Chain Reading Recommendation: From Tiles to Generative NFTs
随机推荐
事务、存储引擎
Smart contracts and DAPP decentralized applications
【el和template区别】
树结构——2-3树图解
sqlplus 显示上一条命令及可用退格键
行盒子的盒模型
MySql 约束
opencv
链表API设计
微信小程序wx.writeBLECharacteristicValue汉字转buffer问题
力扣——统计只差一个字符的子串数目
细说MySql索引原理
el-dropdown drop-down menu style modification, remove the small triangle
Bifrost 同步数据库实现微服务跨库数据同步
【笔记】集合框架体系 Collection
棋类游戏-五子棋小游戏
十年磨一剑!数字藏品行情软件,链读APP正式开放内测!
2021-06-22
ORACLE system table space SYSTEM is full and cannot expand table space problem solving process
ACID四种特性