Anagrams: Difference between revisions
Content deleted Content added
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>
|