Welcome to part 8 of this series, in case you have missed part 7, here is the link: Part 7
There is a list of n numbers and two players who move alternately. On each move, a player removes either the first or last number from the list, and their score increases by that number. Both players try to maximize their scores.
What is the maximum possible score for the first player when both players play optimally?
Problem Link: https://cses.fi/problemset/task/1097
The first input line contains an integer n: the size of the list.
The next line has…