Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Finished recursion #4

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Finished recursion #4

wants to merge 1 commit into from

Conversation

dri19tcc
Copy link

@dri19tcc dri19tcc commented May 2, 2016

I did not have time to complete travel(x,y), was able to finish fibonacci and palindromes

def fib(n)
return n if n == 1 || n == 0
fibonacci = fib(n - 1) + fib(n - 2)
return fibonacci
end

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This works. I think here we don't need to store the result in fibanacci but instead could just return the value right away

@sudocrystal
Copy link

👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants