in reply to Is it possible to make reference to substrings and sort them?
my @suff = 0 .. length $string; pop @suff; @suff = sort { substr($string, $a) cmp substr $string, $b } @suff; for my $idx (@suff) { print substr $string, $idx - 1, 1; } print "\n";
Update: Now I noticed they mentioned O(|Text|) solution wasn't needed in the Note.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Is it possible to make reference to substrings and sort them?
by hdb (Monsignor) on Mar 22, 2015 at 12:06 UTC |