Anonymous user
Averages/Mode: Difference between revisions
m
→{{header|Elena}}
m (→{{header|Wren}}: Changed to Wren S/H) |
imported>Arakov |
||
Line 990:
=={{header|Elena}}==
ELENA
<syntaxhighlight lang="elena">import system'routines;
import system'collections;
Line 1,000:
{
var countMap := Dictionary.new(0);
self.forEach::(item)
{
countMap[item] := countMap[item] + 1
};
countMap := countMap.Values.sort::(p,n => p > n);
var max := countMap.FirstMember;
^ countMap
.filterBy::(kv => max.equal(kv.Value))
.selectBy::(kv => kv.Key)
.toArray()
}
Line 1,018:
public program()
{
}</syntaxhighlight>
{{out}}
|