Your Dashboard
Interview Coaching
Learn
System Design
ML System Design
Code
Behavioral
Salary Negotiation
Interview Guides
Search
⌘K
Get Premium
Leetcode 1499. Max Value of Equation
Given points sorted by x, find the maximum value of yi + yj + |xi - xj| for pairs with |xi - xj| ≤ k. Transforming the expression to (yi - xi) + (yj + xj) for i < j shows you must efficiently maintain the maximum (yi - xi) among prior points within an x-distance k to evaluate each j.
Question Timeline
See when this question was last asked and where, including any notes left by other candidates.
All Regions
Comments
Hello Interview Premium
Your account is free and you can post anonymously if you choose.