Beefy Boxes and Bandwidth Generously Provided by pair Networks
Come for the quick hacks, stay for the epiphanies.
 
PerlMonks  

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

by swl (Parson)
on Nov 21, 2020 at 03:06 UTC ( [id://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
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11123958]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others goofing around in the Monastery: (3)
As of 2024-04-25 07:52 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found