Skip to content

Returning index instead of boolean when knuth_morris_pratt matches. #9077

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

Closed
amirsoroush opened this issue Sep 22, 2023 · 2 comments · Fixed by #9083
Closed

Returning index instead of boolean when knuth_morris_pratt matches. #9077

amirsoroush opened this issue Sep 22, 2023 · 2 comments · Fixed by #9083
Labels
enhancement This PR modified some existing files

Comments

@amirsoroush
Copy link
Contributor

amirsoroush commented Sep 22, 2023

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.

@ArhamaQ
Copy link

ArhamaQ commented Sep 25, 2023

Hey, My name is Arhama. I am a beginner in open source contribution. After exploring a couple of hours, this is the first project I have found for myself. and I think i can work on this please assign me this work

@Rathish-Rajendran
Copy link

Hi, I've been following the project closely and I'm keen to tackle this specific issue. With my experience in python, I'm confident I can provide a valuable solution. Please consider assigning this issue to me. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement This PR modified some existing files
Projects
None yet
3 participants