solve 3rd problem (reversed binary representation)