diff --git a/Strings/slides/busca/busca.pdf b/Strings/slides/busca/busca.pdf index 847fea87..706b3509 100644 Binary files a/Strings/slides/busca/busca.pdf and b/Strings/slides/busca/busca.pdf differ diff --git a/Strings/slides/busca/codes/search.cpp b/Strings/slides/busca/codes/search.cpp index 438edd2a..7bdde721 100644 --- a/Strings/slides/busca/codes/search.cpp +++ b/Strings/slides/busca/codes/search.cpp @@ -4,7 +4,7 @@ int occurrences(const string& P, const string& S) int n = S.size(); int occ = 0; - for (int i = 0; i <= n - m + 1; ++i) + for (int i = 0; i < n - m + 1; ++i) occ += (P == S.substr(i, m) ? 1 : 0); return occ;