Skip to content

Commit

Permalink
removed solution
Browse files Browse the repository at this point in the history
  • Loading branch information
rachelAtFlatiron committed Jun 18, 2024
1 parent e040a48 commit 507d16d
Showing 1 changed file with 1 addition and 11 deletions.
12 changes: 1 addition & 11 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,7 @@

function fib(num){
// Code here
if(num <= 2){
return 1;
}
let prev = 1;
let cur = 1;
for(let i = 3; i <= num; i++){
let newCur = prev + cur;
prev = cur;
cur = newCur;
}
return cur;

}

export { fib }

0 comments on commit 507d16d

Please sign in to comment.