Skip to content

Commit c24003f

Browse files
committed
Update implement-strstr.cpp
1 parent bf37e31 commit c24003f

File tree

1 file changed

+0
-4
lines changed

1 file changed

+0
-4
lines changed

C++/implement-strstr.cpp

-4
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,6 @@ class Solution {
5252
class Solution2 {
5353
public:
5454
int strStr(string haystack, string needle) {
55-
if (needle.empty()) {
56-
return 0;
57-
}
58-
5955
for (int i = 0; i + needle.length() < haystack.length() + 1; ++i) {
6056
if (haystack.substr(i, needle.length()) == needle) {
6157
return i;

0 commit comments

Comments
 (0)