If I have a list [1,3,1,3,1,2] for example how do I sort this list to output another list that sorts by number of occurrences and outputs a list in order of occ
[1,3,1,3,1,2]