Skip to content

Conversation

eaball35
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.

Comment on lines +15 to +17
temp = solutions[0]
solutions[0] = solutions[1]
solutions[1] = temp + solutions[1]

Choose a reason for hiding this comment

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

Yes!

# 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.

👍

n.to_s.each_char { |num| sum += num.to_i }
return sum
end

def super_digit(n)

Choose a reason for hiding this comment

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

👍

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

sum = digit_sum(n)
sum *= k if i == 0
i += 1

Choose a reason for hiding this comment

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

I don't think you really need i.

# Time Complexity - O(n)
# Space Complexity - O(n)
def refined_super_digit(n, k, i = 0)

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