Skip to content

Conversation

faezeh-ashtiani
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 Faezeh, this hits the learning goals. Well done.

Comment on lines +10 to +13
nums.each do |n|
max_ending_here = [n, max_ending_here + n].max
max_so_far = [max_so_far, max_ending_here].max
end

Choose a reason for hiding this comment

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

Clever use of .max

Comment on lines +2 to 4
# Time Complexity: O(n)
# Space Complexity: O(1)
def max_sub_array(nums)

Choose a reason for hiding this comment

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

👍 Nice

Comment on lines +1 to +3
# Time complexity: O(n)
# Space Complexity: O(n) -> the result array get larger with the number of elements
def newman_conway(num)

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