79814553

Date: 2025-11-09 02:18:47
Score: 0.5
Natty:
Report link

Use Counter.most_common() to sort by frequency and take the keys:

from collections import Counter

my_list = [3,8,11,8,3,2,1,2,3,3,2]
new_list = [x for x, _ in Counter(my_list).most_common()]
# new_list -> [3, 2, 8, 11, 1]
Reasons:
  • Low length (0.5):
  • Has code block (-0.5):
  • Low reputation (0.5):
Posted by: Lavi Kumar