what was wrong in my code i am getting the result shown below.please see the code link below
TESTCASE # 1 : correct (Time: 0 s)
TESTCASE # 2 : correct (Time: 0 s)
TESTCASE # 3 : wrong-answer (Time: 0 s)
Optimal Game Strategy-Iproblem
and please provide me some faster way to contact you. here we can’t do anything
hi piyush
in this you are suppossed to form the most optimal answers considering all the cases not using the if-else
form the answer by considering all the possible options and then computing the maximum
1)There are two choices:
- The user chooses the ith coin with value Vi: The opponent either chooses (i+1)th coin or jth coin. The opponent intends to choose the coin which leaves the user with minimum value.
i.e. The user can collect the value Vi + min(F(i+2, j), F(i+1, j-1) )
2)The user chooses the jth coin with value Vj: The opponent either chooses ith coin or (j-1)th coin. The opponent intends to choose the coin which leaves the user with minimum value.
i.e. The user can collect the value Vj + min(F(i+1, j-1), F(i, j-2