There is a series of random numbers. The players alternately select a number from either end of the list until all numbers have been selected. The player with the highest sum wins.
The key question is whether each player sees the entire list, a partial list, or just the currently available two numbers. That determines whether you need an
offline (sees everything) or an
online (only sees the values to choose from) algorithm.
A
greedy algorithm takes the option that yields the best immediate result. These are typically only used when it can be mathematically proven that it leads to an optimum or an acceptable solution for all possible inputs, but can also be used to implement "strategically easily beatable" computer opponents.
A
brute force algorithm examines all possible ways the rest of the game could proceed, and chooses the "best" option among those. "Best option" is the one that maximizes/minimizes some scoring criteria; here, it could be the difference in scores for the two players, or perhaps the number of sub-paths where the computer loses.
For learning purposes, you'll want to implement more than two algorithms, with different
strategies, and let each unique pair of algorithms play a set number of randomized games against each other. Record the scores separately based on which algorithm made the first choice, how many rounds it took, and what the difference in scores was. You'll learn a lot about this particular "game" at hand.
To learn how to apply mathematics to find a winning strategy for a player algorithm, look into
combinatorial game theory, and at least initially assuming the players can see all numbers left when making their next choice.