Last active
January 19, 2018 07:40
-
-
Save tnolet/9432f1f39890a22bfb9195e5adeb3eca to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
exports.handler = (event, context, callback) => { | |
for (let i=0; i<30; i++){ | |
console.log(fib(i)) | |
} | |
const result = { | |
"isBase64Encoded": false, | |
"statusCode": 200, | |
"headers": {}, | |
"body": "done" | |
} | |
callback(null, result); | |
}; | |
function fib(n) { | |
if(n > 1){ | |
return fib(n-1) + fib(n-2) | |
} else { | |
return n; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment