Given an array of points sorted by x-coordinate and an integer k, find the maximum value of the equation yi + yj + |xi - xj| where |xi - xj| <= k and i < j.
Java
Max Value of Equation
Given an array of points sorted by x-coordinate and an integer k, find the maximum value of the equation yi + yj + |xi - xj| where |xi - xj| <= k and i < j.