← All problemsSign in

3591. Check if Any Element Has Prime Frequency

LeetCodeArrayHash TableMathCountingNumber TheoryOpen on judge ↗

You are given an integer array nums. Return true if the frequency of any element of the array is prime, otherwise, return false. The frequency of an element x is the number of times it occurs in the array. A prime number is a natural number greater than 1 with only two factors, 1 and itself. Example 1: Input: nums = [1,2,3,4,5,4] Output: true Explanation: 4 has a frequency of two, which

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