Sponsored
Use these hints if you're stuck. Try solving on your own first.
You can precompute number of operations required to convert a number with <code>x</code> bits to 1.
Use digit dp.
Solve with full IDE support and test cases