ruby-uebungen/Assignment_023/solution/readme.md

16 lines
218 B
Markdown

# Lösung: Hashes
```ruby
worte = %w{ Bier Schnaps Bier Vodka Rum Baileys Rum Bier Vodka Bier Hugo }
def de_dupe(input)
hash = {}
input.each { |e| hash[e] = true }
hash.keys.sort
end
puts de_dupe(worte)
```