The problem Optimal Strategy II is same as Optimal Strategy I, please check into it.
Same version as Optimal Strategy I
Your code is correct and has passed all the test cases.
Yes both Optimal Game Strategy 1 and 2 are same. In 1, you could so that by recursion, but in 2 , DP is required
1 Like