Optimal game strategy -1 (recursion)

https://ide.codingblocks.com/s/83688 my code is passing only 1 test case. please help me to correct the code. thank you.

F(i, j) represents the maximum value the user can collect from
i’th coin to j’th coin.

F(i, j)  = Max(Vi + min(F(i+2, j), F(i+1, j-1) ), 
               Vj + min(F(i+1, j-1), F(i, j-2) )) 

Base Cases
F(i, j) = Vi If j == i
F(i, j) = max(Vi, Vj) If j == i+1

you have to optimally calculate answers for both the cases and then calculate the maximum of both.