Skip to content

Instantly share code, notes, and snippets.

@adambutler
Created March 30, 2016 14:13
Show Gist options
  • Save adambutler/1ceba475235b551ad732901dbdef70c1 to your computer and use it in GitHub Desktop.
Save adambutler/1ceba475235b551ad732901dbdef70c1 to your computer and use it in GitHub Desktop.
i = 100
z = []
i.times do
a = []
while true
c = (0...5).map { (65 + rand(26)).chr }.join
break if a.include? c
a << c
end
z << a.size
end
puts """
MIN: #{z.min}
MAX: #{z.max}
AVG: #{z.sum / i}
"""
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment