Available question text
Compute the sum over all contiguous subarrays of (minimum element × sum of elements), which requires attributing each element’s contribution when it is the subarray minimum and aggregating many subarray sums efficiently. The typical solution uses a monotonic stack to find ranges where each element is the minimum combined with prefix-sum / prefix-of-prefix tricks to accumulate sums modulo 1e9+7.
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
Amazon
Leetcode 2281. Sum of Total Strength of Wizards
Reported Jun 22, 2026 · 1 source report
MID_LEVEL
Source snapshot: Nov 12, 2026
View source