Postorder

Score: 49.09 (pass)

Whoops, I was so busy optimising the main regexp that I didn't notice I had s/// instead of s~~~ at the beginning! Tildes are your friends.

#!perl
s~~
@ARGV~;print$1until!s~(.)(?= |(.).+\2.*\1)~~s

Score: 49.09 (pass)

This one has even better tie-breaker, in the 3rd decimal place.

Ah, \2 instead of $2 in the replacement. That indeed wins. You are now strictly the leader on postorder

#!perl
s~~
@ARGV~;print$1until!s~(.)( |(.).+\3.*\1)~\2~s

Score: 49.11 (pass)

I never imagined when reading the problems that I could get the same score on postorder as on factorial.

that's because your factorial is so long

#!perl
s//
@ARGV/;print$1until!s~(.)( |(.).+\3.*\1)~$2~s

Score: 49.11 (pass)

Fractionally better tiebreaker. Yes, I know it doesn't even change my official score. But that's the problem with tiebreakers to 4 d.p.!

#!perl
s//
@ARGV/;print$1until!s~(.)(?= |(.).+\2.*\1)~~s

Score: 54.12 (pass)

My fourth solution, and I've used three completely different algorithms.

#!perl
print s~(.)( |(.).+\3.*\1)~$2~?$1:$/while$2||s//@ARGV/

Score: 59.12 (pass)

I thought \X in place of \C would work, but it gives me a seg fault!

#!perl -l
$_="@ARGV";$}=$1.$},s~$1~
~gwhile/(.)\C+\1.*
*$/;print$}

Score: 63.11 (pass)

#!perl -l
$_=pop;$ARGV[0]=~/[$&]/,$}=$&.$},s~$&~
~while/.+
*$/;print$}

Score: 79.10 (pass)

16 strokes just to put a \n in the right place.

#!perl
$_|=pop;$z|=pop;/[$z]/;$}+=$z=~/$&/;do$0if$z=$`;do$0if$z=$';--$}or$\=$/;print$&