June 2018 Update
This commit is contained in:
parent
ba8067c3b7
commit
22f33d4004
5278 changed files with 84726 additions and 14379 deletions
|
|
@ -6,24 +6,24 @@ extension op
|
|||
{
|
||||
mode
|
||||
[
|
||||
var aCountMap := Dictionary new default:0.
|
||||
var aCountMap := Dictionary new(0).
|
||||
self forEach(:anItem)
|
||||
[
|
||||
aCountMap[anItem] := aCountMap[anItem] + 1
|
||||
].
|
||||
|
||||
aCountMap := aCountMap array_list; sort(:p:n)(p > n).
|
||||
aCountMap := aCountMap values; sort(:p:n)(p > n).
|
||||
|
||||
var aMax := aCountMap firstMember.
|
||||
|
||||
^ aCountMap
|
||||
filterBy(:kv)(aMax equal:kv);
|
||||
filterBy(:kv)(aMax equal(kv value));
|
||||
selectBy(:kv)(kv key);
|
||||
toArray.
|
||||
]
|
||||
}
|
||||
|
||||
program =
|
||||
public program =
|
||||
[
|
||||
var anArray1 := (1, 1, 2, 4, 4).
|
||||
var anArray2 := (1, 3, 6, 6, 6, 6, 7, 7, 12, 12, 17).
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue