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

Solution 3 to Climbing Stairs Problem #200

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

Conversation

hiteshskp
Copy link
Contributor

As 1 <= n <= 45 we can use Binet’s Formula (Fibonacci closed form) PS: this won't work for n>70 or 100 The "climb stairs" problem is equivalent to computing the nth Fibonacci number (with a slight index shift), where: F(0) = 0
F(1) = 1
F(n) = F(n-1) + F(n-2)
The number of ways to climb n stairs is the (n + 1)th Fibonacci number.

As 1 <= n <= 45 we can use Binet’s Formula (Fibonacci closed form) PS: this won't work for n>70 or 100
The "climb stairs" problem is equivalent to computing the nth Fibonacci number (with a slight index shift), where:
F(0) = 0
F(1) = 1
F(n) = F(n-1) + F(n-2)
The number of ways to climb n stairs is the (n + 1)th Fibonacci number.
@hiteshskp
Copy link
Contributor Author

@kamyu104 need some approvals PLEASE

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.

1 participant