Fast Fourier Transform, Algorithms, Pattern Matching, Convolution, Combination Sum.
for each digit. Add all the results of multiplications. The time complexity of multiply 2 integers each with N digits is O(N²). For very large integers i.e. N > O(10⁶), the multiplication is infeasible. For the moment assume that the computer hardware is capable of representing an integer of 10¹²