The TransCompilator

Solved LeetCode program · 352 of 1,000

#0476 · Number Complement

Easy Bit Manipulation chunk-08.md

Original English source

The value is 5. The mask is 1.
Repeat while mask is at most value.
Set mask to mask times 2.

The flipped is mask minus 1 minus value. Show flipped.

Open in Playground Browse all 1,000 problems

Expected stdout

2