← All problemsSign in

Power of Two

You have given two numbers $X$ and $Y$. You have to convert $X$ into $Y$. In one operation You are allowed to add any number which is power of two in $X$. You have to print the $minimum$ number of operations required to convert $X$ into $Y$ or print $-1$ if it is impossible to convert $X$ into $Y$. $Note:-$ $2^0, 2^1, 2^2, 2^3,.....$ Are called power of two. ###Input: - First line will c

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