All topics are available in five languages. C implementation directory , C++ implementation directory , Python implementation directory , Java implementation directory , JavaScript implementation directory
topic
Given the number of n cards, between -100 and 100, find the maximum score.
The rules are as follows: continuous flop, if you choose the current card, the total score is equal to the total score of the last flop plus the number of the current card,
If the current total score is less than its previous three total scores, then there is no flop this time, and the total score is equal to its previous three scores.
If the number of flops from 1 to 3 is less than 0, take 0.
example:
1,-5,-6,4,7,2,-2