Skip to content

Instantly share code, notes, and snippets.

@chiragmongia
Created March 6, 2013 07:54
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 chiragmongia/5097500 to your computer and use it in GitHub Desktop.
Save chiragmongia/5097500 to your computer and use it in GitHub Desktop.
arr= "Ruby is scripting language".split(//)
h1 = Hash.new(0)
arr.each { |word| h1[word] += 1}
h1.each {|word, h1| puts word+"-"+h1.to_s}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment