Help for this page

Select Code to Download


  1. or download this
    use warnings;
    use strict;
    ...
    sub RegexSort {
        return (length ((sort {length $b <=> length $a} $str =~ m[((.)\2+)
    +]g)[0]), -1);
    }
    
  2. or download this
    Index: Run from 701117 for 30
    Linear: Run from 701117 for 30
    ...
    Linear    1.05/s        --      -77%      -82%
    RegexSort 4.56/s      334%        --      -21%
    Index     5.77/s      450%       27%        --