Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
city_companies = {
apple: ["Boston", "Seattle", "San Francisco"],
uniliver: ["London", "Sussex"],
microsoft: ["Seattle", "Austin", "Denver"],
amazon: ["Portland", "Denver", "Washington"],
starbucks: ["Beijing", "Seattle", "Munich"]
}
tech_giants = [:apple, :microsoft, :amazon]
tech_giants_cities = city_companies
.select {|company, cities| tech_giants.include?(company)}
.map {|company, cities| cities}
.flatten
.uniq
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment