|
|
back to boardCan any one tell me how to solve this problem using greedy approach pls..? Initially values till max=0 are reachable. If next coin is higher than max+1, then the answer is max+1. Otherwise max is boosted by its value (that is, values 0...max+ai are reachable). Proceed until you find a hole or you run out of coins. |
|
|