kmp-cpp: both c++ code and python code does not allow overlapping matches