Q(Leetcode): Given an array of non-negative integers, you are initially positioned at the first index of the array. Each element in the array represents the maximum permitted jump length from that position.

https://github.com/tiger40490/repo1/blob/py1/py/array/tripleJump.py is my solution, not tested on Leetcode.

==== analysis =====

Typical greedy algorithm. I will jump leftward.

Suppose there are N=99 nodes in the array. I will pre-scan the N nodes to build a shadow array of integer records, each a BestLefNode. (The first record is unused.)

If BestLefNode[44] == 33, it means that based on known data, the left-most (furthest) node we can jump to from Node #44 is Node #33.

When we visit Node #7 during the scan, we will update 0 or more BestLefNode record #8 onward.

As soon as we update BestLefNode[N-1] i.e. right-most record, we exit the initial scan since the optimal solution is now available. For example, if rightmost BestLefNode has value #88, that means the furthest node we can reach from the right end is Node #88, so we will jump to #88 and then check the best destination From #88.