Answer: Take an example,
First, it is clear that we process string right to left.
For case 1: it is clear that we only change LSB 0 to 1 and keep the other bit same.
But case 2: if LSB contains 1 then, keep all 1 from LSB is changed to 0, change first 0 to 1 and keep remaining bit same.