Skip to content

Commit f4c44bc

Browse files
author
mr_jj
committed
Solved Time Error
1 parent aef2eae commit f4c44bc

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

2.Conditionals and Loops/Nth Fibonacci number.ipynb

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,24 @@
4646
"n=int(input())\n",
4747
"print(Fibonacci(n))"
4848
]
49+
},
50+
{
51+
"cell_type": "code",
52+
"execution_count": null,
53+
"metadata": {},
54+
"outputs": [],
55+
"source": [
56+
"# Use This To Solve Time Exceed Error\n",
57+
"n = int(input())\n",
58+
"a = 0\n",
59+
"b = 1\n",
60+
"c = -1\n",
61+
"for i in range(n) :\n",
62+
" c = a + b\n",
63+
" a = b\n",
64+
" b = c \n",
65+
"print(a)"
66+
]
4967
}
5068
],
5169
"metadata": {

0 commit comments

Comments
 (0)