Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
1-liner: sorted by count & index(natural order) solution in Creative category for Frequency Sorting by Stensen
frequency_sorting = lambda l: sorted(l, key=lambda i: (-l.count(i), [*range(max(l)+1)].index(i)))
Sept. 24, 2020