Implement strStr().
Returns the index of the first occurrence of needle in haystack, or -1 if needle is not part of haystack.
方法1
直接用string自带的函数
return s.indexOf(t);
Implement strStr().
Returns the index of the first occurrence of needle in haystack, or -1 if needle is not part of haystack.
方法1
直接用string自带的函数
return s.indexOf(t);
本文标题:28. Implement strStr()
本文链接:https://www.haomeiwen.com/subject/msdyextx.html
网友评论