You are given an array of integers.
Your task is to determine whether any value appears a prime number of times within the array.
The "frequency" of a number refers to how many times it appears in the array.
A number is considered prime if it is greater than 1 and has exactly two divisors: 1 and itself.
Return true if at least one element occurs a prime number of times; otherwise, return false.
Input: nums = [5,5,6,6,6,7]
Output: true
Explanation:
Number 6 appears 3 times → 3 is prime.
Input: nums = [10,20,30,40]
Output: false
Explanation:
Each number appears exactly once. Frequency = 1 → not prime.
Input: nums = [3,3,3,3]
Output: false
Explanation:
3 appears 4 times → 4 is not prime.
Accepted:
Submission: