Available question text
Compute the total sum of elements over all subsequences of nums that are "good" (every pair of consecutive elements in the subsequence has absolute difference 1), returning the result modulo 1e9+7; due to n and value range up to 1e5 this is solved with a DP that accumulates counts/sums per value rather than enumerating subsequences.
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 3351. Sum of Good Subsequences
Interview date not specified · 0 source reports
Source snapshot: Nov 12, 2026
View source