Driven Program
int main ( ) { char S [ ] = " geeksforgeeks " ; int len = strlen ( S ) ; int mat [ MAX ] [ CHAR_SIZE ] ; precompute ( mat , S , len ) ; query ( mat , " gg " , len ) ? cout << " Yes STRNEWLINE " : cout << " No STRNEWLINE " ; query ( mat , " gro " , len ) ? cout << " Yes STRNEWLINE " : cout << " No STRNEWLINE " ; query ( mat , " gfg " , len ) ? cout << " Yes STRNEWLINE " : cout << " No STRNEWLINE " ; query ( mat , " orf " , len ) ? cout << " Yes STRNEWLINE " : cout << " No STRNEWLINE " ; return 0 ; }