Add the second algorithm for maximum product problem