← All problemsSign in

1994. The Number of Good Subsets

LeetCodeArrayHash TableMathDynamic ProgrammingBit ManipulationCountingOpen on judge ↗

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. - For example, if nums = [1, 2, 3, 4]: - [2, 3], [1, 2, 3], and [1, 3] are good subsets with products 6 = 2*3, 6 = 2*3, and 3 = 3 respectively. - [1, 4] and [4] are not good subsets with products 4 = 2*2 and 4 = 2*2 respectively. Return th

HINT LADDERno hints yet
L1 Observation
L2 Technique
L3 Approach
L4 Pseudo-code
🔒
L5 Full solution
L5 unlocks only if you insist twice
solution.cppC++17

CodeSearch Tutor

Hints, not spoilers — it won’t hand over the full solution unless you insist.

voice by Sarvam AI

Sign in to chat with the tutor and save your progress.

Sign in to start