Search
⌘K

Leetcode 2902. Count of Sub-Multisets With Bounded Sum

Count the number of sub-multisets (you may take each value 0..occurrence times) whose element sum lies in [l, r], returning the result modulo 1e9+7. Algorithmically this is a bounded subset-sum/counting problem (bounded knapsack) with total sum ≤ 2·10^4, making DP or generating-function techniques appropriate.


Question Timeline

See when this question was last asked and where, including any notes left by other candidates.

Comments

Your account is free and you can post anonymously if you choose.