Available question text
Compute the sum over all non-empty subsets of nums of (max(subset)^2 * min(subset)) modulo 1e9+7. With n up to 1e5 you must avoid enumerating subsets and instead use sorting plus combinatorial counting (powers of two) to accumulate each element’s contribution as max/min efficiently.
Related questions
Continue with questions that share topics or the same question type.
- Find the Power of K-Size Subarrays I
Coding
- Find the Power of K-Size Subarrays II
Coding
- Find the Sum of the Power of All Subsequences
Coding
- Lexicographically Largest Power Array
Coding · Array · Bit Manipulation · Greedy
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 2681. Power of Heroes
Interview date not specified · 0 source reports
Source snapshot: Nov 12, 2026
View source