Flip All Bits

A number can be viewed as a row of 32 zeroes and ones. The function flipping_bits receives an integer n in the range from 0 to 2^32 - 1. Replace every bit with its opposite: 0 becomes 1, and 1 becomes 0. Return the decimal value of the resulting number.

Примеры

Ввод
2147483647
Вывод
2147483648
Ввод
1
Вывод
4294967294
Ввод
0
Вывод
4294967295

Нужно реализовать

def flipping_bits(n: int) -> int:

Теги

math
PostgreSQLv16

Čia bus kodo vykdymo rezultatas

Visible tests
1
Input
2147483647
Expected2147483648
2
Input
1
Expected4294967294
3
Input
0
Expected4294967295
4
Input
4294967295
Expected0
5
Input
100
Expected4294967195
6
Input
999999
Expected4293967296
Focus radio
Paused · SomaFM · Fluid