Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Daniela Sanchez - Leaves #45

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

dnsanche
Copy link

Finished, but by some reason the tests stopped working. I had same issue last time with the last project for CS Fundamentals. I couldn't verify if the second exercise passed all tests. :(

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.

Daniela, can you leave your 1st name and class in the PR title.

Your 1st method works, see my note at the end. It's almost perfect except for that one thing. The 2nd method has an infinite loop

end

current = 0
until array_characters.length - 1 < current

Choose a reason for hiding this comment

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

you should also repeat until same is false.

# Time Complexity: ?
# Space Complexity: ?
# Time Complexity: n, as my algorithm needs to iterate through all elements.
# Space Complexity: n, as I'm creating an array to store the characters in each iteration. More elements, longer the new array.
def longest_prefix(strings)

Choose a reason for hiding this comment

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

You're getting stuck in an infinite loop here.

end

# Time Complexity: ?
# Space Complexity: ?
# Time Complexity: n, as my algorithm needs to iterate through all elements.

Choose a reason for hiding this comment

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

I would say it's O(n) if the strings are small and O(m * n) where m is the length of the longest string if they're not.

@dnsanche dnsanche changed the title Finished, but by some reason the minitest stop working Daniela Sanchez - Leaves Sep 19, 2019
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