Created
February 19, 2014 21:35
-
-
Save fresh5447/9102128 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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