Max power
Given a binary number (of $N$ bits) $X$. Find the highest power of 2 that divides this number. Note: If the binary number is "100" then the highest power of 2 that divides it is 2 (as $2^2$ = 4) Input: - The first line contains N the number of bits in the number - The next line contains a binary number of N bits Output: - The first and only line contains the max power of 2 that divides the gi
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