Function to find the next greater number with same number of 1 ' s ▁ and ▁ 0' s
def nextGreaterWithSameDigits ( bnum ) : NEW_LINE INDENT l = len ( bnum ) NEW_LINE bnum = list ( bnum ) NEW_LINE for i in range ( l - 2 , 0 , - 1 ) : NEW_LINE DEDENT