Maximum Value of an Ordered Triplet I
Track the largest prefix value and the largest difference seen so far, so each position can be used as the last index in one pass.
Track the largest prefix value and the largest difference seen so far, so each position can be used as the last index in one pass.