Your Dashboard
Interview Coaching
Learn
System Design
ML System Design
Code
Behavioral
Salary Negotiation
Interview Guides
Search
⌘K
Get Premium
Leetcode 1218. Longest Arithmetic Subsequence of Given Difference
Find the length of the longest subsequence (preserving order) in which consecutive elements differ by a given fixed value. With arr up to 1e5, the core challenge is to compute this efficiently by aggregating the longest arithmetic chain ending at each value (dynamic programming over values).
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.