← All problemsSign in

Z-OR Value

You are given an array of size 'N'. Lets define a Z-OR value of three indexs ,'i' , 'j' , 'k' as (a[i] | a[j] | a[k]) ^ (a[i] ^ a[j] ^ a[k]) where i < j < k. Here, | represents BITWISE OR and ^ represents BITWISE XOR. You are asked to find the sum of Z-OR value of all possible combination of indexes **modulo 1e9 + 7**. ### Input - The first line contains single integer 'N' i.e. number of ele

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