Your Dashboard
Interview Coaching
Learn
System Design
ML System Design
Code
Behavioral
Salary Negotiation
Interview Guides
Search
⌘K
Get Premium
Leetcode 891. Sum of Subsequence Widths
Compute the sum of (max - min) over all non-empty subsequences modulo 1e9+7; the core idea is to sort the array and use combinatorics: each element's contribution as possible maximum vs minimum can be counted by powers of two, avoiding enumerating subsequences.
Question Timeline
See when this question was last asked and where, including any notes left by other candidates.
All Regions
Comments
Hello Interview Premium
Your account is free and you can post anonymously if you choose.