Skip to content

Water - Li#16

Open
nerdyistrendy wants to merge 1 commit intoAda-C14:masterfrom
nerdyistrendy:master
Open

Water - Li#16
nerdyistrendy wants to merge 1 commit intoAda-C14:masterfrom
nerdyistrendy:master

Conversation

@nerdyistrendy
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 Li, you hit the learning goals here. Well done.

@@ -0,0 +1,14 @@
{

Choose a reason for hiding this comment

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

You can add this to the .gitignore file.

Comment on lines +2 to 4
# Time Complexity: O(n) traverse the array
# Space Complexity: O(1) only integers and 2 elements array are created
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.

👍 Clever use of .max

Comment on lines +3 to 9
# Time complexity: O(n) increment i by 1 from 2 to num
# Space Complexity: O(n) store all the sequences in the array
# P(n) = P(P(n - 1)) + P(n - P(n - 1))
# P(3) = P(P(2)) + P(3 - P(2))=1+1
# p(4) = P(P(3)) + P(4-P(3)) = 1 +1

def newman_conway(num)

Choose a reason for hiding this comment

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

👍

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