#include #include using namespace std; void findPrefix(string pattern, int m, int prefArray[]) { int i = 0; prefArray[0] = 0; //first place is always 0 as no prefix for(int j = 1; j