← All problemsSign in

WIZARD AND ARRAYS

Wizard has an array of integers named a. He has to find out the bitwise-AND of all the pairs of elements of the array. Before carrying out the operation, he wants to make sure that he has just enough bits to store the answer of the AND operations. Can you help Wizard in finding the $minimum$ number of bits that he needs to have to store the answer of the $bitwise-AND$ of any two numbers of the 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.

voice by Sarvam AI

Sign in to chat with the tutor and save your progress.

Sign in to start