# Code

Solution of problem 476 is showed below. You can also find it here.

My solution

1 | class Solution { |

A solution on Leetcode:

1 | class Solution { |

# Solution

This is a simple and easy problem. Just flip each bit and itβs all solved. You can iterate each bit or handle them all together.

# Valueable Method

When seeing this kind of problem, I used to handle each bit and assemble them together. However, vectorize them (create a number and XOR with the original number) is a better way. Also, I ignore the feature that the all 1 bits sequence is the largest number at the sequence length.

Think more and code less all the time.