Need hint for the recursive case
Question link: https://hack.codingblocks.com/contests/c/537/428?_ga=2.54245032.1219077042.1548160977-379579604.1543847184
Optimal game strategy-1
Hey, you can simply think it as if we sort the array, then max value will be at the end, so we can get max coins as coins[end] + get_max_coins(start, end-2), as coins[end-1] will be picked by the opponent so we can get the max coins from start to end-2 using the recursive function get_max_coins(start, end-2).
1 Like