Anonymous user
Averages/Mode: Difference between revisions
m
→{{header|Elena}}
(Added Easylang) |
imported>Arakov |
||
(One intermediate revision by one other user not shown) | |||
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}}
Line 3,727:
=={{header|Wren}}==
<syntaxhighlight lang="
static mode(arr) {
var map = {}
|