Search
⌘K

Leetcode 1994. The Number of Good Subsets

Count the subsets of nums whose product is a product of distinct primes (i.e., square-free with no repeated prime factors), modulo 1e9+7. With nums length up to 1e5 and values ≤30, the core challenge is using frequency compression and bitmask DP over the ≤10 primes ≤30 (treating 1s multiplicatively).


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.