← All problemsSign in

1611. Minimum One Bit Operations to Make Integers Zero

LeetCodeMathDynamic ProgrammingBit ManipulationRecursionMemoizationOpen on judge ↗

Given an integer n, you must transform it into 0 using the following operations any number of times: - Change the rightmost (0th) bit in the binary representation of n. - Change the ith bit in the binary representation of n if the (i-1)th bit is set to 1 and the (i-2)th through 0th bits are set to 0. Return the minimum number of operations to transform n into 0. Example 1: Input: n = 3 Outp

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