Reng v.3.2, 88 bytes
(Noncompeting, postdates question.)
2#y2#z"a"1Ø Ø3r1\
:1+>y1-?!v$z1+:#y#zRzeq!^
^ :y#<
i sve(*?v)
?~n>$ 2.>076**
This is one heckuvan answer.
Initial
2#y2#z"a"1Ø
Stores 2 to y
(the temporary counter) and z
(the overall counter), and initiates the stack with "a"
then goes to the next line.
Loop
:1+>y1-?!v$z1+:#y#zRzeq!^
^ :y#<
First, :1+
duplicates the previously made run of characters and increments it to work with the next one. Then...
Generating N copies of a number
>y1-?!v
^ :y#<
This loops until y == 0
. Once y
is zero, we exit the loop. Otherwise, we put y - 1
back into y
and duplicate the character being worked with it.
Breaking out of this loop
$z1+:#y#zRzeq!^
This drops y
from the conditional and increments and duplicates z
, which is then put into y and z. Then, if R
(26 + 1) is z
, we go to the next part. Otherwise, the loop continues again.
Transition
Ø3r1\
^
This goes out of the loop, pushes 1
(our equality counter), reverses the stack, and goes to the third line.
Final
i sve(*?v)
?~n>$ 2.>076**
i sve(*?v)
loops until (a) there is no input or (b) the equality counter is 0. In the first case, the first v
is met, and we drop the -1 bit, skip over the >0
bit (2.
), and output 42 (6*7*equality
), skipping ~
with a conditional. Otherwise, the second v
is encountered, and a zero is pushed before the 76**
, so this makes it zero. The conditional activates the ~
(exit program) command because the TOS is falsey, and thus no output is given.
abbcccddddeeeee...zzabc
does not satisfy that i suppose and i can see some programs giving yes on that input. \$\endgroup\$