We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
- Flipping bits
- Discussions
Flipping bits
Flipping bits
Sort by
recency
|
356 Discussions
|
Please Login in order to post a comment
Definitely less elegant than other solutions, but for my fellow beginners:
In Python 3:
in python:
def flippingBits(n): return 2**32-n-1
Is long as input/output in the C version expected? It should probably be uint32_t to match spec.
JAVA solution: