Available question text
Find the maximum-sum non-empty subsequence of nums such that consecutive chosen indices differ by at most k. This is a DP problem where dp[i] = nums[i] + max(0, max dp[j] for j in [i-k, i-1]), typically solved efficiently by maintaining a sliding-window maximum (monotonic deque) for n up to 1e5.
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 1425. Constrained Subsequence Sum
Reported date not specified · 0 source reports
Source snapshot: Nov 12, 2026
View source