Skip to content

Conversation

@alexandria7
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 hit all the time and space complexities and solved both problems using a dynamic programming approach. Well done.

# Space Complexity: ?
# Time Complexity: O(n) where n is the length of nums
# 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.

👍

# Time complexity: ?
# Space Complexity: ?
# Time complexity: O(n) where n is the size of num
# Space Complexity: O(n) bc I am making an array dependent on size of num, n

Choose a reason for hiding this comment

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

👍

return "1 1"
end

p = Array.new(num)

Choose a reason for hiding this comment

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

Just note, p isn't exactly a meaning ful variable name, although I recognize it is from the formula.

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