checking for saturation of string after repetitive addition
while ( n2 != 0 ) : NEW_LINE INDENT for i in range ( Len ) : NEW_LINE INDENT if ( k [ i ] == " a " ) : NEW_LINE INDENT a += 1 NEW_LINE DEDENT if ( k [ i ] == " b " ) : NEW_LINE INDENT b += 1 NEW_LINE DEDENT if ( a > b ) : NEW_LINE INDENT count2 += 1 NEW_LINE DEDENT DEDENT count += count2 NEW_LINE n2 -= 1 NEW_LINE if ( count2 == 0 ) : NEW_LINE INDENT break NEW_LINE DEDENT if ( count2 == Len ) : NEW_LINE INDENT count += ( n2 * count2 ) NEW_LINE break NEW_LINE DEDENT count2 = 0 NEW_LINE DEDENT return count NEW_LINE