Skip to content

Conversation

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

The first method does successfully count the number of unique elements in a sorted list. The second, well it looks like you haven't finished it yet.

I'd adjusted the 1st method requirements, but I see how you got the solution you arrived it.

Overall not bad. Take a look at my comments and let me know what questions you have.

# Space Complexity: ?
# Time Complexity: O(n)
# Space Complexity: O(1)
def remove_duplicates(list)

Choose a reason for hiding this comment

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

I think you should have run the tests here.

raise NotImplementedError, "Not implemented yet"
prefix_string = ""
strings.first.length.times do |index|
string.each do |string|

Choose a reason for hiding this comment

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

String is undefined here.

# Space Complexity: ?
# Did not have time to complete all the way

# Time Complexity: O(n^2)

Choose a reason for hiding this comment

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

Given what you have here I would say O(m * n) where m is the length of the 1st string and n is the number of strings.

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