[LeetCode] 28. Implement strStr()

来源:互联网 发布:语音广告制作软件 编辑:程序博客网 时间:2024/05/18 01:44

Implement strStr().

Returns the index of the first occurrence of needle in haystack, or -1 if needle is not part of haystack.

class Solution {public:    int strStr(string haystack, string needle) {        return haystack.find(needle);    }};
原创粉丝点击