Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
9
Task/Averages-Mode/GAP/averages-mode.gap
Normal file
9
Task/Averages-Mode/GAP/averages-mode.gap
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
mode := function(v)
|
||||
local c, m;
|
||||
c := Collected(SortedList(v));
|
||||
m := Maximum(List(c, x -> x[2]));
|
||||
return List(Filtered(c, x -> x[2] = m), y -> y[1]);
|
||||
end;
|
||||
|
||||
mode([ 7, 5, 6, 1, 5, 5, 7, 12, 17, 6, 6, 5, 12, 3, 6 ]);
|
||||
# [ 5, 6 ]
|
||||
Loading…
Add table
Add a link
Reference in a new issue