Skip to content

Conversation

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

Well done Erika, you hit the learning goals here. Well done.

Comment on lines +19 to +23
currSum = currSum + nums[i]
if(currSum > maxSum):
maxSum = currSum
if(currSum < 0):
currSum = 0

Choose a reason for hiding this comment

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

Just a little simpler.

Suggested change
currSum = currSum + nums[i]
if(currSum > maxSum):
maxSum = currSum
if(currSum < 0):
currSum = 0
currSum = max(currSum + nums[i], nums[i])
maxSum = max(currSum, maxSum)

Comment on lines +3 to 9
# Time complexity: O(n)
# Space Complexity: O(n)
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: O(n)
"""

Choose a reason for hiding this comment

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

👍 Nice

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