Fast Fourier Transform, Algorithms, Pattern Matching, Convolution, Combination Sum.
sequence T in reverse. Now when we multiply S(x) with T(x), the coefficient of x^(j+m-1) is calculated to be: If S[j+k] = T[k] in the above equation for some k i.e. the k-th letter in T is equal to the j+k th letter in S, we have: If for all k=0 to m-1, S[j+k] = T[k] i.e. T is a substring of S,