Skip to content

Instantly share code, notes, and snippets.

@qxjit
Forked from jbrechtel/foo.rb
Created March 6, 2012 16:22
Show Gist options
  • Save qxjit/1987196 to your computer and use it in GitHub Desktop.
Save qxjit/1987196 to your computer and use it in GitHub Desktop.
foo
def foo(nums)
h = Hash.new([])
nums.each { |n| h[n] << n }
puts h.inspect
puts h['foo']
end
#YETANOTHERREASONMUTABLESTATEISTERRIBLE
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment