Solved and code is very light and simplistic, find if i missed anything


#1
int Solution::maxcoin(vector<int> &A) {
    vector<vector<int>> dp(A.size(),vector<int>(A.size(),0));
    for(int i=A.size()-1;i>=0;i--){
        for(int j=i+1;j<A.size();j++){
            if((j-i+1)%2==0)
                dp[i][j] = max(A[i]+dp[i+1][j],A[j]+dp[i][j-1]);
            else{
                dp[i][j] = min(dp[i+1][j],dp[i][j-1]);
            }
        }
    }
    return dp[0][A.size()-1];
}

everybody welcome to find the loopholes or cases i missed. but iB accepted this.