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 #172

Merged
merged 2 commits into from
Feb 20, 2024

Conversation

GHTaarn
Copy link
Contributor

@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 longest_common_prefix(["abc"]) == "abc"
@test longest_common_prefix(["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
@findmyway findmyway merged commit e5daa11 into JuliaCN:master Feb 20, 2024
1 check passed
@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.

2 participants