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 tokiojapan55
def frequency_sort(items):
counter = {item: items.count(item) for item in items}
result = []
for item in sorted(counter.items(), key=lambda i:i[1], reverse=True):
result += [item[0]] * item[1]
return result
June 22, 2020