+ 4
[MindTeaser]🏆 Flip a binary number
🎯 Just replace the 0 with 1 and vice-versa Input : 0101100101 Output: 1010011010
5 odpowiedzi
+ 7
[print(1-int(i),end='') for i in input()]
+ 1
Here's my try.
https://code.sololearn.com/cyi24IX079ua/?ref=app
+ 1
A purely mathematical solution: Find the smallest power of two, which is bigger than the input and subtract (input+1) from it.