Stone Game VIII
Alice and Bob play a game. Initially, there are n stones in a line, and each stone has an associated value, represented by an array, stones. The sum of the values of all the stones is sum(stones[0], stones[1], ..., stones[n-1]).
Alice and Bob take turns, with Alice starting first. On each turn, the player removes the first stone remaining in the row, either from the beginning or the end. The value of the removed stone is added to the player's score. The player with the higher score wins, and if the scores are equal, then the game is a draw.
Assuming Alice and Bob play optimally, return the maximum score that Alice can obtain.
I want to discuss a solution
Help me solve this
Give more examples
What's wrong with my code?
How to use 'for loop' in javascript?