Skip to content

Conversation

@amythetester
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.

Nice work, you fully applied dynamic programming to these solutions. Well done!

raise NotImplementedError, "Method not implemented yet!"
return 0 if nums == nil

max_so_far = nil

Choose a reason for hiding this comment

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

Why not just start max_so_far to the smallest integer possible, to simplify the if statement.

Comment on lines +16 to +21
def conway_helper(num, output)
return 1 if num < 3
return output[num - 1] if output[num - 1]
helper = conway_helper(num - 1, output)
conway_helper(helper, output) + conway_helper(num - helper, output)
end

Choose a reason for hiding this comment

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

Nice method, both recursive and efficient!

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