题目描述
You are given integer N, and return the Fibonacci Series till the Nth term.
Example:
Input:
5
Output:
0 1 1 2 3 5
Explanation:
0 1 1 2 3 5 is the Fibonacci series up to
the 5th term.(0-based indexing)
Your Task:
You don't need to read input or print anything. Your task is to complete the function Series() which takes an Integer N as input and returns a Fibonacci Series up to the Nth term.
Expected Time Complexity: O(n)
Expected Space Complexity: O(n)
Constraint:
1<=n<100
输入格式
见题面
输出格式
见题面
样例输入
5
样例输出
0 1 1 2 3 5