Skip to content

Commit

Permalink
Create 23.03.2024.cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
Masked-coder11 authored Mar 22, 2024
1 parent 54cd643 commit 5d64b8e
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions 23.03.2024.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
lass Solution {
public:
vector<int> Series(int n) {
// Code here
vector<int>ans(n+1);
ans[0]=0;
ans[1]=1;

int mod=1e9+7;
for(int i=2;i<=n;i++){
int x= ans[i-1]+ans[i-2];
x%=mod;
ans[i]=x;
}
return ans;
}
};

0 comments on commit 5d64b8e

Please sign in to comment.