Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re^3: Fastest way to "pick without replacement"

by swl (Priest)
on Nov 21, 2020 at 03:06 UTC ( #11123958=note: print w/replies, xml ) Need Help??


in reply to Re^2: Fastest way to "pick without replacement"
in thread Fastest way to "pick without replacement"

The sort should also be numeric.

hash_slice => sub { my %ha; @ha{0..$#numbers} = @numbers; delete @ha{@indices}; my @output = @ha{sort {$a <=> $b} keys %ha}; join("\0", @output) eq join("\0", @expect) or die if TEST; },

Update: Although I now see Choroba has already done that in 11123952.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://11123958]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (3)
As of 2021-04-11 17:57 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?