← All problemsSign in

2521. Distinct Prime Factors of Product of Array

LeetCodeArrayHash TableMathNumber TheoryOpen on judge ↗

Given an array of positive integers nums, return the number of distinct prime factors in the product of the elements of nums. Note that: - A number greater than 1 is called prime if it is divisible by only 1 and itself. - An integer val1 is a factor of another integer val2 if val2 / val1 is an integer. Example 1: Input: nums = [2,4,3,7,10,6] Output: 4 Explanation: The product of all the ele

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