Skip to content

Instantly share code, notes, and snippets.

@nbatalla03
Created July 29, 2013 15:58
Show Gist options
  • Save nbatalla03/6105392 to your computer and use it in GitHub Desktop.
Save nbatalla03/6105392 to your computer and use it in GitHub Desktop.
def grocery(item)
list = Hash.new(0)
if list.include?(item)
list[item] += 1
else
list[item] = 1
end
list
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment