Fibonacci in Kotlin NDONGO TONUX SAMB on April 16, 2020 The Fibonacci sequence is a sequence of integers in which each term is the sum of the two preceding terms. Read full post Personal Trusted User Create template Templates let you quickly answer FAQs or store snippets for re-use. Submit Preview Dismiss Collapse Expand Madza Madza Madza Follow Discussions. 💬 Tools. 🛠 Resources. 📚 All things productivity. 🎯🚀💯 Email hi@madza.dev Joined Apr 23, 2019 • Apr 16 '20 • Edited on Apr 16 • Edited Dropdown menu Copy link Hide const fib=n=>[...Array(n)].reduce((acc,val,i)=>acc.concat(i>1?acc[i-1]+acc[i-2]:i),[]) Code of Conduct • Report abuse Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink. Hide child comments as well Confirm For further actions, you may consider blocking this person and/or reporting abuse
const fib=n=>[...Array(n)].reduce((acc,val,i)=>acc.concat(i>1?acc[i-1]+acc[i-2]:i),[])