Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
1-liner: sorted(iterable, key) solution in Creative category for Sort Array by Element Frequency by ainem
frequency_sort = lambda A: sorted(A, key = lambda a: (-A.count(a), A.index(a)))
May 19, 2022