Maximum Sub-sequence Product |
Bob needs money, and since he knows you are here, he decided to gamble intelligently. The game is rather simple: each player gets a sequence of integers. The players must determine, by using their mega-pocket computers, which is the maximum product value which can be computed with non empty sub-sequences of consecutive numbers from the given sequence. The winner is the one which gets first the right result.
Can you help Bob with a program to compute quickly the wanted product,
particularly when the sequence is quite long ?
1 2 3 -999999 -5 -2 2 -30 -999999 -8 -999999 -1 0 -2 -999999
6 120 -8 0