Fast Fourier Transform, Algorithms, Pattern Matching, Convolution, Combination Sum.
q_coefficients, round_decimal=5) output = [] for j in range(len(c)): if j+len(pat)-1 < len(c) and c[j+len(pat)-1] == len(pat): output += [j] return output Note that we are not rounding c values to the nearest integer because here c need not be integers for all, instead we are rounding c to the 5th