
Sponsored
Sponsored
Use these hints if you're stuck. Try solving on your own first.
Do not multiply all the numbers together, as the product is too big to store.
Think about how each individual number's prime factors contribute to the prime factors of the product of the entire array.
Find the prime factors of each element in nums, and store all of them in a set to avoid duplicates.