Question: In a previous problem, we considered a hopping game where you can hop 1, 2, 3, or 4 spaces forward and spaces are marked either

In a previous problem, we considered a hopping game where you can hop 1, 2, 3, or 4 spaces forward and spaces are marked either Oor X (where is safe and X is an obstacle which makes you lose the game.) Now let's say that some of the spaces have cash bags which you can pick up when you land on it. More precisely, each space i has a value v; which is either -o or non-negative where the values have the following meaning: v; = -00: This space has an obstacle which makes you lose v; = 0: This space is safe but offers no reward v; > 0: This space has a cash bag with value vi You are incentivized to pick up cash but, as a complication, this time you have a limited number m of steps (given as part of the input, where m
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
