I would like some advice in this homework question. There is a three players game, in which each player ($A, B$, and $C$) is given a $n$-length array of integer values. There are $n$ rounds in this game. At every $i$-th round the players have to choose one value among $A[i]$, $B[i]$ and $C[i]$, which is going to be the score they will get in that round. Considering that the players cannot choose the same array consecutively, how should the players choose the optimal array combination that leads to the highest total score (sum of the scores they get at each round)?
So far I've come up with the solution of selecting at each round the highest possible value among $A[i]$, $B[i]$ and $C[i]$, but this takes $O(n^2)$. I also thought about setting the problem in matrix form to apply linear programming, something like $\max_{x} \sum b_{i,j}(x)$ such that $Ax = b$, where $A$ is a $n\times 3$ matrix (where the columns are the arrays $A, B$ and $C$), and $x$ is a $3 \times n$ matrix of 0's and 1's, but I'm not sure of this approach.