Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
1 line solution solution in Clear category for Sort Array by Element Frequency by fishsouprecipe
def frequency_sort(items):
return list(sorted(items, key=lambda i: (-items.count(i), items.index(i))))
March 4, 2020