Relative Content

Tag Archive for javaalgorithmdynamic-programming

Number of jumps to reach the end (with updates)

We are given N squares number 0 to N – 1. Each square has target jump square J[i] (which must be at a larger index). At square i, you can only jump to square J[i]. If J[i] is past the last square, then you are done.

Minimum jumps to reach the end (with updates)

We are given N squares number 0 to N – 1. Each square has target jump square J[i] (which must be at a larger index). At square i, you can only jump to square J[i]. If J[i] is past the last square, then you are done.