Skip to content

Instantly share code, notes, and snippets.

@kenchan
Created November 26, 2009 10:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kenchan/243373 to your computer and use it in GitHub Desktop.
Save kenchan/243373 to your computer and use it in GitHub Desktop.
#!/bin/env ruby
n = 3
hash = {}
n.downto(1).each { |i| hash[i] = [] }
hoges.each do |hoge|
hash[hoge.fuga] << fuga if hash[hoge.fuga]
end
n.downto(1).each do |i|
puts hash[i]
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment