Can someone please provide the most optimal solution for the following question asked in one of the coding rounds of Google:
Two players are playing a card game with the following constraints:
1. The deck contains N cards
2. Every card has a value in the range -> -K <= value <= K
Following are the rules of the game:
1. Every player at his/her turn can see values of at most 3 cards from the top of the deck
2. In each turn the player has to pick at least 1 and at max 3 cards
Given the above constraints find the maximum score that Player 1 can make by the end of the game when deck is finished