Given a string of size T, a pattern of size P and an integer k, calculate how many times P appears in T with at most k mismatches.
This problem is solved through convolutions and the Fourier Transform from complex analysis. The idea is to fix a letter c and write two complex polynomials: one that is the size of the string and one the size of the pattern. By multiplying the Fourier Transforms of the polynomials and then reversing the Transform, we're able to calculate the convolution of a polynomial f. Through the convolution, we can do approximate pattern matching in O(alphabet*NlogN) time with N <= n + m, while a naive approach would result in O(n * m).