Subtract the appropriate power of B from it and increment higher digit
elif ( a [ i ] == w or a [ i ] == w - 1 ) : NEW_LINE INDENT a [ i + 1 ] += 1 NEW_LINE DEDENT else : NEW_LINE INDENT flag = False NEW_LINE DEDENT return flag NEW_LINE