Skip to content

Conversation

@brikemp
Copy link

@brikemp brikemp commented Sep 16, 2019

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.

Not bad. See my notes on remove_duplicates, as it has troubles. Take a look at my comments and let me know if I can clarify things further.

# Space Complexity: O(1)
def remove_duplicates(list)
raise NotImplementedError, "Not implemented yet"
(list.length - 1).times do |count|

Choose a reason for hiding this comment

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

This will miss the times when the number appears 3 times in a row
For example:
[1, 2, 2, 3, 4]

end
end

(list.length - 1).times do |number|

Choose a reason for hiding this comment

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

I like how this shifts nil to the right. However it misses the problem listed above.

I went ahead and added a test for C13 on this.


strings.each do |word|
match = ''
initial_match.length.times do |letter|

Choose a reason for hiding this comment

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

These two loops seem to do the roughly same thing.

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