Skip to content

Bug in LCP code for empty string testcase #215

@killacoug9

Description

@killacoug9

In the LCP code in file "cpp\strings\suffix-array.cpp" there is no handling of empty string (edge case) causing the following error
"""
terminate called after throwing an instance of 'std::length_error'
what(): cannot create std::vector larger than max_size()
"""
Can be fixed by a simple "if" check before vector allocation. I will create a PR with this fix.

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