Forgot another //
#!perl -l
$_=pop;for$~(pop=~?.?g){s|$~(.*)|
$1
$~|}print??
|
Huh? Why isn't the /g needed in the last regexp? Well, it passes the tests, so it must be correct... :-)
#!perl -l
$_=pop;for$~(pop=~/./g){s|$~(.*)|
$1
$~|}print//
|
// - ?? for tiebreaker
#!perl -l
$_=pop;for$~(pop=~?.?g){s|$~(.*)|
$1
$~|}print//
|
Doh! \w -> .
#!perl -l
$_=pop;for$~(pop=~/./g){s|$~(.*)|
$1
$~|}print//g
|
Change the separator from ~ to \n, to allow changing a \w to a .
#!perl -l
$_=pop;for$~(pop=~/\w/g){s|$~(.*)|
$1
$~|}print//g
|
Change from a map to a for loop (for the named loop variable), take advantage of the empty regexp.
#!perl -l
$_=pop;for$p(pop=~/\w/g){s/$p(\w*)/~$1~$p/}print//g
|
Remove unneccessary parts from regexp, tweak tiebreaker.
#!perl -l $b=pop;map$b=~s/$_(\w*)/~$1~$_/,pop=~/./g;print$b=~/\w/g |
I was really happy with my (unsubmitted) 148 solution, until I checked the leaderboard. There's no way a 50 could be anything but a regexp solution, so I came up with this.
#!perl -l $b=pop;map$b=~s/(\w*)$_(\w*)/$1 $2 $_/,pop=~/./g;print$b=~/\w/g |