Frequal
An array $A$ of length $N$ is called *frequal* if, for each $i$ ($1 \leq i \leq N$), the frequency of $A_i$ equals the number of its positive divisors. For example, $[2, 8, 1, 8, 8, 8, 2]$ is a *frequal* array ($1$ has one divisor, $2$ has two divisors, and $8$ has four divisors), while $[10, 4, 10, 4, 4, 10]$ is not ($10$ has four divisors but appears only three times in the array). Let $f(A)$
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.
Sign in to chat with the tutor and save your progress.
Sign in to start