Extracted text: Example 1: input1: 5 input2: (-2, 3, -1, -4, -2) Output: 8 Explanation: Since Fred can flip consecutive cards only once, he chooses to flip the last three which results in the maximum sum (-2 +3 +1 + 4 +2), i.e., 8. Therefore, 8 is returned as the output. Example 2: put1: 5 input2: (-1, 2, 3, 4, -5} Output: 13 Explanation: Since Fred can flip consecutive cards only once, he chooses to flip the last card, results in the maximum sum (-1 +2 + 3 +4 +5), i.e., 13. Therefore, 13 is returned as the output.
Extracted text: How to attempt? Question: The Card Game One day, Fred and his N friends were playing a card game in which each player throws a card with a number written on it. The cards are such that a number X is written on front of the card, and fthe negative of that number is written on the back side of the card. This game has the following rules: - Each of the N players is asked to throw a card. After all the N cards are thrown, Fred has to flip one or more cards in conseculive order, only once. Your lask is to help Fred flip the cards in such a way that the sum of the numbers, on front face of the cards, is the maximym. Input Specification: Input1: An integer N denoting the number of cards (1 <= n="">=><= 500)="" input2:="" an="" integer="" array="" containingn="" integers,="" where="" the="" ith="" integer="" denotes="" the="" value="" on="" the="" front="" of="" the="" card="">=><=>=><= 1000)="" output="" specification:="" return="" the="" maximum="" sum="" of="" the="" numbers,="" on="" the="" front="" of="" the="" cards="" example="">=>