Data commit

This commit is contained in:
Ingy döt Net 2023-07-01 11:58:00 -04:00
parent 7387c8f97b
commit cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions

View file

@ -0,0 +1,17 @@
modes[vals] :=
{
count = countToArray[vals]
biggest = count@0@1
result = new array
for i = rangeOf[count]
if count@i@1 < biggest
break // count is sorted so we can bail out when numbers decrease
else
result.push[count@i@0]
return result
}
println[modes[[1, 3, 6, 6, 6, 6, 7, 7, 12, 12, 17]]]
println[modes[[1, 1, 2, 4, 4]]]

View file

@ -0,0 +1 @@
modes[vals] := mostCommon[vals]@0