You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.