Available question text
Find the length of the longest subsequence of nums whose consecutive elements have the same difference (i.e., form an arithmetic progression). With n up to 1000, this is typically solved by pairwise dynamic programming that tracks, for each index and difference, the longest arithmetic subsequence ending there (O(n^2) time).
Related questions
Continue with questions that share topics or the same question type.
Sources · 1 reference
These records explain where the question appears. A company tag or candidate report does not guarantee a future interview question.
Hello Interview · 1 record
No company association
Leetcode 1027. Longest Arithmetic Subsequence
Reported date not specified · 0 source reports
Source snapshot: Nov 12, 2026
View source