RosettaCodeData/Task/Function-frequency/Mathematica/function-frequency.math

2 lines
151 B
Text
Raw Permalink Normal View History

2023-07-01 11:58:00 -04:00
programCount[fn_] := Reverse[If[Length[#] > 10, Take[#, -10], #] &[SortBy[Tally[Cases[DownValues[fn], s_Symbol, \[Infinity], Heads -> True]], Last]]]