Skip to content

Conversation

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

There are some issues here. Check out my comments on the 1st method (remove duplicates). There are circumstances it won't work.

It looks like you're still working through the second method.

# Time Complexity: ?
# Space Complexity: ?
require "pry"
# Time Complexity: O(n2) because it is a nested loop. Each loop runs n number of times where n is the

Choose a reason for hiding this comment

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

Correct!

c = 0

while list[c] != nil
while list[c] == list[i]

Choose a reason for hiding this comment

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

This is a little odd and I think you could have i go beyond the bounds of the array. Something could break here.

@CheezItMan
Copy link

Oh and in the future can you put your 1st name in the PR?

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