The Number of Good Subsets

Count subsets whose product can be expressed as a product of distinct primes. Since nums[i] ≤ 30, only 10 primes matter — use bitmask DP where each mask represents which primes are included. Numbers with repeated prime factors are invalid.

Examples
Input: [1,2,3,4]
Output: 6
Hints

The Number of Good Subsets

Count subsets whose product can be expressed as a product of distinct primes. Since `nums[i] ≤ 30`, only 10 primes matter — use bitmask DP where each mask represents which primes are included. Numbers with repeated prime factors are invalid.