-
Notifications
You must be signed in to change notification settings - Fork 1
tech(recursion/nth-fibonacci): fibonacci #2
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changes requested
recursion-nth-fibonacci.py
Outdated
defaultArray = [0,1] | ||
count = 3 | ||
while count <= n: | ||
sumNo = defaultArray[0] + defaultArray[1] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
change sumNo
variable to sum
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed
recursion-nth-fibonacci.py
Outdated
defaultArray[0] = defaultArray[1] | ||
defaultArray[1] = sumNo | ||
count = count + 1 | ||
if n == 1: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
move this if-block before count init since there is no need for count assignment and further while check. correct me if I am wrong
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
DOne
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
change required
#1