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

dynamic-programming #32

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

dynamic-programming #32

wants to merge 2 commits into from

Conversation

sumitrac
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 Sumitra, you're not quite right on the max subarray problem. Check out my comment and let me know what questions you have.

@@ -0,0 +1,17 @@
{

Choose a reason for hiding this comment

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

You can probably add .vscode to your .gitignore file.

@@ -4,9 +4,31 @@ def max_sub_array(nums):
Returns 0 if nums is None or an empty list.
Time Complexity: ?
Space Complexity: ?
Does this have to be contiguous?

Choose a reason for hiding this comment

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

Yes

Comment on lines +29 to +30
if max_so_far <= 0:
return max(nums)

Choose a reason for hiding this comment

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

Note putting this if statement in the loop means that if the 1st number is negative the function will find the largest number in the array and return it instead of finding the max contiguous subarray.

Comment on lines 5 to 9
def newman_conway(num):
""" Returns a list of the Newman Conway numbers for the given value.
Time Complexity: ?
Space Complexity: ?
Time Complexity: o(n)
Space Complexity: 0(n)
"""

Choose a reason for hiding this comment

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

👍 Well done

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