Skip to content

Instantly share code, notes, and snippets.

@fresh5447
Created February 19, 2014 21:35
Show Gist options
  • Save fresh5447/9102128 to your computer and use it in GitHub Desktop.
Save fresh5447/9102128 to your computer and use it in GitHub Desktop.
def add_item(item, list)
list << item unless list.include?(item)
list
end
def remove_item(item, list)
list.delete(item)
list
end
def full_list(list)
list.uniq.sort
end
p full_list(["apple", "orange", "orange", "banana"])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment