Available question text
After each point update to an array, compute the maximum sum of a subsequence with no two adjacent elements (i.e., the maximum-weight independent set on a path) and return the sum of all query answers modulo 1e9+7. The challenge is to support up to 5·10^4 updates efficiently by maintaining range DP states (often with a segment tree / 2×2 max-plus matrices) to combine non-adjacent-selection choices in O(log n) per update.
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 3165. Maximum Sum of Subsequence With Non-adjacent Elements
Reported date not specified · 0 source reports
Source snapshot: Nov 12, 2026
View source