[SPOILER] Solution for QOTW 23

Mark Jason Dominus <[email protected]>
Newsgroups gmane.comp.lang.perl.qotw.discuss
Organization Plover Systems
Message-ID <[email protected]>
I'm really pleased with this.  And I'm glad about the 60-hour
moratorium, because my first couple of solutions weren't nearly as
excellent.

#!/usr/bin/perl -l

print $_ = "()" x shift;
print while s{^  ( \(+ )  ( \)+ ) \(  }
             {"()" x (length($2) - 1)
              . "("  x (length($1) - length($2) + 2) 
              . ")" 
             }xe;



__END__
That's all.

:) :) :D
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.