Tap here to switch tabs
Problem
Submissions

Problem: Distinct Prime Factors of Product of Array

med
30 min
Try to solve the Distinct Prime Factors of Product of Array problem.

Statement

Given an array of positive integers nums, return the number of distinct prime factors present in the product of all elements of nums.

Note: A prime number is a positive integer greater than 11 that has no positive divisors other than 11 and itself. An integer is a prime factor of a number if it is a prime number that divides that number completely.

Constraints:

  • 1≤1 \leq nums.length ≤104\leq 10^4

  • 2≤2 \leq nums[i] ≤1000\leq 1000

⋮
Tap here to switch tabs
Problem
Submissions

Problem: Distinct Prime Factors of Product of Array

med
30 min
Try to solve the Distinct Prime Factors of Product of Array problem.

Statement

Given an array of positive integers nums, return the number of distinct prime factors present in the product of all elements of nums.

Note: A prime number is a positive integer greater than 11 that has no positive divisors other than 11 and itself. An integer is a prime factor of a number if it is a prime number that divides that number completely.

Constraints:

  • 1≤1 \leq nums.length ≤104\leq 10^4

  • 2≤2 \leq nums[i] ≤1000\leq 1000