1:40 should check that count != 0, or exists variable should be renamed 6:30 since c++17, std::search can take as an argument a searcher. boyer_moore_searcher is highly optimized and can find a substring match in best case O(m/n) (worst case O(m*n)), where m is the haystack size, n is the needle size. std::string::find is not guaranteed a time complexity but its compiler specific and generally regarded as O(m*n) Thanks for the fantastic series!
1:40 should check that count != 0, or exists variable should be renamed
6:30 since c++17, std::search can take as an argument a searcher. boyer_moore_searcher is highly optimized and can find a substring match in best case O(m/n) (worst case O(m*n)), where m is the haystack size, n is the needle size. std::string::find is not guaranteed a time complexity but its compiler specific and generally regarded as O(m*n)
Thanks for the fantastic series!