Skip to content

Returning index instead of boolean when knuth_morris_pratt matches. #9077

Closed
@amirsoroush

Description

@amirsoroush

In knuth morris pratt algorithm, I think it's better to return the "index" of the matched substring in case of success, and -1 in case of failure, so that it would be consistent with the str.find() in Python. True and False aren't that helpful.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementThis PR modified some existing files

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions