FWIW: this passed with a time of 4.56s. The main difference between this and failing attempts -- besides the correction for dups -- is preallocation of the array size:
$max = <>; $#n = $max; ++$n[ $_ ] while <>; defined $n[$_] and print "$_\n" x $n[$_] for 0 .. $#n; exit 0;
In reply to Re^3: Sorting challenge (Insertion sort)
by BrowserUk
in thread Sorting challenge
by PerlSufi
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |