Leetcode 28. 实现 strStr() python3

python3 find()方法

def strStr(haystack: str, needle: str) -> int:
    return haystack.find(needle)
print(strStr("hello","ll"))
print(strStr("hello","aab"))
print(strStr("hello",""))
原文地址:https://www.cnblogs.com/wrnan/p/12496524.html