function to find the position of rightmost set bit
def getPosOfRightmostSetBit ( n ) : NEW_LINE INDENT return int ( math . log2 ( n & - n ) + 1 ) NEW_LINE DEDENT def setRightmostUnsetBit ( n ) : NEW_LINE