human
Check if a number is Bleak | Function to get no of set bits in binary representation of passed binary no ..
Returns true if n is Bleak.
Check for all numbers ' x ' smaller than n . If x + countSetBits ( x ) becomes n , then n can 't be Bleak..
Driver code"
Solution in Python:
assistant
#Here is code to check if a number is Bleak and the other steps required.
 def countSetBits ( x ) :
	count = 0
	while ( x ) :
		x = x & ( x - 1 )
		count = count + 1
	return count
def isBleak ( n ) :
	for x in range ( 1 , n ) :
		if ( x + countSetBits ( x ) == n ) :
			return False
	return True
if ( isBleak ( 3 ) ) :
	print ( " Yes " )
else :
	print ( " No " )
if ( isBleak ( 4 ) ) :
	print ( " Yes " )
else :
	print ( " No " )