Halloween Array
There is an array of $N$ integers, and a range $[L, R]$. Let $f(A) = \prod_{1 \le i < j \le N} (A_i \oplus A_j)$. Informally, $f(A)$ is the product of all pairwise XOR's of the array $A$. If the resulting value lies between $L$ and $R$ (both inclusive), we call such an array a **Halloween array**. Given an array, determine whether it is a **Halloween array** or not. Print $\text{YES}$ or $\text
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