Uh oh!
There was an error while loading. Please reload this page.
Returning Index instead of boolean in knuth_morris_pratt (kmp) function, making it compatible with str.find(). - #9083
Conversation
rohan472000
commented
Sep 25, 2023
Kindly tick the checkboxes while raising PR, see contributing guidelines beforehand. |
HetarthJain
commented
Sep 25, 2023
I have ticked the appropriate checkboxes. |
HetarthJain
commented
Sep 25, 2023
Please review the Pull request |
rohan472000
commented
Sep 25, 2023
#9079 is also doing the same, check that first. |
rohan472000
commented
Sep 25, 2023
Also keep your PR title descriptive, remove 9077 and add kmp in it, as viewers can understand easily. |
rohan472000
commented
Sep 25, 2023
Meanwhile, @HetarthJain you can look into that doctest which is failing in #9079. |
HetarthJain
commented
Sep 25, 2023
I have used the doctest in the commit itself, it has passed. Please review it. |
Add these doctests there in kmp() function: Run: |
rohan472000
commented
Sep 26, 2023
@cclauss kindly have a look at this PR, your doctest for |
Uh oh!
There was an error while loading. Please reload this page.
cclauss
left a comment
There was a problem hiding this comment.
I had to add doctests because this PR had none.
HetarthJain
commented
Sep 29, 2023
Thanks @cclauss and @rohan472000 for your guidance in my first PR |
Describe your change:
Returning the index of first occurrence of a match in knuth_morris_pratt algorithm. The return type is converted from boolean to int. The function name parameters are aligned to Python naming conventions.
Fixes#9077
Checklist: