Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
|
|
@ -0,0 +1,14 @@
|
|||
sub radsort (@ints) {
|
||||
my $maxlen = max @ints».chars;
|
||||
my @list = @ints».fmt("\%0{$maxlen}d");
|
||||
|
||||
for reverse ^$maxlen -> $r {
|
||||
my @buckets = @list.classify( *.substr($r,1) ).sort: *.key;
|
||||
@buckets[0].value = @buckets[0].value.reverse.List
|
||||
if !$r and @buckets[0].key eq '-';
|
||||
@list = flat map *.value.values, @buckets;
|
||||
}
|
||||
@list».Int;
|
||||
}
|
||||
|
||||
.say for radsort (-2_000 .. 2_000).roll(20);
|
||||
Loading…
Add table
Add a link
Reference in a new issue