Anonymous user
Anagrams: Difference between revisions
→{{header|Groovy}}
(Add Groovy) |
|||
Line 166:
def groups = words.groupBy{ it.toList().sort() }
def bigGroupSize = groups.collect{ it.value.size() }.max()
println groups.findAll(bigAnagrams).collect{ it.value }.collect{ it.join(' ') }.join('\n')</lang>
produces this output:
<pre>
|