fork download
  1. open $in, '<', "shortest-accepted.in";
  2. <$in>;
  3. while(<$in>){
  4. s/\$+/()/g;
  5.  
  6. 1 while 0
  7. || s/ \w \*+ //x
  8. || s/ (?<![)*a-z]) (\w*) \| (\w*) (?![(a-z]) /
  9. $capture_1 = $1, $capture_2 = $2,
  10. (
  11. sort { (length $a) <=> (length $b) || $a cmp $b } ( $capture_1, $capture_2 )
  12. )[0]
  13. /xe
  14. || s/\( (\w*) \) \*+ //x
  15. || s/\( (\w*) \) /$1/x ;
  16.  
  17. (length) or $_ = q($);
  18. print $_, "\n"
  19. }
Success #stdin #stdout 0s 6000KB
stdin
Standard input is empty
stdout
Standard output is empty