Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
First solution in Clear category for Sort Array by Element Frequency by Malfoj
def frequency_sort(items):
my_dict = {x: items.count(x) for x in items}
data = sorted(my_dict.items(), key=lambda x: (x[1]), reverse=True)
out = [a for a, b in data for b in range(0, b)]
return out
June 19, 2019