Practice The Number of Good Subsets
Read the task, work through the examples, and check your approach against the constraints. Use the original LeetCode task for coding and submissions.
The Number of Good Subsets
Problem Statement
You are given an integer array nums. We call a subset of nums good if its product can be represented as a product of one or more distinct prime numbers. Return the number of different good subsets in nums modulo 10^9 + 7. A subset of nums is any array that can be obtained by deleting some (possibly none or all) elements from nums. Two subsets are different if and only if the chosen indices to delete are different.
Source: The Number of Good Subsets on LeetCode. Use the original task for its coding environment and submissions.
Examples
# Example 1
nums = [1,2,3,4]
6
# Example 2
nums = [4,2,3,15]
5
Constraints
Related LeetCode Problems
Practice more problems similar to The Number of Good Subsets.
Review your practice with PhantomCodeAI
After trying the problem yourself, use the app to discuss your approach, complexity, and edge cases.