Skip to content

Commit

Permalink
调用库函数
Browse files Browse the repository at this point in the history
  • Loading branch information
rinwf committed Sep 25, 2018
1 parent 23c2507 commit 2a23fef
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions lc28. Implement strStr().cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
class Solution {
public:
int strStr(string haystack, string needle) {
int res=haystack.find(needle);
if (res == std::string::npos) {
return -1;
}
else{
return res;
}

}
};

0 comments on commit 2a23fef

Please sign in to comment.