Fibonacci series up to Nth term GFG POTD Python Solution
VS Code VS Code
218 subscribers
148 views
0

 Published On Mar 22, 2024

Problem - https://www.geeksforgeeks.org/problem...

You are given an integer n, return the fibonacci series till the nth(0-based indexing) term. Since the terms can become very large return the terms modulo 109+7.

Example 1:

Input:
n = 5
Output:
0 1 1 2 3 5
Explanation:
0 1 1 2 3 5 is the Fibonacci series up to the 5th term.
Example 2:

Input:
n = 10
Output:
0 1 1 2 3 5 8 13 21 34 55
Explanation:
0 1 1 2 3 5 8 13 21 34 55 is the Fibonacci series up to the 10th term

show more

Share/Embed