Now, Hedge can take one more pass to calculate how much energy there will be above every stack with the same equation from before: take the smaller of the stored left and right values, and subtract the height of the current tower.