Problem 2749 · Medium

Minimum Operations to Make the Integer Zero

Try each operation count k: after k operations of subtracting 2^i + num2, the rest must be a sum of exactly k powers of two, which holds when its set-bit count is at most k and it is at least k.

Open the interactive visualisation