Skip to content

Instantly share code, notes, and snippets.

@0x1eef

0x1eef/foo.rb Secret

Last active December 7, 2022 22:12
Show Gist options
  • Save 0x1eef/e7939d304d968c085dbcff801ed5a9b8 to your computer and use it in GitHub Desktop.
Save 0x1eef/e7939d304d968c085dbcff801ed5a9b8 to your computer and use it in GitHub Desktop.
arr = Array.new(100_000) { rand(10_000) }
arr.push(10_001)
arr.each_slice(1_000).map do |slice|
fork do
slice.find { |el| slice.count { el } == 1 }
end
end.each { Process.wait(_1) }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment