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.
defsumXor(n):# So basically, criteria is met when all bits are flipped to 1's for an n xor x #and none are flipped to zeros#Meaning any non-1 in n is an option for x values, fortunately x is never greater than n making#this a lot easierifn==0:return1return2**sum([Trueifi=='0'elseFalseforiinformat(n,'0b')])
Please Login in order to post a comment