Fun With Xor
CodeChefOpen on judge ↗
Problem description. This is an easy question, you just have to find the all the subset of given array. Do XOR of all the subsets(Except Null) and add them. Since the answer can be very large print answer % 10^9 +7. For example: n=2 , given array= {a1,a2} all subsets(Except Null)={{a1},{a2},{a1,a2}} output=( a1+a2+(a1 ⊕ a2) ) % 1000000007 Note: ⊕ stands for XOR. Constraints 1≤ T ≤5 1≤ N ≤10^5
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