Skip to content

Comments

Leaves- Natalie Tapias#23

Open
NatalieTapias wants to merge 3 commits intoAda-C12:masterfrom
NatalieTapias:master
Open

Leaves- Natalie Tapias#23
NatalieTapias wants to merge 3 commits intoAda-C12:masterfrom
NatalieTapias:master

Conversation

@NatalieTapias
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 works well, nice work. See my note on the time complexity. For the other I left a note about where I think you started to get off track.

Overall, not bad!

@@ -1,13 +1,45 @@
require "pry"
# Time Complexity: ? O(n) where n corresponds with the length of input array

Choose a reason for hiding this comment

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

Since delete_at shifts all subsequent elements over one index, the time complexity of delete_at is O(n) and so your method is O(n2).


strings.each_with_index do |string, i|

return a if string[i][j] != collection_of_letters

Choose a reason for hiding this comment

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

I think you mean string[j] != collection_of_letters[j] here

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