Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
1-liner: sort it out solution in Clear category for Sort Array by Element Frequency by przemyslaw.daniel
frequency_sort = lambda data: sorted(data, key=lambda x: (-data.count(x), data.index(x)))
Dec. 7, 2018