A new pattern: min-max, which is max. the situation good for us and min. the situation bad for us.

In this case, we max. the sum in currently round, and min. the sum in the opposite side.

int a = num[s] + winner(num, s + 1, e, -turn);
int b = num[e] + winner(num, s, e - 1, -turn);

if(turn == -1){
	a = -a;
	b = -b;
}

Error:

  1. do not how to do, we need to use recursion to deal with this.