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

Handle trivial input better in 14.longest-common-prefix.jl #1

Closed
wants to merge 2 commits into from

Conversation

GHTaarn
Copy link
Owner

@GHTaarn GHTaarn commented Feb 20, 2024

This change makes the algorithm able to correctly handle cases where there is only one input string or where all input strings are equal.

e.g.

using Test, LeetCode

@test lcp(["abc"]) == "abc"
@test lcp(["abc", "abc"]) == "abc"

This change makes the algorithm able to handle trivial cases where there is only one input string or where all input strings are equal
@GHTaarn
Copy link
Owner Author

GHTaarn commented Feb 20, 2024

Submitted here by error, the corrected version is JuliaCN#172

"master" on the fork should always follow "master" on the original

@GHTaarn GHTaarn closed this Feb 20, 2024
@GHTaarn GHTaarn deleted the GHTaarn-patch-3 branch February 20, 2024 07:31
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.

1 participant