-
-
Save jacknoble/19f08530d2905f8aa24a to your computer and use it in GitHub Desktop.
This file contains hidden or 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
def fibs(0), do: [] | |
def fibs(1), do: [1] | |
def fibs(2), do: [1, 0] | |
def fibs(num) do | |
lower_fibs = fibs(num - 1) | |
[sum(take(lower_fibs, 2)) | lower_fibs ] | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment