View Problem

Find the common items in two lists

Given two lists, find the common items. E.g. given beans = ['broad', 'mung', 'black', 'red', 'white'] and colors = ['black', 'red', 'blue', 'green'], what are the bean varieties that are also color names?
ExpandDiskEdit
ruby
common = (beans.intersection(colors)).to_a

Submit a new solution for ruby
There are 20 other solutions in additional languages (clojure, cpp, csharp, erlang ...)