GET THE SUM
CodeChefOpen on judge ↗
Chef and Bob are friends. They wanted to play a game. Bob chooses $N$ numbers and xor all the chosen numbers with the $power$ $of$ $2$ $which$ $is$ $strictly$ $greater$ $than$ $any$ $of$ $the$ $N$ $chosen$ $numbers$ (For eg. if N=4, and chosen numbers are [3, 4, 3, 9], then power of 2 must be greater than 9) and adds all the modified numbers in variable S. To win the game, Chef has to find the sum
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