Digest of DP solution
Conclusion\nStrategy of Alice and Bob is the same, so they can share the same DP.\n\n## Definition\ndp[i][j] := max diff of score of A if stones[i:j] can be cho
## Conclusion\nStrategy of Alice and Bob is the same, so they can share the same DP.\n\n## Definition\ndp[i][j] := max diff of score of A if stones[i:j] can be chose by A firstly.\n\n## Explanation\n\n```\ndp[i][j] = max(Alice_score_[i,j] - Bob_score_[i,j]) // *1 (use later).\n  // This is Alice\'s turn,because "Alice want to maximize the difference".\n  // dp[i][j] is always non-negative by optimal choose, because all elements of stones is positive.\n= sum[i+1:j] + max(Alice_score_[i+1,j] - Bob_score_[i+1,j]) // Suppose i-th is chosen by Alice.\n= sum[i+1:j] - max(Bob_score_[i+1,j] - Alice_score_[i+1,j])\n= sum[i+1:j] - dp[i+1][j] // By *1. \n// dp[i+1][j] represents Bob\'s turn.\n// Because if Bob maximize dp[i+1][j], then "Bob can minimize the score\'s difference".\n```\n
['Dynamic Programming', 'Memoization']