Skip to content

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.

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