Skip to content

Instantly share code, notes, and snippets.

@chrislerum
Created May 15, 2010 05:22
Show Gist options
  • Save chrislerum/402034 to your computer and use it in GitHub Desktop.
Save chrislerum/402034 to your computer and use it in GitHub Desktop.
h = {true => 0, false => 0}
[false, true, true, true, true, false].each do |x|
h.merge!({x => h[x] + 1})
end
if h[true] > h[false]
puts 'true'
elsif h[true] < h[false]
puts 'false'
else
puts 'same'
end
=> true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment