The solution uses three steps to transform the unary number:
Decrementing a unary number by one
The unary number can be decremented by one by simply removing the leftmost one.
Incrementing a binary number by one
To increment a binary number, every one is replaced by a zero starting from the right. This is done until the first zero is reached. This zero is then replaced by a one.