You and your best friend is playing a game. The game has n stages, each stage can add or deduct points from your score. You and your friend take turns playing the game, starting with your friend. Each person must play exactly 1, 2, or 3 stages on their turn (you cannot skip your turn). Your goal is to design a dynamic programming algorithm to find the maximum number of points you can earn. You can assume that your friend is helping you maximize your score.
Required:
Design a dynamic programming algorithm that returns the minimum number of times your friend has to use the cheat code.