Skip to content

Erroneous result in longestCommonSubstring #1

@ArnaudPel

Description

@ArnaudPel

Here is a test case for longestCommonSubstring, currently failing in version 1.0.20

longestCommonSubstring(["abc - 48h", "abc - 108h", "abc - 168h"])
=> '8h', which is wrong

As a simple demonstration that something is fundamentally wrong, is that simply appending one more string to the aformentioned arguments makes the function return a longer common substring, which defies any logic I've got.

longestCommonSubstring(["abc - 48h", "abc - 108h", "abc - 168h", "abc - 228h"])
=> 'abc - ', looks good to me

Many thanks

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions