32 lines
758 B
Text
32 lines
758 B
Text
[ sort
|
|
[] [] rot
|
|
dup 0 peek temp put
|
|
witheach
|
|
[ dup temp share = iff
|
|
join
|
|
else
|
|
[ dup temp replace
|
|
dip [ nested join ]
|
|
[] join ] ]
|
|
nested join
|
|
temp release ] is bunch ( [ --> [ )
|
|
|
|
[ sortwith [ size dip size < ]
|
|
[] swap
|
|
dup 0 peek size temp put
|
|
witheach
|
|
[ dup size temp share = iff
|
|
[ nested join ]
|
|
else
|
|
[ drop conclude ] ]
|
|
temp release
|
|
[] swap
|
|
witheach
|
|
[ 0 peek join ] ] is largest ( [ --> [ )
|
|
|
|
|
|
[ bunch largest ] is mode ( [ --> [ )
|
|
|
|
' [ 1 3 5 7 3 1 3 7 7 3 3 ] mode echo cr
|
|
' [ 7 13 5 13 7 2 7 10 13 ] mode echo cr
|
|
' [ 5 ] mode echo cr
|