Can't pass the test [6, 6, 6, 45, 45, 99, 99, 5, 13, 34]. What is wrong with my code?
def frequency_sorting(numbers):
if list(set(numbers)) == numbers:
return numbers
else:
numbers = sorted(numbers[::-1], key=numbers.count, reverse=True)
return sorted(numbers, key=numbers.index)
Created at: 2020/10/07 03:41; Updated at: 2020/10/07 11:59
The question is resolved.