|
|
These were even faster for a large number of elements:
(0..99999).to_a.shuffle[0..4],
(0..99999).sort_by{rand}[0..4]. (Than this:
(0..99999).to_a.sort{rand() -0.5 }[0..4].)
Source: https://brettterpstra.com/6b5feb74-4208-11e9-9d31-040140774501
Snapshot: 2026-04-26T16:09:46Z
Generator: Remarkbox b35c136