Here is the solution:
function brokenCalc(X, Y)
ops := 0
while Y > X
if Y % 2 = 0 then
Y := Y / 2
else
Y := Y + 1
ops := ops + 1
return ops + (X - Y)
Time: . Space: .
Once , you cannot halve anymore (would go below ). Just add the difference.