You are viewing a single comment's thread. Return to all comments →
import math import os import random import re import sys
#
def flippingBits(n): # Write your code here
return n^4294967295
if name == 'main': fptr = open(os.environ['OUTPUT_PATH'], 'w')
q = int(input().strip()) for q_itr in range(q): n = int(input().strip()) result = flippingBits(n) fptr.write(str(result) + '\n') fptr.close()
Seems like cookies are disabled on this browser, please enable them to open this website
Flipping bits
You are viewing a single comment's thread. Return to all comments →
!/bin/python3
import math import os import random import re import sys
#
Complete the 'flippingBits' function below.
#
The function is expected to return a LONG_INTEGER.
The function accepts LONG_INTEGER n as parameter.
#
def flippingBits(n): # Write your code here
if name == 'main': fptr = open(os.environ['OUTPUT_PATH'], 'w')