
Implement strStr()
Implement strStr(). Return the index of the first occurrence of needle in haystack, or -1 if needle is not part of haystack.
(实现寻找字符串子串函数)
Example:

1. 遍历 – easy
1 |
class : |
2. 调用 python 库函数 in, index
1 |
class : |

Implement strStr(). Return the index of the first occurrence of needle in haystack, or -1 if needle is not part of haystack.
(实现寻找字符串子串函数)
Example:

1 |
class : |
1 |
class : |
近期评论