SP18297 CODEM4 - Problem4
Description
"Roadies" is back!!! In India,"Roadies" is a reality based tv show and is very popular among the youth.
This time to get selected into "Roadies" they challenge you to solve the given problem....if you can solve it you will be selected!
Challenge is as follows: Suppose you are given an array with even number of integers.Player 1 and player 2 take turns to pick numbers,either the leftmost element or the rightmost element.You have to find the maximum possible score (sum of numbers chosen) by player 1.Assume player1 always starts the game and plays optimally.
**Note**:when an element is picked it is removed from the array.
But as usual this is "Roadies" hence cometh the twist.It is not known whether the second player plays like a dumb or smart.As you know result will be different if player 2 is either dumb or smart.
**NOTE:** when player 2 plays like a dumb there is no fixed strategy of how he would choose the numbers i.e he would choose the number either from start or end of an array without thinking...so there can be multiple answers possible when player 2 plays like a dumb...
**So you have to tell the maximum possible score of player 1 when player 2 plays like a dumb and smart.**
**Input description:**
**T:no of test cases(t
Input Format
N/A
Output Format
N/A