Skip to content

Conversation

@dhan0406
Copy link

No description provided.

Copy link

@CheezItMan CheezItMan left a comment

Choose a reason for hiding this comment

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

Overall nice work, you hit the learning goals here. Well done.

# Time Complexity - O(n)
# Space Complexity - O(n)
# Hint, you may want a recursive helper method
def fibonacci(n)

Choose a reason for hiding this comment

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

This works, but you are keeping the list of all the fibonacci numbers for the whole length of the recursive calls. Instead you only need to keep the last 2 fibonacci numbers.

Comment on lines +3 to +4
# Time Complexity - O(n)
# Space Complexity - O(n)

Choose a reason for hiding this comment

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

Where n is the number of digits, yes.

# Space Complexity - ?
# Time Complexity - O(n)
# Space Complexity - O(n)
def super_digit(n)

Choose a reason for hiding this comment

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

👍

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