← All problemsSign in

Lucky and Arrays

Lucky has an array of N elements [a1, a2, a3, ....,an]. Bunny decided to play a game with the array. So he gave another array which have N elements [b1, b2, b3, ...., bn] and ask her to find the minimum number of bits required to change ai to bi. Let's consider ai = 4 and bi = 3 binary values of 4 and 3 are 100 and 011, we need 3 bits to change 4 to 3. She needs your help to solve this problem.

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